@@ -89,28 +89,28 @@ def test_mesh_read_writer(backend, encoder, suffix, ghost_mode, tmp_path, store_
8989 backend_args = None
9090 if backend == "adios2" :
9191 backend_args = {"engine" : encoder }
92-
9392 write_mesh (
9493 file .with_suffix (suffix ),
9594 mesh ,
9695 store_partition_info = store_partition ,
9796 backend_args = backend_args ,
9897 backend = backend ,
9998 )
99+
100100 mesh .comm .Barrier ()
101101 with dolfinx .io .XDMFFile (mesh .comm , xdmf_file .with_suffix (".xdmf" ), "w" ) as xdmf :
102102 xdmf .write_mesh (mesh )
103103 mesh .comm .Barrier ()
104104
105- mesh_adios = read_mesh (
105+ in_mesh = read_mesh (
106106 file .with_suffix (suffix ),
107107 MPI .COMM_WORLD ,
108108 ghost_mode = ghost_mode ,
109109 read_from_partition = store_partition ,
110110 backend_args = backend_args ,
111111 backend = backend ,
112112 )
113- mesh_adios .comm .Barrier ()
113+ in_mesh .comm .Barrier ()
114114 if store_partition :
115115
116116 def compute_distance_matrix (points_A , points_B , tol = 1e-12 ):
@@ -120,7 +120,7 @@ def compute_distance_matrix(points_A, points_B, tol=1e-12):
120120 return distances < tol
121121
122122 cell_map = mesh .topology .index_map (mesh .topology .dim )
123- new_cell_map = mesh_adios .topology .index_map (mesh_adios .topology .dim )
123+ new_cell_map = in_mesh .topology .index_map (in_mesh .topology .dim )
124124 assert cell_map .size_local == new_cell_map .size_local
125125 assert cell_map .num_ghosts == new_cell_map .num_ghosts
126126 mesh .topology .create_connectivity (mesh .topology .dim , mesh .topology .dim )
@@ -129,10 +129,10 @@ def compute_distance_matrix(points_A, points_B, tol=1e-12):
129129 mesh .topology .dim ,
130130 np .arange (cell_map .size_local + cell_map .num_ghosts , dtype = np .int32 ),
131131 )
132- mesh_adios .topology .create_connectivity (mesh_adios .topology .dim , mesh_adios .topology .dim )
132+ in_mesh .topology .create_connectivity (in_mesh .topology .dim , in_mesh .topology .dim )
133133 new_midpoints = dolfinx .mesh .compute_midpoints (
134- mesh_adios ,
135- mesh_adios .topology .dim ,
134+ in_mesh ,
135+ in_mesh .topology .dim ,
136136 np .arange (new_cell_map .size_local + new_cell_map .num_ghosts , dtype = np .int32 ),
137137 )
138138 # Check that all points in owned by initial mesh is owned by the new mesh
@@ -156,27 +156,26 @@ def compute_distance_matrix(points_A, points_B, tol=1e-12):
156156 for i in range (mesh .topology .dim + 1 ):
157157 mesh .topology .create_entities (i )
158158 mesh_xdmf .topology .create_entities (i )
159- mesh_adios .topology .create_entities (i )
159+ in_mesh .topology .create_entities (i )
160160 assert (
161- mesh_xdmf .topology .index_map (i ).size_global
162- == mesh_adios .topology .index_map (i ).size_global
161+ mesh_xdmf .topology .index_map (i ).size_global == in_mesh .topology .index_map (i ).size_global
163162 )
164163
165164 # Check that integration over different entities are consistent
166165 measures = (
167166 [ufl .ds , ufl .dx ] if ghost_mode is dolfinx .mesh .GhostMode .none else [ufl .ds , ufl .dS , ufl .dx ]
168167 )
169168 for measure in measures :
170- print ( mesh_adios , mesh_adios . ufl_domain (). ufl_coordinate_element ( ))
171- c_adios = dolfinx .fem .assemble_scalar (dolfinx . fem . form ( 1 * measure ( domain = mesh_adios )) )
169+ form = dolfinx . fem . form ( 1 * measure ( domain = in_mesh ))
170+ c_adios = dolfinx .fem .assemble_scalar (form )
172171 c_ref = dolfinx .fem .assemble_scalar (dolfinx .fem .form (1 * measure (domain = mesh )))
173172 c_xdmf = dolfinx .fem .assemble_scalar (dolfinx .fem .form (1 * measure (domain = mesh_xdmf )))
174173 assert np .isclose (
175- mesh_adios .comm .allreduce (c_adios , MPI .SUM ),
174+ in_mesh .comm .allreduce (c_adios , MPI .SUM ),
176175 mesh .comm .allreduce (c_xdmf , MPI .SUM ),
177176 )
178177 assert np .isclose (
179- mesh_adios .comm .allreduce (c_adios , MPI .SUM ),
178+ in_mesh .comm .allreduce (c_adios , MPI .SUM ),
180179 mesh .comm .allreduce (c_ref , MPI .SUM ),
181180 )
182181
0 commit comments