# Non-physical chord lengths with COMSOL electric field

**URL:** <https://geant4-forum.web.cern.ch/t/non-physical-chord-lengths-with-comsol-electric-field/12229>\
**Category:** Geometry, Fields and Transportation\
**Created:** [May 8, 2024, 5:35am UTC](https://geant4-forum.web.cern.ch/t/non-physical-chord-lengths-with-comsol-electric-field/12229 "2024-05-08T05:35:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hungbt1908](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/hungbt1908/32/6568_2.png) [@hungbt1908](https://geant4-forum.web.cern.ch/u/hungbt1908)\
**Post date:** [May 8, 2024, 5:35am UTC](https://geant4-forum.web.cern.ch/t/non-physical-chord-lengths-with-comsol-electric-field/12229/1 "2024-05-08T05:35:47Z")

</div>

Please fill out the following information to help in answering your question, and also see [tips for posting code snippets](https://geant4-forum.web.cern.ch/t/how-to-post-code-snippets/9944). If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:_ 10.07  
_Operating System:_ Window 11  
_Compiler/Version:_  
_CMake Version:_

* * *

Dear all,  
I am making a new post to require help with COMSOL electric field problems.  
This post is following my last post [“non-Uniform ElectricField from COMSOL”](https://geant4-forum.web.cern.ch/t/non-uniform-electricfield-from-comsol/12205). It described my application.

The following code shows the way I create the non-uniform electric field.

```auto
void DetectorConstruction::ConstructSDandField()
{
	G4double minEps= 1.0e-4;//1.0e-5;  
    G4double maxEps= 1.0e-3;//1.0e-4;
	G4double deltainter = 0.0001*mm;
	G4double missdist = 0.1*mm;
    G4bool allLocal = true;

	G4double xOffset = 0., yOffset = 0., zOffset = 0.;
	fEMfield = new ElectricFieldSetup("RAD7_ElectricField.TABLE", xOffset, yOffset, zOffset);
	equation = new G4EqMagElectricField(fEMfield);

	// select stepper
	G4int stepperType = 6;
	const int nvar = 8;

	if(nvar == 8)
	{
		if(stepperType == 1) stepper = new G4ExplicitEuler(equation, nvar);
		if(stepperType == 2) stepper = new G4ImplicitEuler(equation, nvar);
		if(stepperType == 3) stepper = new G4SimpleRunge(equation, nvar);
		if(stepperType == 4) stepper = new G4SimpleHeum(equation, nvar);
		if(stepperType == 5) stepper = new G4ClassicalRK4(equation, nvar);
		if(stepperType == 6) stepper = new G4CashKarpRKF45(equation, nvar);
	}
	if(nvar == 6)
	{
		if(stepperType == 7) stepper = new G4DormandPrince745(equation, nvar);
	}

	//G4FieldManager* fieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager(); // get global field manager
	G4FieldManager* fieldManager = new G4FieldManager(fEMfield); // get local field manager
	fieldManager->SetDetectorField(fEMfield);
	G4double minStep = 0.010*mm ; // minimal step of 10 microns
	G4MagInt_Driver* intgrationDriver = new G4MagInt_Driver(minStep, stepper, stepper->GetNumberOfVariables());
	G4ChordFinder* chordFinder = new G4ChordFinder(intgrationDriver);
	chordFinder->SetDeltaChord(missdist);
	fieldManager->SetChordFinder(chordFinder);
	fieldManager->SetMinimumEpsilonStep(minEps);
	fieldManager->SetMaximumEpsilonStep(maxEps);
	fieldManager->SetDeltaIntersection(deltainter);
	fieldManager->SetDeltaOneStep(0.5e-1 * mm); //0.5e-3*mm
	logicSenVol->SetFieldManager(fieldManager, allLocal);
	//logicWorld->SetFieldManager(fieldManager, allLocal);
}

```

When I ran my application, It showed some warnings  
**- GeomField0003**  
 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/0/0a75f24ef9ac54e972db9c9a3f2c77884caac6e9.jpeg)  
**- GeomField1001**  
 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/7/7d16f717181926f74910836b66b1004cde770e8a.jpeg)

How can I fix this warning? I appreciate any help you can provide.
