@@ -3017,10 +3017,13 @@ def curve_field(self, order, permutation_tol=1e-8, cg_field=None):
30173017 fiat_element = new_coordinates .function_space ().finat_element .fiat_equivalent
30183018 nodes = fiat_element .dual_basis ()
30193019 ref_pts = []
3020- for node in nodes :
3021- # Assert singleton point for each node.
3022- pt , = node .get_point_dict ().keys ()
3023- ref_pts .append (pt )
3020+ entity_ids = fiat_element .entity_dofs ()
3021+ for dim in sorted (entity_ids ):
3022+ for entity in sorted (entity_ids [dim ]):
3023+ for i in entity_ids [dim ][entity ]:
3024+ # Assert singleton point for each node.
3025+ pt , = nodes [i ].get_point_dict ().keys ()
3026+ ref_pts .append (pt )
30243027 reference_points = np .array (ref_pts )
30253028
30263029 # Construct numpy arrays for physical domain data
@@ -3030,8 +3033,8 @@ def curve_field(self, order, permutation_tol=1e-8, cg_field=None):
30303033 curved_points = np .zeros (
30313034 (ng_dimension , reference_points .shape [0 ], self .geometric_dimension )
30323035 )
3036+ self .netgen_mesh .Curve (1 )
30333037 self .netgen_mesh .CalcElementMapping (reference_points , physical_points )
3034- # NOTE: This will segfault for MeshHierarchy on a netgen CSG geometry
30353038 self .netgen_mesh .Curve (order )
30363039 self .netgen_mesh .CalcElementMapping (reference_points , curved_points )
30373040 curved = ng_element .NumPy ()["curved" ]
@@ -3056,7 +3059,6 @@ def curve_field(self, order, permutation_tol=1e-8, cg_field=None):
30563059 permutation = find_permutation (
30573060 own_physical_points ,
30583061 new_coordinates .dat .data_ro_with_halos [broken_indices ].real ,
3059- tol = permutation_tol ,
30603062 )
30613063 self .comm .Barrier ()
30623064 # Apply the permutation to each cell in turn
0 commit comments