Hi All,
I have a simple case with a magnet and I want to plot B over a line. I am using SaveLine to generate the data. In 3D I get an OK line but in 2D (axi-symmetric) the line is wrong (see figure). I am using a very coarse mesh for now, only for testing my scripts. Is there a limitation with SaveLine when trying to interpolate in 2D cases or am I doing something wrong?
Cheers,
Francisco
SaveLine with MagnetoDynamics2D axi-symmetric case (SOLVED)
SaveLine with MagnetoDynamics2D axi-symmetric case (SOLVED)
Last edited by fjimenez on 26 Oct 2022, 18:31, edited 1 time in total.
-
- Posts: 2312
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
When I do it in paraview it looks good
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
Thanks for taking a look at the case. Yes, in paraview it looks OK, that is why I am wondering if this is a limitation of SaveLine. I'd rather get all the data directly from Elmer since I have struggled in the past with scripts that I wrote for old versions of paraview that do not work with new ones. Particularly when they went from 5.9 to 5.10.
Cheers,
Francisco
Cheers,
Francisco
-
- Posts: 2312
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
The nodal values look OK, there are nodes along the line, the element values are choppy, the element centers are off the line
column c are the nodal values
column c are the nodal values
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
oh, I forgot about the nodal values. I think this will work for what I need to do, thanks for your help. Still wondering why the elements interpolation
does not work. They are OK in 3D though.
Cheers,
Francisco
does not work. They are OK in 3D though.
Cheers,
Francisco
-
- Posts: 2312
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
Might be due to the tolerance of the element centers to the line. The nodes are spot on, but due to mesh size some element centers may be considered on the line and some may not be considered on the line.
-
- Site Admin
- Posts: 4828
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
Hi
There was an unfortunate confusion among the solvers. Historically the VTU output was the 1st Solver to properly treat DG fields with jumps. So the averaging was implemented to the ResultOutputSolver. When SaveLine is used after that the lines look pretty. Unfortunately in your case you had chosen the execution slots such that the SaveLine is called before averaging.
It is indeed quite a poor feature that the averaging is a side effect of saving VTU files. Hence I added a keyword "Average Within Materials = True" such that the averaging may be done in the primary solver of MagnetoDynamics (and also EMWaveSolver and VectorHelmholtz). The ResultOutputSolver knows not to do it again. This way we are no longer dependent on the VTU output to average things.
Note that the keyword "Average Within Materials" is already used by some proper DG solvers to add glueing terms. This make the averaging implicit whereas the new use of the keyword is done after the elemental fields have been created.
I will commit this to "devel" within ~30 minutes after running the tests.
-Peter
There was an unfortunate confusion among the solvers. Historically the VTU output was the 1st Solver to properly treat DG fields with jumps. So the averaging was implemented to the ResultOutputSolver. When SaveLine is used after that the lines look pretty. Unfortunately in your case you had chosen the execution slots such that the SaveLine is called before averaging.
Code: Select all
Solver 3 !---- ResultOuputSolve, ResultOuputSolver
Exec Solver = after all
Procedure = "ResultOutputSolve" "ResultOutputSolver"
..
Solver 4
Exec Solver = After timestep
Procedure = "SaveData" "SaveLine"
...
Note that the keyword "Average Within Materials" is already used by some proper DG solvers to add glueing terms. This make the averaging implicit whereas the new use of the keyword is done after the elemental fields have been created.
I will commit this to "devel" within ~30 minutes after running the tests.
-Peter
Re: SaveLine with MagnetoDynamics2D axi-symmetric case
Thanks Peter. It is now very clear to me why I was getting a non interpolated line as output. This also explains why a similar approach in 3D was
working well.
Cheers,
Francisco
working well.
Cheers,
Francisco
Re: SaveLine with MagnetoDynamics2D axi-symmetric case (SOLVED)
Hello and thank you for these explanations. It helps me a lot and indeed, it works well.
Here to watch 3D Video Porn