How to extract the points used by garfield at this plot?

I am using the following code at Garfield++ to plot the electric field setup:

  fieldView.SetComponent(&cmp);
  fieldView.SetNumberOfSamples1d(1000);
  fieldView.SetElectricFieldRange(0,3000);
  fieldView.PlotProfile(0,0,0,raiointal,0,0,"e",false); //if you want to graph the electric field
  fieldView.GetCanvas();

The plot is fine, and tecnically there is no problem. I would like to know, actually, how to get the points that the program uses to plot it? That is, i would like to have a file.txt that gives me the points (x,y) that the program is using to plot it.

Is there a way to extract it?

Hi @Lucas_Santos_Sousa,

@hschindl should be able to help you with your question.

Cheers,
J.

Hi,
you can retrieve the electric field and potential at a point (x, y, z) like this

Medium* medium = nullptr;
double ex = 0., ey = 0., ez = 0., v = 0.;
int status = 0;
cmp.ElectricField(x, y, z, ex, ey, ez, v, medium, status);

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