ComponentVoxel : How to have access to the values of the magnetic field

Hello everyone,

I created a parallelepipd magnetic field and now I try to have access to the magnetic field in a random point inside my magnetic volume (after interpolation). However, I cannot find any function for that, for example a function which could have the coordinates (x,y,z)in arguments and which could return either an error message if is outside the volume or outside the mesh if it is not interpolated either the value of the magnetic field.

Do you know a such function ?

Here is my code, which lines could I add for that ?

const unsigned int nx=13;
	const unsigned int ny=13;
	const unsigned int nz=251;
	const double xmin=-240;
	const double xmax=240;
	const double ymin=-240;
	const double ymax=240;
	const double zmin=-5000;
	const double zmax=5000;

	const std::string filename = "data_test.txt";
	const std::string format= "XYZ";
	ComponentVoxel *mesh=new ComponentVoxel();
	mesh->SetMesh(nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax);
	mesh->LoadMagneticField(filename,format,1,1);
	mesh->EnableInterpolation(true);

Thank you in advance for your answers,

Kali95

I forgot to add the file from where I am taking the datas :

data_test.tar.gz (1.1 MB)

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