When using neBEM to calculate the electric field, can the drift line be plotted superimposed on the geometry?

when using neBEM to calculate the electric field, can the drift line be plotted superimposed on the geometry?

Dear @newconcept1979

I am also not 100% sure this can be done. While for ViewFEMesh there is the function SetViewDrift (see doxygen documentation), there is no such function in the ViewGeometry class. But I would think that one could try to plot the 2d geometry and the drift line on the same canvas, if one is careful to choose the same coordinates.

So I would suggest you try and eventually come back if you encounter a problem? A good starting point would be the nebem example.

Eventually you could contribute to garfield++ development by implementing functions to draw 2D and 3D drift lines in the ViewGeometry class (following the example of ViewFEMesh) or develop a ViewNeBEM class.

Kind regards
Piet

@Piet , when plotting drift line firstly, everything worked well!

Dear @newconcept1979 I am happy to hear you tried and it worked. Can you maybe post your code (or a minimal example that reproduces your result) such that we have this documented for future users?
Thanks
Piet

The key codes is:

  GeometrySimple geo;
  geo.SetMedium(&gas);
  MediumConductor cu;
  SolidTube tubeA(0,0,1,1.8,0.02);
  tubeA.SetBoundaryPotential(3000.);
  tubeA.SetLabel("s");
  SolidTube tubeC(0,0,-1,1.8,0.02);
  tubeC.SetBoundaryPotential(0.);
  geo.AddSolid(&tubeA,&cu);
  geo.AddSolid(&tubeC,&cu);


  ComponentNeBem3d nebem;
  nebem.SetGeometry(&geo);
  nebem.SetTargetElementSize(0.1);
  nebem.Initialise();

  

  ViewGeometry geoView;
  geoView.SetGeometry(&geo);
  geoView.SetArea(-2.,-1.1,2.,1.1);
  geoView.SetPlane(0,-1,0,0,0,0);
  TCanvas* c1=new TCanvas("","",1200,1200);
  geoView.SetCanvas(c1);


  ViewDrift driftView;
  driftView.SetCanvas(c1);
  driftView.SetArea(-2.,-1.1,2.,1.1);
  driftView.SetPlane(0,-1,0,0,0,0);
  driftView.Plot2d(true);
  geoView.Plot2d();
  c1->Print("NeBem.ps");
1 Like

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