Dear All,
I have used Elmer to solve the electrostatic’s field equations, and I have succesfully imported it on Garfield with the “ComponentElmer” class. I was also able to plot the equipotential surfaces with ViewField. However, what I really need to visualize is the electric field lines. Is this possible to do? This is the piece of code that I am using:
const double ext_x = 19.0; // external box x-width
const double ext_y = 1.0; // external box y-width
const double ext_z = 25.0; // external box z-width
TCanvas * c1 = new TCanvas();
ComponentElmer * elm = new ComponentElmer("Field_cage_2/mesh.header","Field_cage_2/mesh.elements","Field_cage_2/mesh.nodes","Field_cage_2/dielectrics.dat","Field_cage_2/field_cage_2.result","mm");
elm->SetMedium(0,gas);
Sensor* sensor = new Sensor();
sensor->AddComponent(elm);
sensor->SetArea(-1*ext_x,-1*ext_y,-1*ext_z,ext_x,ext_y,ext_z);
// Set up the object for field visualization.
ViewField * vf = new ViewField();
vf->SetSensor(sensor);
vf->SetCanvas(c1);
vf->SetArea(-1*ext_x,-1*ext_z,ext_x,ext_z);
vf->SetNumberOfContours(50);
vf->SetNumberOfSamples2d(50,50);
vf->SetPlane(0,-1,0,0,0,0);
ViewFEMesh * vFE = new ViewFEMesh();
vFE->SetCanvas(cdrift);
vFE->SetComponent(elm);
vFE->SetPlane(0,-1,0,0,0,0);
vFE->SetFillMesh(true);
vFE->SetColor(1,kBlue);
vFE->SetArea(-1*ext_x,-1*ext_z,-1*ext_z,ext_x,ext_z,ext_z);
vf->PlotContour("v");
vFE->Plot();
app.Run(kTRUE);
return 0;
}
Thank you very much in advance!
Sabrina