topological point order in SaveLine output

Numerical methods and mathematical models of Elmer
Post Reply
RobertM
Posts: 7
Joined: 14 Jul 2015, 02:00
Antispam: Yes

topological point order in SaveLine output

Post by RobertM »

Hello all, and thank you for this powerful tool

I am using the following to output values along the indicated line:

Code: Select all

Solver 4
  Equation = "SaveLine"
  Procedure = "SaveData" "SaveLine"
  Exec Solver = After Timestep
  FileName = "line.data"
  File Append = Logical True
  Polyline Coordinates(2,2) = Real 145e-6 0.0 145e-6 18e-6
End
I expected the output to be ordered monotonically increasing along the line, but when I look at the output what I would consider the first and second data points are swapped:
1 1 157 1.45000000000E-004 1.95622148363E-006
1 1 3 1.45000000000E-004 0.00000000000E+000
1 1 158 1.45000000000E-004 3.73460465821E-006
1 1 159 1.45000000000E-004 5.35131663350E-006
1 1 160 1.45000000000E-004 6.82105479151E-006
Is this expected behaviour?
I can handle this when I unpack the data, but the output seemed odd and I was wondering if I was doing something wrong.

Thanks
Bob
raback
Site Admin
Posts: 4843
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: topological point order in SaveLine output

Post by raback »

Hi Bob

The algorithm goes through each face of 3D elements (edge in 2D) and detect intersections between face elements and mathematical lines. The values at the intersection is written directly to file without internal saving and sorting.

The chosen strategy is a little bit lazy but the good thing is that it scales linearly with mesh size. Personally I usually include a sort in the Matlab/Octave workflow immediately after loading the data in. Still I think you have a point: it would be more convenient to do the sorting in memory and write the data only after that. Not the 1st item on the list to fix this though...

-Peter
Post Reply