@@ -120,6 +120,7 @@ MeshBase::MeshBase (const MeshBase & other_mesh) :
120120 _elem_default_orders (other_mesh ._elem_default_orders ),
121121 _supported_nodal_order (other_mesh ._supported_nodal_order ),
122122 _mesh_subdomains (other_mesh ._mesh_subdomains ),
123+ _mesh_local_subdomains (other_mesh ._mesh_local_subdomains ),
123124 _elemset_codes_inverse_map (other_mesh ._elemset_codes_inverse_map ),
124125 _all_elemset_ids (other_mesh ._all_elemset_ids ),
125126 _spatial_dimension (other_mesh ._spatial_dimension ),
@@ -209,6 +210,7 @@ MeshBase& MeshBase::operator= (MeshBase && other_mesh)
209210 _elem_default_orders = std ::move (other_mesh .elem_default_orders ());
210211 _supported_nodal_order = other_mesh .supported_nodal_order ();
211212 _mesh_subdomains = other_mesh ._mesh_subdomains ;
213+ _mesh_local_subdomains = other_mesh ._mesh_local_subdomains ;
212214 _elemset_codes = std ::move (other_mesh ._elemset_codes );
213215 _elemset_codes_inverse_map = std ::move (other_mesh ._elemset_codes_inverse_map );
214216 _all_elemset_ids = std ::move (other_mesh ._all_elemset_ids );
@@ -325,6 +327,8 @@ bool MeshBase::locally_equals (const MeshBase & other_mesh) const
325327 return false;
326328 if (_mesh_subdomains != other_mesh ._mesh_subdomains )
327329 return false;
330+ if (_mesh_local_subdomains != other_mesh ._mesh_local_subdomains )
331+ return false;
328332 if (_all_elemset_ids != other_mesh ._all_elemset_ids )
329333 return false;
330334 if (_elem_integer_names != other_mesh ._elem_integer_names )
@@ -1112,6 +1116,16 @@ void MeshBase::redistribute()
11121116
11131117
11141118
1119+ void MeshBase ::update_post_partitioning ()
1120+ {
1121+ _mesh_local_subdomains .clear ();
1122+
1123+ for (const Elem * elem : this -> active_local_element_ptr_range ())
1124+ _mesh_local_subdomains .insert (elem -> subdomain_id ());
1125+ }
1126+
1127+
1128+
11151129subdomain_id_type MeshBase ::n_subdomains () const
11161130{
11171131 // This requires an inspection on every processor
@@ -1860,13 +1874,16 @@ void MeshBase::cache_elem_data()
18601874 _elem_dims .clear ();
18611875 _elem_default_orders .clear ();
18621876 _mesh_subdomains .clear ();
1877+ _mesh_local_subdomains .clear ();
18631878 _supported_nodal_order = MAXIMUM ;
18641879
18651880 for (const auto & elem : this -> active_element_ptr_range ())
18661881 {
18671882 _elem_dims .insert (cast_int < unsigned char > (elem -> dim ()));
18681883 _elem_default_orders .insert (elem -> default_order ());
18691884 _mesh_subdomains .insert (elem -> subdomain_id ());
1885+ if (elem -> processor_id () == this -> processor_id ())
1886+ _mesh_local_subdomains .insert (elem -> subdomain_id ());
18701887 _supported_nodal_order =
18711888 static_cast < Order >
18721889 (std ::min (static_cast < int > (_supported_nodal_order ),
@@ -2220,6 +2237,7 @@ MeshBase::copy_cached_data(const MeshBase & other_mesh)
22202237 this -> _elem_default_orders = other_mesh ._elem_default_orders ;
22212238 this -> _supported_nodal_order = other_mesh ._supported_nodal_order ;
22222239 this -> _mesh_subdomains = other_mesh ._mesh_subdomains ;
2240+ this -> _mesh_local_subdomains = other_mesh ._mesh_local_subdomains ;
22232241}
22242242
22252243
@@ -2474,6 +2492,7 @@ MeshBase::copy_constraint_rows(const SparseMatrix<T> & constraint_operator,
24742492 (std ::min (static_cast < int > (this -> _supported_nodal_order ),
24752493 static_cast < int > (added_elem -> supported_nodal_order ())));
24762494 this -> _mesh_subdomains .insert (new_sbd_id );
2495+ this -> _mesh_local_subdomains .insert (new_sbd_id );
24772496 node_to_elem_ptrs .emplace (n , std ::make_pair (added_elem -> id (), 0 ));
24782497 existing_unconstrained_columns .emplace (j ,n -> id ());
24792498
0 commit comments