# Periodic conditions with MPGD layout in neBEM

**URL:** <https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443>\
**Category:** Garfield++\
**Created:** [November 26, 2025, 4:51pm UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443 "2025-11-26T16:51:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzunica](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/3e96dc/32.png) [@gzunica](https://root-forum.cern.ch/u/gzunica)\
**Post date:** [November 26, 2025, 4:51pm UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443/1 "2025-11-26T16:51:13Z")

</div>

Dear Experts,

I’m trying to simulate a simple alternating strips layout (equally spaced field and sense strips) with neBEM.  
I would like to implement periodic copies of a basic “cell” to avoid edge effects and reduce computation time of the influence matrix, but haven’t succeeded so far.  
Specifically, if the periodic length of the cell set with “SetPeriodicX” falls in the middle of a strip (eg half of the strip is out of the periodic length), this is canceled out of the geometry (at least in the field computation). This same approach works using eg wires instead of strips.  
I have then resorted to halving the width of these strips and setting the period such that after applying the periodic condition the strip width is correct again. Still, the field achieved is slightly different from the one computed for a “whole” strip.  
Playing around with different Perdiocities didn’t help either.

Is there a solution to this problem?

Thank you in advance!  
Bonus issue: i’ve tried using “SetMirrorPeriodicity”, but i keep getting the following message: “Mirror not correctly implemented in this version of neBEM”.

I attach here a basic working example.

```auto

int main(int argc, char* argv[]) {

   

  TApplication app("app", &argc, argv);

  MediumMagboltz gas;
  gas.LoadGasFile("/afs/cern.ch/work/g/gzunica/garfield/Examples/GasFile/ar_93_co2_7.gas");
  gas.LoadIonMobility("/afs/cern.ch/work/g/gzunica/garfield/Data/IonMobility_Ar+_Ar.txt");
  gas.SetPressure(760.);
  gas.SetTemperature(293.15);

  MediumConductor Cu;
  MediumPlastic glass;
  glass.SetDielectricConstant(10.0);
  
  // Geometry.
  GeometrySimple geo;

  double half_tck = 0.00015; 

  const double cat_v=-1500.;
  const double sense_v=+10.;
  const double field_v=-1700.;
  const double backplane_v=-1700.;
  

  SolidBox box1(0, 0, 0.5, 0.4,0.5, 0.0);
  box1.SetBoundaryPotential(cat_v);

  SolidBox box2(0, 0, -0.1000-half_tck, 0.4,0.5, 0.1);
  box2.SetBoundaryDielectric();

  SolidBox box3(0, 0, -0.2000-half_tck, 0.4,0.5, 0.0);
  box3.SetBoundaryPotential(backplane_v);

  geo.AddSolid(&box1, &Cu);
  geo.AddSolid(&box2, &glass);
  geo.AddSolid(&box3, &Cu);

  const double radiusS = 0.0015;
  const double radiusF = 0.005;
  const double halflength = 0.5;

  double xposF = -0.2;
  double xposS = 0.0;
  double passo = 0.4;

// adding sense strips
  xposS=-0.4;
  std::vector<SolidBox*> stripsS(3, nullptr);
  for (int i = 0; i < 3; ++i) {
    std::cout<<"spos::"<<xposS;
    stripsS[i] = new SolidBox(xposS, 0.0, 0.0, radiusS, halflength,half_tck ); // alternate strips
    if(i==0) stripsS[i] = new SolidBox(xposS+radiusS/2, 0.0, 0.0, radiusS/2, halflength,half_tck ); // alternate strips
    if(i==2) stripsS[i] = new SolidBox(xposS-radiusS/2, 0.0, 0.0, radiusS/2, halflength,half_tck ); // alternate strips
    stripsS[i]->SetBoundaryPotential(sense_v);
    stripsS[i]->SetLabel("readout");
    geo.AddSolid(stripsS[i], &Cu);
    xposS += passo ;
  }

// adding field strips
  std::vector<SolidBox*> stripsF(2, nullptr);
  for (int i = 0; i < 2; ++i) {
    std::cout<<"sposF::"<<xposF;
  
    stripsF[i] = new SolidBox(xposF, 0.0, 0.0, radiusF, halflength,half_tck); //alternate strips
    stripsF[i]->SetBoundaryPotential(field_v);
    geo.AddSolid(stripsF[i], &Cu);
    xposF += passo ;
  }

  geo.PrintSolids();
  geo.SetMedium(&gas);

  ComponentNeBem3d nebem;
  nebem.SetGeometry(&geo);
  nebem.SetTargetElementSize(0.2);
  nebem.SetMinMaxNumberOfElements(1, 100); 
  nebem.SetPeriodicityX(0.8); 
  nebem.SetPeriodicityY(1.);
  nebem.SetPeriodicCopies(3,5,0);
  nebem.Initialise();

// plot geometry
  ViewGeometry geomView2d2(&geo);
    TCanvas c2("c2", "", 600, 600);
  geomView2d2.SetCanvas(&c2);
  geomView2d2.SetPlaneXY();
  geomView2d2.Plot3d();
  geomView2d2.PlotPanels();

    TCanvas c3("c3", "", 600, 600);
  // Plot field contour
  ViewField fieldView(&nebem);
  fieldView.SetCanvas(&c3);
  fieldView.SetArea(-1.,-0.4,-0.2,1.,0.4,0.5);
  fieldView.SetPlaneXZ();
  fieldView.PlotContour("v");
 

  TCanvas c4("c4", "", 600, 600);
  ViewField fieldView1(&nebem);
  fieldView1.SetCanvas(&c4);
  // Plot field contour
  fieldView1.SetPlaneXY();
  fieldView1.PlotContour("v");

 gSystem->ProcessEvents();
 app.Run(true);
}

```

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [November 26, 2025, 7:09pm UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443/2 "2025-11-26T19:09:44Z")

</div>

Hello,

Adding @hschindl in the loop.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 27, 2025, 6:41am UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443/3 "2025-11-27T06:41:17Z")

</div>

Hi,  
many thanks for the working example! I will try to reproduce/look into the issue…

Also looping in @pratikm who is the main author of neBEM and might have some insights…

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 4, 2025, 7:56am UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443/4 "2025-12-04T07:56:35Z")

</div>

Hi,  
sorry for the delay in getting back to you! Running the example you provided (but limiting the number of periodic copies to one to save time), the contour plot of the potential looks quite symmetric. Is this not what you get? What does it look like for “whole” strips?

PS: mirror symmetries are indeed not implemented at the moment.  
[one\_periodic\_copy.pdf](https://root-forum.cern.ch/uploads/short-url/PMOiUz8oV1yFuY1IPim9Qe57p3.pdf) (94.6 KB)  
[test.C](https://root-forum.cern.ch/uploads/short-url/gBKjZxKUR6f9PWdIsLQYMU5wvun.C) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![gzunica](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/3e96dc/32.png) [@gzunica](https://root-forum.cern.ch/u/gzunica)\
**Post date:** [December 4, 2025, 11:14am UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443/5 "2025-12-04T11:14:02Z")

</div>

Hi,

indeed i am getting your same result now, which means i had some overlooked imprecision in my code previously! Thank you and apologies!

For the records, the other unexpected behavior i had found is that having a full sized strip and “cutting” it in half with the boundary conditions will cause the strips to disappear.  
This can be seen if the geometry is changed to have only one sense strip (keeping the two field strips), and the periodicity set to cut the field strips in half (see below the modified relevant lines of test.C).

The best way to confirm this is setting the field strips voltage to the same value as the sense strip and setting the cathode and backplane to 0.

```auto
  const double cat_v=0.;
  const double sense_v=+10.;
  const double field_v=+10.;
  const double backplane_v=0.;

// adding sense strips
  double xS = 0.;
  const double rS = 0.0015;
  std::vector<SolidBox*> stripsS(1, nullptr);
  for (int i = 0; i < 1; ++i) {
    stripsS[i] = new SolidBox(xS , 0.0, 0.0, rS, hy, half_tck);
    stripsS[i]->SetBoundaryPotential(sense_v);
    stripsS[i]->SetLabel("readout");
    geo.AddSolid(stripsS[i], &Cu);

  }

  nebem.SetPeriodicityX( hx); 

```

This is actually the scenario that prompted my topic.

Thank you again!

 ![strips_periodicity_test](https://root-forum.cern.ch/uploads/default/original/3X/1/6/168c786317a88e97149e5c09794060b5f9cccdb9.png)

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 18, 2025, 11:14am UTC](https://root-forum.cern.ch/t/periodic-conditions-with-mpgd-layout-in-nebem/64443/6 "2025-12-18T11:14:41Z")

</div>

Closed on December 18, 2025, 11:14am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
