Output data with fixed step size.

General discussion about Elmer
Post Reply
cghw01
Posts: 6
Joined: 17 Oct 2022, 17:46
Antispam: Yes

Output data with fixed step size.

Post by cghw01 »

Hello,
I have an external program for simulating particle trajectories in a magnetic field which needs to be supplied. The field is defined in an input file thus:
16 16 16 (Number of points in x, y and z directions)
-200.0 -150.0 -150.0 20.0 (start coordinates x0,y0,z0 and step size, all in mm)
0.0 0.0 1.0 (x,y,z field components, in Teslas)
0.0 0.0 1.0
etc
etc

Is there a way to output data from Elmer in such a format ? (or similar - I could use matlab or python to rearrange the data)

I am new to Elmer and I used the tutorial 15 (2D Horseshoe magnet) and I was able to view the magnetic potential in Paraview, but not the magnetic field. Any suggestion as to what I might have done wrong would be appreciated.

Thanks in advance
Chris
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Output data with fixed step size.

Post by raback »

Hi Chris,

You could use SaveGridData solver. The primary field is potential. You need to calculate the derived fields with MgDynCaldFields. I would guess that you want 3D in the end so you also need to rather follow some 3D example with WhitneyAVSolver.

You could also use the internal particle tracking of Elmer to follow the particles in magnetic field. You introduce an interpolation error when you enforce the field to regular grid (unless the initial mesh is the same).

-Peter
Post Reply