|
libMesh
|
Temporarily serialize a DistributedMesh for non-distributed-mesh capable code paths. More...
#include <mesh_serializer.h>
Public Member Functions | |
| MeshSerializer (MeshBase &mesh, bool need_serial=true, bool serial_only_needed_on_proc_0=false) | |
| ~MeshSerializer () | |
Private Attributes | |
| MeshBase & | _mesh |
| bool | reparallelize |
| bool | resume_allow_remote_element_removal |
Temporarily serialize a DistributedMesh for non-distributed-mesh capable code paths.
A distributed mesh is allgathered by the MeshSerializer constructor if need_serial is true, in which case remote elements are deleted again by the destructor.
Serialization to processor 0 alone (e.g. for serial output from that processor) can be selected in the constructor.
If allow_remote_element_removal() is set to true, that will also be temporarily disabled by the serializer, to be reenabled after serializer destruction if so; this allows prepare_for_use() to be called safely from within serialized code.
If a mesh is explicitly distributed by a delete_remote_elements() call within serialized code, or if allow_remote_element_removal() is explicitly set to true within serialized code, the behavior is undefined.
Definition at line 55 of file mesh_serializer.h.
| libMesh::MeshSerializer::MeshSerializer | ( | MeshBase & | mesh, |
| bool | need_serial = true, |
||
| bool | serial_only_needed_on_proc_0 = false |
||
| ) |
Definition at line 27 of file mesh_serializer.C.
References _mesh, libMesh::MeshBase::allgather(), libMesh::MeshBase::allow_remote_element_removal(), libMesh::MeshBase::gather_to_zero(), libMesh::MeshBase::is_serial(), mesh, reparallelize, and resume_allow_remote_element_removal.
| libMesh::MeshSerializer::~MeshSerializer | ( | ) |
Definition at line 52 of file mesh_serializer.C.
References _mesh, libMesh::MeshBase::allow_remote_element_removal(), libMesh::MeshBase::delete_remote_elements(), reparallelize, and resume_allow_remote_element_removal.
|
private |
Definition at line 67 of file mesh_serializer.h.
Referenced by MeshSerializer(), and ~MeshSerializer().
|
private |
Definition at line 73 of file mesh_serializer.h.
Referenced by MeshSerializer(), and ~MeshSerializer().
|
private |
Definition at line 80 of file mesh_serializer.h.
Referenced by MeshSerializer(), and ~MeshSerializer().
1.8.14