Hex Ordering Mesher / OpenCARP
Summary
Hexahedral elements are written out different by mesher than they are assumed by openCARP.
What version of openCARP are you using?
current master
What operating system and processor architecture are you using?
Ubuntu Linux 18.04 LTS / AMD Ryzen
Steps to reproduce
First run
mesher -center[0] 0.0 -center[1] 0.0 -center[2] 0.0 -resolution[0] 10000.0 -resolution[1] 10000.0 -resolution[2] 10000.0 -Elem3D 1
then compare the *.elem and *.pts with the ones stored in fem/ref_elems.
What is the current bug behavior?
eval_shp assumes the nodes to be ordered like in fem/ref_elems but they are actually differently ordered. Shape functions for hexahedral elements need to be correctly assigned to their nodes so that the corresponding shapefunction is 1 at this node and 0 at the other. Any messing with the prescribed ordering leads to negative jacobian determinants and undefined behavior in the assembly of matrices.
What is the expected correct behavior?
running mesher like above should produce the same file for hex as in fem/ref_elems
Relevant logs and/or screenshots
output from mesher:
mesh.pts (scaled to [-1,1]^3 )
8
-1.0 -1.0 -1.0
1.0 -1.0 -1.0
-1.0 1.0 -1.0
1.0 1.0 -1.0
-1.0 -1.0 1.0
1.0 -1.0 1.0
-1.0 1.0 1.0
1.0 1.0 1.0
mesh.elem
1
Hx 3 2 0 1 7 5 4 6 1
ref_hex_elem.pts
8
-1.0 -1.0 -1.0
1.0 -1.0 -1.0
1.0 1.0 -1.0
-1.0 1.0 -1.0
-1.0 -1.0 1.0
1.0 -1.0 1.0
1.0 1.0 1.0
-1.0 1.0 1.0
ref_hex_elem.elem
1
Hx 4 7 6 5 0 1 2 3 -1
Possible fixes
The ordering from mesher is defined in mesher.cc:1047 but I don't understand the above code to generate the points (mesher.cc:1005-1012).