@@ -566,7 +566,6 @@ def save_mesh(self, mesh, distribution_name=None, permutation_name=None):
566566 :kwarg distribution_name: the name under which distribution is saved; if `None`, auto-generated name will be used.
567567 :kwarg permutation_name: the name under which permutation is saved; if `None`, auto-generated name will be used.
568568 """
569- mesh .init ()
570569 # Handle extruded mesh
571570 tmesh = mesh .topology
572571 if mesh .extruded :
@@ -669,7 +668,6 @@ def save_mesh(self, mesh, distribution_name=None, permutation_name=None):
669668 @PETSc .Log .EventDecorator ("SaveMeshTopology" )
670669 def _save_mesh_topology (self , tmesh ):
671670 # -- Save DMPlex --
672- tmesh .init ()
673671 topology_dm = tmesh .topology_dm
674672 tmesh_name = topology_dm .getName ()
675673 distribution_name = tmesh ._distribution_name
@@ -1048,7 +1046,6 @@ def load_mesh(self, name=DEFAULT_MESH_NAME, reorder=None, distribution_parameter
10481046 # -- Load mesh topology --
10491047 base_tmesh_name = self .get_attr (path , PREFIX_EXTRUDED + "_base_mesh" )
10501048 base_tmesh = self ._load_mesh_topology (base_tmesh_name , reorder , distribution_parameters )
1051- base_tmesh .init ()
10521049 periodic = self .get_attr (path , PREFIX_EXTRUDED + "_periodic" ) if self .has_attr (path , PREFIX_EXTRUDED + "_periodic" ) else False
10531050 variable_layers = self .get_attr (path , PREFIX_EXTRUDED + "_variable_layers" )
10541051 if variable_layers :
@@ -1106,9 +1103,6 @@ def load_mesh(self, name=DEFAULT_MESH_NAME, reorder=None, distribution_parameter
11061103 # tmesh.topology_dm has already been redistributed.
11071104 path = self ._path_to_mesh (tmesh_name , name )
11081105 # Load firedrake coordinates directly.
1109- # When implementing checkpointing for MeshHierarchy in the future,
1110- # we will need to postpone calling tmesh.init().
1111- tmesh .init ()
11121106 coord_element = self ._load_ufl_element (path , PREFIX + "_coordinate_element" )
11131107 coord_name = self .get_attr (path , PREFIX + "_coordinates" )
11141108 coordinates = self ._load_function_topology (tmesh , coord_element , coord_name )
@@ -1194,7 +1188,13 @@ def _load_mesh_topology(self, tmesh_name, reorder, distribution_parameters):
11941188 plex .distributionSetName (distribution_name )
11951189 sfXB = plex .topologyLoad (self .viewer )
11961190 plex .distributionSetName (None )
1191+ plex .labelsLoad (self .viewer , sfXB )
11971192 self .viewer .popFormat ()
1193+ # These labels are distribution dependent.
1194+ # We should be able to save/load labels selectively.
1195+ plex .removeLabel ("pyop2_core" )
1196+ plex .removeLabel ("pyop2_owned" )
1197+ plex .removeLabel ("pyop2_ghost" )
11981198 if load_distribution_permutation :
11991199 chart_size = np .empty (1 , dtype = utils .IntType )
12001200 chart_sizes_iset = PETSc .IS ().createGeneral (chart_size , comm = self ._comm )
@@ -1220,21 +1220,10 @@ def _load_mesh_topology(self, tmesh_name, reorder, distribution_parameters):
12201220 distribution_parameters = distribution_parameters , sfXB = sfXB , perm_is = perm_is ,
12211221 distribution_name = distribution_name , permutation_name = permutation_name ,
12221222 comm = self .comm )
1223- self .viewer .pushFormat (format = format )
1224- # tmesh.topology_dm has already been redistributed.
1225- sfXCtemp = tmesh .sfXB .compose (tmesh .sfBC ) if tmesh .sfBC is not None else tmesh .sfXB
1226- plex .labelsLoad (self .viewer , sfXCtemp )
1227- self .viewer .popFormat ()
1228- # These labels are distribution dependent.
1229- # We should be able to save/load labels selectively.
1230- plex .removeLabel ("pyop2_core" )
1231- plex .removeLabel ("pyop2_owned" )
1232- plex .removeLabel ("pyop2_ghost" )
12331223 return tmesh
12341224
12351225 @PETSc .Log .EventDecorator ("LoadFunctionSpace" )
12361226 def _load_function_space (self , mesh , name ):
1237- mesh .init ()
12381227 mesh_key = self ._generate_mesh_key_from_names (mesh .name ,
12391228 mesh .topology ._distribution_name ,
12401229 mesh .topology ._permutation_name )
@@ -1271,7 +1260,6 @@ def _load_function_space(self, mesh, name):
12711260
12721261 @PETSc .Log .EventDecorator ("LoadFunctionSpaceTopology" )
12731262 def _load_function_space_topology (self , tmesh , element ):
1274- tmesh .init ()
12751263 if element .family () == "Real" :
12761264 return impl .RealFunctionSpace (tmesh , element , "unused_name" )
12771265 tmesh_key = self ._generate_mesh_key_from_names (tmesh .name ,
0 commit comments