Fail to plot electric field lines in a neBEM geometry

microb2.C (3.7 KB)

Dear experts,

Please have a look at the attached code and picture. I built a neBEM example in garfield++ that I used in past with the standalone version. The left and top central plot are obtained with the garfield++ code I provided, while the bottom central and right plot with the standalone garfield.
I would like to have superimposed on the left plot the electric field lines as shown on the bottom central plot. I am getting when I execute it: ViewField::EqualFluxIntervals:
** The flux changes sign over the line.**
Could you please have a look?

Thanks a lot in advance

Georgios

I am adding @hschindl in the loop.

Hi Georgios,
thanks for your message and apologies for the delay in getting back to you.

I managed to get a plot showing both the contours of the potential and the field lines using the piece of code below (essentially the same as yours):

  ViewField fieldView(&nebem);
  fieldView.SetPlane(0, -1, 0, 0, 0, 0);
  fieldView.SetArea(-0.01, -0.01, 0.0, 0.01, 0.01, 0.01);
  fieldView.SetNumberOfContours(10);
  fieldView.PlotContour();

  std::vector<double> x1;
  std::vector<double> y1;
  std::vector<double> z1;
  fieldView.EqualFluxIntervals(-0.008, 0., 0.007, 0.008, 0., 0.007,
                               x1, y1, z1, 15);
  fieldView.PlotFieldLines(x1, y1, z1, true, false);

I had to reduce the number of periodic copies though to get a result in a reasonable amount of time.

Just a small comment: instead of using a finite thickness for the anode plane and drift plane, you could set the thickness to zero. This will reduce the number of surface panels and elements.

1 Like

Thank you so much!
Following your suggestion I decreased the periodic copies from 10 to 2, and it works fine!

Best regards

Georgios

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