Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/mesh/unstructured_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ class UnstructuredMesh : public MeshBase
const bool skip_find_neighbors = false,
dof_id_type element_id_offset = 0,
dof_id_type node_id_offset = 0,
unique_id_type unique_id_offset = 0);
unique_id_type unique_id_offset = 0,
const bool skip_prepare = false);


/**
Expand Down
3 changes: 2 additions & 1 deletion src/mesh/mesh_base.C
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ void MeshBase::prepare_for_use (const bool skip_renumber_nodes_and_elements, con
}

// Partition the mesh.
this->partition();
if (!_skip_partitioning)
this->partition();

// If we're using DistributedMesh, we'll probably want it
// parallelized.
Expand Down
18 changes: 16 additions & 2 deletions src/mesh/replicated_mesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ void ReplicatedMesh::stitching_helper (const ReplicatedMesh * other_mesh,
// of neighbors will be copied verbatim from the other mesh
this->copy_nodes_and_elements(*other_mesh, skip_find_neighbors,
elem_delta, node_delta,
unique_delta);
unique_delta, /* skip_prepare= */ true);

// Copy BoundaryInfo from other_mesh too. We do this via the
// list APIs rather than element-by-element for speed.
Expand Down Expand Up @@ -1330,7 +1330,21 @@ void ReplicatedMesh::stitching_helper (const ReplicatedMesh * other_mesh,
}
}

this->prepare_for_use( /*skip_renumber_nodes_and_elements= */ false, skip_find_neighbors);
{
auto prev_allow_renumbering = this->allow_renumbering();
auto prev_allow_remote_element_removal = allow_remote_element_removal();
auto prev_skip_partitioning = skip_partitioning();

this->allow_renumbering(false);
this->allow_remote_element_removal(false);
this->skip_partitioning(true);

this->prepare_for_use(false, skip_find_neighbors);

this->allow_renumbering(prev_allow_renumbering);
this->allow_remote_element_removal(prev_allow_remote_element_removal);
this->skip_partitioning(prev_skip_partitioning);
}

// After the stitching, we may want to clear boundary IDs from element
// faces that are now internal to the mesh
Expand Down
28 changes: 16 additions & 12 deletions src/mesh/unstructured_mesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ void UnstructuredMesh::copy_nodes_and_elements(const UnstructuredMesh & other_me
#ifdef LIBMESH_ENABLE_UNIQUE_ID
unique_id_offset
#endif
)
,
const bool skip_prepare)
{
LOG_SCOPE("copy_nodes_and_elements()", "UnstructuredMesh");

Expand Down Expand Up @@ -209,19 +210,22 @@ void UnstructuredMesh::copy_nodes_and_elements(const UnstructuredMesh & other_me
}
}

//Finally prepare the new Mesh for use. Keep the same numbering and
//partitioning for now.
this->allow_renumbering(false);
this->allow_remote_element_removal(false);
this->skip_partitioning(true);
if (!skip_prepare)
{
//Finally prepare the new Mesh for use. Keep the same numbering and
//partitioning for now.
this->allow_renumbering(false);
this->allow_remote_element_removal(false);
this->skip_partitioning(true);

this->prepare_for_use(false, skip_find_neighbors);
this->prepare_for_use(false, skip_find_neighbors);

//But in the long term, use the same renumbering and partitioning
//policies as our source mesh.
this->allow_renumbering(other_mesh.allow_renumbering());
this->allow_remote_element_removal(other_mesh.allow_remote_element_removal());
this->skip_partitioning(other_mesh.skip_partitioning());
//But in the long term, use the same renumbering and partitioning
//policies as our source mesh.
this->allow_renumbering(other_mesh.allow_renumbering());
this->allow_remote_element_removal(other_mesh.allow_remote_element_removal());
this->skip_partitioning(other_mesh.skip_partitioning());
}
}


Expand Down