|Message: Re: Electric potential / non-uniform electric field||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I searched for the answers in the previous messages to the forum, but unfortunately in vain. I maybe expressed myself not entirely exactly. What I meant by "adding a field to component" should have been "defining the field inside a volume". I have used an example from /advanced/purging_magnet to define a non-uniform magnetic field which is read from file containing information about the field. In order to do the same with the non-uniform electric field I have made a "conversion" of the magnetic field to electric (as shown below) feeding to the program a file with information about the electric field:
G4ThreeVector positionEl3Field = G4ThreeVector(0,0,1*m); G4double fieldValueEF3 = 0.2*kilovolt/cm; G4FieldManager *pFieldMgrEF3;
//Field grid in A9.TABLE. File must be in accessible from run urn directory. G4ElectricField* PurgEl3Field= new TabulatedElField2D3D("MMPS_in_edit.txt", 0,0,0);
G4cout<< "DeltaStep "<<pFieldMgrEF3->GetDeltaOneStep()/mm <<"mm" <<endl;
G4EqMagElectricField *myEquationEF3 = new G4EqMagElectricField(PurgEl3Field);
G4int nvar3 = 8; // Need to integrate 8 variables: x,y,z,p[xyz],E,t
G4MagIntegratorStepper* myStepperEF3 = new G4ClassicalRK4(myEquationEF3,nvar3); G4MagInt_Driver* myIntgrDriverEF3 = new G4MagInt_Driver(1.0e-3*mm, myStepperEF3, myStepperEF3->GetNumberOfVariables()); G4ChordFinder* myChordFinderEF3 = new G4ChordFinder(myIntgrDriverEF3);
bool fieldIsInitialized = true;
Here, MMPS_in_edit.txt is the file with the electric field components (x,y,z,E). The program compiles, however, when I try to run it, the program returns "Segmentation fault" and quits without giving a hint of what could go wrong.
I would really appreaciate if you help me with this problem, Thank you.
|Inline Depth:||Outline Depth:||Add message:|