MoReFEM
|
Class responsible for a mesh and its content. More...
#include <Mesh.hpp>
Public Types | |
using | underlying_type |
Type used for the unique id. | |
Public Member Functions | |
std::size_t | GetDimension () const noexcept |
Get the dimension. | |
template<RoleOnProcessor RoleOnProcessorT> | |
GeometricElt::vector_shared_ptr | GeometricEltListInLabel (const MeshLabel::const_shared_ptr &label) const |
template<RoleOnProcessor RoleOnProcessorT> | |
void | PrintGeometricEltsInLabel (std::ostream &stream) const |
std::size_t | NprocessorWiseCoord () const noexcept |
Number of processor-wise Coords. | |
std::size_t | NghostCoord () const noexcept |
Number of Coords that are exclusively associated to ghost NodeBearer. | |
template<RoleOnProcessorPlusBoth RoleOnProcessorPlusBothT> | |
RefGeomElt::vector_shared_ptr | BagOfEltType () const |
A vector that contains a pointer to a default geometric element for each type encountered in the mesh. | |
template<RoleOnProcessorPlusBoth RoleOnProcessorPlusBothT> | |
RefGeomElt::vector_shared_ptr | BagOfEltType (std::size_t dimension) const |
Same as namesake methods except we limit ourselves to a given dimension. | |
template<RoleOnProcessor RoleOnProcessorT> | |
subset_range | GetSubsetGeometricEltList (const RefGeomElt &geometric_type) const |
Obtains all the geometric elements of a given type. | |
template<RoleOnProcessor RoleOnProcessorT> | |
subset_range | GetSubsetGeometricEltList (const RefGeomElt &geometric_type, std::size_t label_index) const |
Obtains all the geometric elements of a given type belonging to a given label. | |
template<RoleOnProcessor RoleOnProcessorT> | |
subset_range | GetSubsetGeometricEltList (std::size_t dimension) const |
Return the list of geometric elements of the requested dimension. | |
void | CheckGeometricEltOrdering () const |
Check the underlying ordering is what is expected within Mesh. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | Nvertex () const |
std::size_t | NprogramWiseVertex () const noexcept |
Get the number of program-wise vertex. | |
template<RoleOnProcessor RoleOnProcessorT> | |
const GeometricElt & | GetGeometricEltFromIndex (::MoReFEM::GeomEltNS::index_type index) const |
Return the GeometricElt which index (given by GetIndex()) is index. | |
template<RoleOnProcessor RoleOnProcessorT> | |
const GeometricElt & | GetGeometricEltFromIndex (::MoReFEM::GeomEltNS::index_type index, const RefGeomElt &ref_geom_elt) const |
Return the GeometricElt which index (given by GetIndex()) is index and which type is a ref_geom_elt. | |
MeshNS::Format | GetInitialFormat () const noexcept |
Returns the format in which the mesh was originally read. May be 'None' if undisclosed. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | NgeometricElt () const |
Number of geometric elements. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | NgeometricElt (std::size_t dimension) const |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | NgeometricElt (const RefGeomElt &ref_geom_elt) const |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | NgeometricElt (const RefGeomElt &ref_geom_elt, const MeshLabel &mesh_label) const |
const Coords & | GetCoord (std::size_t index) const |
template<RoleOnProcessor RoleOnProcessorT> | |
const GeometricElt::vector_shared_ptr & | GetGeometricEltList () const noexcept |
Return the list of processor-wise geometric elements. | |
const Coords::vector_shared_ptr & | GetProcessorWiseCoordsList () const noexcept |
Get the list of all Coords on the processor. | |
const Coords::vector_shared_ptr & | GetGhostCoordsList () const noexcept |
Get the list of the ghost Coords. | |
Coords::vector_shared_ptr & | GetNonCstGhostCoordsList () noexcept |
Get the list of the ghost Coords. | |
const MeshLabel::vector_const_shared_ptr & | GetLabelList () const noexcept |
Get the list of labels. | |
double | GetSpaceUnit () const noexcept |
Get the space unit. | |
template<::MoReFEM::MeshNS::Format FormatT> | |
void | Write (const FilesystemNS::File &mesh_file) const |
Write the mesh into a file in the given format. | |
MeshNS::unique_id | GetUniqueId () const |
Get the value of the internal unique ID. | |
Edge-related methods. | |
bool | AreEdgesBuilt () const |
Tells whether the edges have been built. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | Nedge () const |
Get the number of edges. The edges must have been built prior to the call. | |
Face-related methods. | |
bool | AreFacesBuilt () const |
Tells whether the faces have been built. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | Nface () const |
Get the number of faces. The faces must have been built prior to the call. | |
Volume-related methods. | |
bool | AreVolumesBuilt () const |
Tells whether the volumes have been built. | |
template<RoleOnProcessor RoleOnProcessorT> | |
std::size_t | Nvolume () const |
Get the number of volumes. The volumes must have been built prior to the call. | |
Static Public Member Functions | |
static MeshNS::unique_id | GenerateNewEligibleId () |
Generate a unique id. | |
static void | ClearUniqueIdList () |
Clear all unique ids. | |
Private Member Functions | |
void | ComputePseudoNormals (const std::vector< std::size_t > &label_index_list, const Vertex::InterfaceMap &vertex_interface_list, const Edge::InterfaceMap &edge_interface_list, const Face::InterfaceMap &face_interface_list) |
Compute the relevant pseudo-normals on the mesh. | |
void | ShrinkToProcessorWise (const Wrappers::Mpi &mpi, const GeometricElt::vector_shared_ptr &processor_wise_geom_elt_list, const GeometricElt::vector_shared_ptr &ghost_geom_elt_list, Coords::vector_shared_ptr &&processor_wise_coords_list, Coords::vector_shared_ptr &&ghost_coords_list) |
Init a local mesh from a global one. | |
void | SetReducedCoordsList (const Wrappers::Mpi &mpi, Coords::vector_shared_ptr &&processor_wise_coords_list, Coords::vector_shared_ptr &&ghost_coords_list) |
Set the new coords after reduction to processor-wise. | |
void | SetIsLowestProcessor (const Wrappers::Mpi &mpi, std::size_t Nprogram_wise_coords, const Coords::vector_shared_ptr &a_processor_wise_coords_list) const |
For all processor-wise Coords, determine which is the lowest rank in which they appear (not counting ghosts). | |
void | Construct (GeometricElt::vector_shared_ptr &&unsort_processor_wise_geom_elt_list, GeometricElt::vector_shared_ptr &&unsort_ghost_geom_elt_list, Coords::vector_shared_ptr &&coords_list, MeshLabel::vector_const_shared_ptr &&mesh_label_list, BuildEdge do_build_edge, BuildFace do_build_face, BuildVolume do_build_volume, BuildPseudoNormals do_build_pseudo_normals) |
Constructor helper method. | |
void | Read (const FilesystemNS::File &mesh_file, ::MoReFEM::MeshNS::Format format, const double space_unit, std::optional< std::reference_wrapper< Wrappers::Lua::OptionFile > > prepartitioned_data, GeometricElt::vector_shared_ptr &unsort_processor_wise_geom_elt_list, GeometricElt::vector_shared_ptr &unsort_ghost_geom_elt_list, Coords::vector_shared_ptr &coords_list, MeshLabel::vector_const_shared_ptr &mesh_label_list) |
Read a mesh from a file. | |
template<> | |
std::array< std::size_t, 2ul > | DetermineNInterface () const |
Specialization for Volume. | |
Static Private Member Functions | |
static MeshNS::unique_id | AssignUniqueId () |
If AssignationMode is automatic, generates a new unique identifier. | |
static MeshNS::unique_id | NewUniqueId (MeshNS::unique_id new_unique_id) |
If AssignationMode is manual, checks the unique identifier provided is valid. | |
static std::set< MeshNS::unique_id > & | StaticUniqueIdList () |
List of all identifiers existing for DerivedT. | |
Private Attributes | |
const MeshNS::unique_id | unique_id_ |
The value of the unique id for the current DerivedT object. | |
Convenient enum classes. | |
Their purpose is to make Init() reading more palatable: Mesh mesh;
mesh.Init(mesh_file, format, BuildEdge::yes, BuildFace::no);
instead of: Mesh mesh;
mesh.Init(mesh_file, format, true, false);
As a bonus, there is a type checking involved that prevent messing up the order. | |
enum class | BuildEdge { no , yes } |
Enum used to index the available meshes. More... | |
enum class | BuildFace { no , yes } |
Enum used to index the available meshes. More... | |
enum class | BuildVolume { no , yes } |
Enum used to index the available meshes. More... | |
enum class | BuildPseudoNormals { no , yes } |
Enum used to index the available meshes. More... | |
using | self = Mesh |
Alias to the type of the class. | |
using | const_unique_ptr = std::unique_ptr<const self> |
Alias to unique_ptr. | |
using | unique_id_parent = Crtp::UniqueId<self, MeshNS::unique_id, UniqueIdNS::AssignationMode::manual> |
Convenient alias to parent. | |
using | vector_const_unique_ptr = std::vector<const_unique_ptr> |
Alias to vector of unique_ptr. | |
using | iterator_geometric_element = Internal::MeshNS::iterator_geometric_element |
Convenient alias. | |
using | subset_range = Internal::MeshNS::subset_range |
Alias for subset. | |
static const std::string & | ClassName () |
Returns the name of the class. | |
Helper methods for edges and faces. | |
Coords::vector_shared_ptr | processor_wise_coords_list_ |
Coords::vector_shared_ptr | ghost_coords_list_ |
List of ghost Coords. | |
Internal::MeshNS::GeometricEltList | processor_wise_geometric_elt_list_ |
List of all the geometric elements of the mesh, sort by dimension. | |
Internal::MeshNS::GeometricEltList | ghost_geometric_elt_list_ |
List of all ghost GeometricElt. | |
const std::size_t | dimension_ |
Dimension of the mesh. | |
MeshLabel::vector_const_shared_ptr | label_list_ |
All processor-wise labels. | |
std::array< std::size_t, 2ul > | Nvertex_on_rank_ = Utilities::FilledWithUninitializedIndex<std::size_t, 2ul>() |
Number of built vertex (processor-wise). | |
std::size_t | Nprogram_wise_vertex_ = NumericNS::UninitializedIndex<std::size_t>() |
Number of built vertex (program-wise). | |
std::array< std::size_t, 2ul > | Nedge_ = Utilities::FilledWithUninitializedIndex<std::size_t, 2ul>() |
Number of built edges that are related to a NodeBearer. | |
std::array< std::size_t, 2ul > | Nface_ = Utilities::FilledWithUninitializedIndex<std::size_t, 2ul>() |
Number of built faces. | |
std::array< std::size_t, 2ul > | Nvolume_ = Utilities::FilledWithUninitializedIndex<std::size_t, 2ul>() |
Number of built volumes. | |
const double | space_unit_ |
Space unit of the mesh. | |
MeshNS::Format | initial_format_ = MeshNS::Format::None |
Format in which the mesh was first read. May be 'None' if undisclosed or not kept. | |
template<class InterfaceT > | |
void | BuildInterface (typename InterfaceT::InterfaceMap &interface_list) |
Actual implementation of BuildEdgeList or BuildFaceList. | |
template<class InterfaceT , RoleOnProcessor RoleOnProcessorT> | |
void | BuildInterfaceHelper (typename InterfaceT::InterfaceMap &interface_list) |
Helper of BuildInterface. | |
template<class InterfaceT > | |
void | SetNinterface (std::size_t Nprocessor_wise, std::size_t Nghost) |
Set the number of interfaces of InterfaceT type. | |
template<class InterfaceT > | |
std::array< std::size_t, 2ul > | DetermineNInterface () const |
Determine the number of interfaces of InterfaceT type. | |
void | ReduceLabelList () |
Reconstruct the labels after reduction to processor-wise data. | |
Coords::vector_shared_ptr & | GetNonCstProcessorWiseCoordsList () noexcept |
Non constant access to the list of all Coords on the processor. | |
void | SetProcessorWiseCoordsList (Coords::vector_shared_ptr &&list) |
void | SetGhostCoordsList (Coords::vector_shared_ptr &&list) |
MeshLabel::vector_const_shared_ptr & | GetNonCstLabelList () noexcept |
Non constant access to the list of labels. | |
void | SortPrepartitionedCoords (std::size_t Nprocessor_wise) |
For constructor for prepartitioned data: split the processor_wise_coords_list_ in processor-wise and ghost Coords. | |
template<RoleOnProcessor RoleOnProcessorT> | |
const Internal::MeshNS::GeometricEltList & | GetInternalGeomEltList () const noexcept |
Internal method that dispatch the correct GeometricElt list depending on RoleOnProcessorT value. | |
GeometricElt::vector_shared_ptr | ComputeProcessorWiseAndGhostGeometricEltList () const noexcept |
Compute a list of GeometricElt which covers both the processor-wise and ghost. | |
Special members. | |
Mesh (MeshNS::unique_id mesh_id, const FilesystemNS::File &mesh_file, std::size_t dimension, MeshNS::Format format, const double space_unit, std::optional< std::reference_wrapper< Wrappers::Lua::OptionFile > > prepartitioned_data=std::nullopt, BuildEdge do_build_edge=BuildEdge::no, BuildFace do_build_face=BuildFace::no, BuildVolume do_build_volume=BuildVolume::no, BuildPseudoNormals do_build_pseudo_normals=BuildPseudoNormals::no) | |
Constructor from a file. | |
Mesh (MeshNS::unique_id mesh_id, std::size_t dimension, double space_unit, GeometricElt::vector_shared_ptr &&unsort_processor_wise_geom_elt_list, GeometricElt::vector_shared_ptr &&unsort_ghost_geom_elt_list, Coords::vector_shared_ptr &&coords_list, MeshLabel::vector_const_shared_ptr &&mesh_label_list, BuildEdge do_build_edge=BuildEdge::no, BuildFace do_build_face=BuildFace::no, BuildVolume do_build_volume=BuildVolume::no, BuildPseudoNormals do_build_pseudo_normals=BuildPseudoNormals::no) | |
Construct a Mesh given the list of Coords, GeometricElt and MeshLabel. | |
Mesh (const Wrappers::Mpi &mpi, MeshNS::unique_id mesh_id, const FilesystemNS::File &mesh_file, Wrappers::Lua::OptionFile &prepartitioned_data, std::size_t dimension, MeshNS::Format format, const double space_unit, BuildEdge do_build_edge=BuildEdge::no, BuildFace do_build_face=BuildFace::no, BuildVolume do_build_volume=BuildVolume::no, BuildPseudoNormals do_build_pseudo_normals=BuildPseudoNormals::no) | |
Constructor from pre-partitioned data. | |
~Mesh () | |
Destructor. | |
Mesh (const Mesh &rhs)=delete | |
The copy constructor. - disabled. | |
Mesh (Mesh &&rhs)=delete | |
The move constructor. | |
Mesh & | operator= (const Mesh &rhs)=delete |
The (copy) operator=. | |
Mesh & | operator= (Mesh &&rhs)=delete |
The (move) operator=. | |
Class responsible for a mesh and its content.
Objects of this class can only be created through the MeshManager.
using MoReFEM::Mesh::self = Mesh |
Alias to the type of the class.
|
strong |
Enum used to index the available meshes.
|
strong |
Enum used to index the available meshes.
|
strong |
Enum used to index the available meshes.
|
strong |
Enum used to index the available meshes.
|
explicitprivate |
Constructor from a file.
The constructor is private on purpose: Mesh objects are intended to be created through MeshManager singleton class, which performs additional bookkeeping on them.
[in] | mesh_id | Unique identifier of the Mesh. |
[in] | dimension | Dimension of the mesh. |
[in] | space_unit | The unit of the mesh, in meters. |
[in] | do_build_edge | Whether edges should be built or not. |
[in] | do_build_face | Whether faces should be built or not. |
[in] | do_build_volume | Whether volumes should be built or not. |
[in] | do_build_pseudo_normals | Whether pseudo-normals should be built or not. |
[in] | mesh_file | File from which the data will be loaded. |
[in] | format | Format of the input file. |
|
explicitprivate |
Construct a Mesh given the list of Coords, GeometricElt and MeshLabel.
The constructor is private on purpose: Mesh objects are intended to be created through MeshManager singleton class, which performs additional bookkeeping on them.
[in] | mesh_id | Unique identifier of the Mesh. |
[in] | dimension | Dimension of the mesh. |
[in] | space_unit | The unit of the mesh, in meters. |
[in] | do_build_edge | Whether edges should be built or not. |
[in] | do_build_face | Whether faces should be built or not. |
[in] | do_build_volume | Whether volumes should be built or not. |
[in] | do_build_pseudo_normals | Whether pseudo-normals should be built or not. |
[in,out] | unsort_processor_wise_geom_elt_list | List of processor-wiseGeometricElt. No specific order is expected here. |
[in,out] | unsort_ghost_geom_elt_list | List of ghostGeometricElt. No specific order is expected here. |
[in] | coords_list | List of Coords objects. |
[in] | mesh_label_list | List of MeshLabels. |
|
explicitprivate |
Constructor from pre-partitioned data.
[in] | mpi | Mpi object which knows the rank of the processor, the total number of processors, etc... |
[in] | mesh_file | File from which the data will be loaded. |
[in] | format | Format of the input file. |
[in] | mesh_id | Unique identifier of the Mesh to be created. |
[in] | prepartitioned_data | Lua file which gives the data needed to reconstruct the data from pre-computed partitioned data. Note: it is not const as such objects relies on a Lua stack which is modified for virtually each operation. |
[in,out] | dimension | Dimension of the mesh read in the input file. |
[in] | do_build_edge | Whether edges should be built or not. |
[in] | do_build_face | Whether faces should be built or not. |
[in] | do_build_volume | Whether volumes should be built or not. |
[in] | do_build_pseudo_normals | Whether pseudo-normals should be built or not. |
[in] | space_unit | The unit of the mesh, in meters. |
|
delete |
The copy constructor. - disabled.
[in] | rhs | The object from which the construction occurs. - disabled. |
|
delete |
The move constructor.
[in] | rhs | The object from which the construction occurs. |
The (copy) operator=.
[in] | rhs | The object from which the affectation occurs. |
The (move) operator=.
[in] | rhs | The object from which the affectation occurs. |
GeometricElt::vector_shared_ptr MoReFEM::Mesh::GeometricEltListInLabel | ( | const MeshLabel::const_shared_ptr & | label | ) | const |
List of all geometric elements that belong to the same label.
[in] | label | MeshLabel used as filter. |
void MoReFEM::Mesh::PrintGeometricEltsInLabel | ( | std::ostream & | stream | ) | const |
Print the number of geometric elements for each label (for debug purposes).
[in,out] | stream | Stream upon which object information are written. |
|
noexcept |
Number of Coords that are exclusively associated to ghost NodeBearer.
Should not be useful to develop a model; it's there for two usages only:
RefGeomElt::vector_shared_ptr MoReFEM::Mesh::BagOfEltType | ( | ) | const |
A vector that contains a pointer to a default geometric element for each type encountered in the mesh.
For instance the vector would return a pointer to default Triangle3 and Tetraedre4 geometric elements if the mesh is constituted solely of these two types of elements.
RoleOnProcessorPlusBothT | Whether we consider processor-wise or ghost. If both, encompass both cases. |
RefGeomElt::vector_shared_ptr MoReFEM::Mesh::BagOfEltType | ( | std::size_t | dimension | ) | const |
Same as namesake methods except we limit ourselves to a given dimension.
[in] | dimension | Only objects of this dimension will be considered. |
RoleOnProcessorPlusBothT | Whether we consider processor-wise or ghost. If both, encompass both cases. |
subset_range MoReFEM::Mesh::GetSubsetGeometricEltList | ( | const RefGeomElt & | geometric_type | ) | const |
Obtains all the geometric elements of a given type.
[in] | geometric_type | Type of the geometric element requested. |
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
[internal]
The internal structure of the geometric elements storage shouldn't vary much (if at all...) during the program, so you can be fairly assured the iterators won't be invalidated. Nonetheless, do not store them for instance in the class: generate them when they are required.
subset_range MoReFEM::Mesh::GetSubsetGeometricEltList | ( | const RefGeomElt & | geometric_type, |
std::size_t | label_index ) const |
Obtains all the geometric elements of a given type belonging to a given label.
[in] | geometric_type | Type of the geometric element requested. |
[in] | label_index | Index of the label considered |
See namesake method to see how it should be used.
subset_range MoReFEM::Mesh::GetSubsetGeometricEltList | ( | std::size_t | dimension | ) | const |
Return the list of geometric elements of the requested dimension.
This method does not allocate new dynamic array.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
[in] | dimension | Dimension used as filter. |
void MoReFEM::Mesh::CheckGeometricEltOrdering | ( | ) | const |
Check the underlying ordering is what is expected within Mesh.
This is obviously a debug method...
std::size_t MoReFEM::Mesh::Nvertex | ( | ) | const |
Get the number of processor-wise vertex.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
const GeometricElt & MoReFEM::Mesh::GetGeometricEltFromIndex | ( | ::MoReFEM::GeomEltNS::index_type | index | ) | const |
Return the GeometricElt which index (given by GetIndex()) is index.
[in] | index | Index which associated GeometricElt is sought. |
const GeometricElt & MoReFEM::Mesh::GetGeometricEltFromIndex | ( | ::MoReFEM::GeomEltNS::index_type | index, |
const RefGeomElt & | ref_geom_elt ) const |
Return the GeometricElt which index (given by GetIndex()) is index and which type is a ref_geom_elt.
[in] | index | Index which associated GeometricElt is sought. |
[in] | ref_geom_elt | RefGeomElt of the sought GeometricElt. |
std::size_t MoReFEM::Mesh::NgeometricElt | ( | std::size_t | dimension | ) | const |
Number of geometric elements of a given dimension.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
[in] | dimension | Dimension used as filter. |
std::size_t MoReFEM::Mesh::NgeometricElt | ( | const RefGeomElt & | ref_geom_elt | ) | const |
Number of geometric elements of a given type
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
[in] | ref_geom_elt | Type of the RefGeomElt. |
std::size_t MoReFEM::Mesh::NgeometricElt | ( | const RefGeomElt & | ref_geom_elt, |
const MeshLabel & | mesh_label ) const |
Number of geometric elements of a given type within a given label.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
[in] | mesh_label | MeshLabel for which the tallying is done. |
[in] | ref_geom_elt | Type of the RefGeomElt. |
const Coords & MoReFEM::Mesh::GetCoord | ( | std::size_t | index | ) | const |
Get the index -th coord on the processor.
[in] | index | Position of the sought Coords in the processor-wise Coords list. This index is the output of Coords::GetPositionInCoordsListInMesh(), NOT Coords::GetIndex() which might not be contiguous. |
|
noexcept |
Get the list of all Coords on the processor.
What is the meaning of "processor_wise" and "ghost" for Coords?
For a Dof, the "ghost" concept (relevant only for parallel runs) is clear cut:
Regarding Coords, the definition as such isn't so clear, but is nonetheless useful:
|
noexcept |
Get the list of the ghost Coords.
What is the meaning of "processor_wise" and "ghost" for Coords?
For a Dof, the "ghost" concept (relevant only for parallel runs) is clear cut:
Regarding Coords, the definition as such isn't so clear, but is nonetheless useful:
So to put in a nutshell: unless you are a core library develop that needs to tinker with library aspects, you probably don't need this method!
|
noexcept |
Get the list of the ghost Coords.
What is the meaning of "processor_wise" and "ghost" for Coords?
For a Dof, the "ghost" concept (relevant only for parallel runs) is clear cut:
Regarding Coords, the definition as such isn't so clear, but is nonetheless useful:
So to put in a nutshell: unless you are a core library develop that needs to tinker with library aspects, you probably don't need this method! (even more so than for GetGhostCoordsList()).
void MoReFEM::Mesh::Write | ( | const FilesystemNS::File & | mesh_file | ) | const |
Write the mesh into a file in the given format.
Several notes and caveat:
[in] | mesh_file | Path to the file into which the mesh will be written. |
FormatT | Format of the file to be written. Read the documentation above about the possible discrepancies of formats. |
|
private |
Compute the relevant pseudo-normals on the mesh.
[in] | label_index_list | List of the label on which compute pseudo normals. |
[in] | vertex_interface_list | List of Vertex. |
[in] | edge_interface_list | List of Edge. |
[in] | face_interface_list | List of Face. |
|
private |
Init a local mesh from a global one.
[in] | mpi | Mpi object which knows the rank of the processor, the total number of processors, etc... |
[in] | processor_wise_geom_elt_list | List of all geometric elements that are handled by the local processor. This list must be a subset of the current list of geometric elements. |
[in] | ghost_geom_elt_list | List of ghost GeometricElt. |
[in] | processor_wise_coords_list | List of processor-wise coords list, devised from the processor-wise list of NodeBearer. |
[in] | ghost_coords_list | List of ghost coords list, i.e. Coords that are only involved with ghost NodeBearer. If a Coords is related to both a processor-wise and a ghost NodeBearer, it won't appear in this list (put differently, intersection of processor_wise_coords_list and ghost_coords_list is the empty set). |
The internal index and the lowest processor for each Coords aren't yet computed; they will be only after the call to SetReducedCoordsList.
|
private |
Set the new coords after reduction to processor-wise.
This method is supposed to be called only in ShrinkToProcessorWise().
[in] | mpi | Mpi object which knows the rank of the processor, the total number of processors, etc... |
[in] | processor_wise_coords_list | List of processor-wise coords list, devised from the processor-wise list of NodeBearer. |
[in] | ghost_coords_list | List of ghost coords list, i.e. Coords that are only involved with ghost NodeBearer. If a Coords is related to both a processor-wise and a ghost NodeBearer, it won't appear in this list (put differently, intersection of processor_wise_coords_list and ghost_coords_list is the empty set). |
The internal index and the lowest processor for each Coords aren't yet computed; they will be only after the call to SetReducedCoordsList.
|
private |
For all processor-wise Coords, determine which is the lowest rank in which they appear (not counting ghosts).
The point is to be able to count without duplicating the number of Coords inside a given Domain.
[in] | mpi | Mpi object which knows the rank of the processor, the total number of processors, etc... |
[in] | Nprogram_wise_coords | Number of program-wise coords. This is required for internal Mpi computations, |
[in,out] | a_processor_wise_coords_list | The processor-wise list of Coords. The list itself is not modified, but the point of the method is to set properly the internal field is_lowest_processor_, hence the 'out' status. |
This is an internal method that is meant to be called by SetReducedCoordsList() only.
|
private |
Constructor helper method.
This method should be called by a any constructor, as it builds and sorts the expected content of the class.
[in,out] | unsort_processor_wise_geom_elt_list | List of processor-wiseGeometricElt. No specific order is expected here. |
[in,out] | unsort_ghost_geom_elt_list | List of ghostGeometricElt. No specific order is expected here. |
[in] | coords_list | List of Coords objects. |
[in] | mesh_label_list | List of MeshLabels. |
[in] | do_build_edge | Whether edges should be built or not. |
[in] | do_build_face | Whether faces should be built or not. |
[in] | do_build_volume | Whether volumes should be built or not. |
[in] | do_build_pseudo_normals | Whether pseudo-normals should be built or not. |
|
private |
Read a mesh from a file.
[in] | mesh_file | File from which the data will be loaded. |
[in] | format | Format of the input file. |
[in] | space_unit | The unit of the mesh, in meters. |
[in,out] | unsort_processor_wise_geom_elt_list | List of processor-wiseGeometricElt. No specific order is expected here. |
[in,out] | unsort_ghost_geom_elt_list | List of ghostGeometricElt. No specific order is expected here. |
[in] | coords_list | List of Coords objects. |
[in] | mesh_label_list | List of MeshLabels. |
[in] | prepartitioned_data | Optional parameter which is used when we are in fact loading a Mesh from prepartitioned data. In this case, this file includes the relevant data required to rebuild the Mesh identically as the one that was serialized in an earlier run. |
(for instance Ensight will always yield 3 here by construct).
|
private |
Actual implementation of BuildEdgeList or BuildFaceList.
InterfaceT | Interface type, which derives from Interface base class. Choices are among { Vertex, Edge, Face, Volume }. |
[internal]
A specialization for Vertex is declared in namespace scope at the end of this file.
This method builds both processor-wise and ghost interface.
[in,out] | interface_list | List of InterfaceT under construct. |
|
private |
Helper of BuildInterface.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
This method builds the interface either for processor-wise or for ghost.
[in,out] | interface_list | List of InterfaceT under construct. |
|
private |
Set the number of interfaces of InterfaceT type.
InterfaceT | Interface type, which derives from Interface base class. Choices are among { Vertex, Edge, Face, Volume }. |
[in] | Nprocessor_wise | Number of processsor-wise edges or faces fed to the object . |
[in] | Nghost | Number of ghost edges or faces fed to the object . |
|
private |
Determine the number of interfaces of InterfaceT type.
InterfaceT | Interface type, which derives from Interface base class. Choices are among { Vertex, Edge, Face, Volume }. |
|
private |
Reconstruct the labels after reduction to processor-wise data.
Only labels involved with GeometricElt kept on the local processors are kept.
|
private |
Mutator the list of the Coords related to processor-wise NodeBearer.
|
private |
Mutator the list of the Coords related ONLY to ghost NodeBearer.
|
private |
For constructor for prepartitioned data: split the processor_wise_coords_list_ in processor-wise and ghost Coords.
In this constructor, we want to rebuild the model from data that were partitioned beforehand. So we read a mesh file which is a subset of the full mesh submitted initially to the partition; when it is read all Coords are tagged as processor-wise. That is not actually the reality: some of them are in fact mainly born by another processor and it is a ghost for current rank. The role of this method is to sort this and split between processor_wise_coords_list_ and ghost_coords_list_; it's rather trivial as by construct the Nprocessor_wise first elements are processor-wise.
[in] | Nprocessor_wise | Number of Coords to keep in processor-wise containers. |
Should not be used outside of the constructor for prepartitioned data.
|
noexcept |
Compute a list of GeometricElt which covers both the processor-wise and ghost.
|
privatenoexcept |
Internal method that dispatch the correct GeometricElt list depending on RoleOnProcessorT value.
RoleOnProcessorT | Whether we consider processor-wise or ghost. |
|
inherited |
Get the value of the internal unique ID.
|
staticinherited |
Generate a unique id.
No new objects is created, and the new identifier is not counted in the list - the purpose here is just to provide a value that don't collide with existing objects. This is really used in a very edge case; think twice before using this functionality as it really might not be what you really seek.
|
staticinherited |
Clear all unique ids.
|
staticprivateinherited |
If AssignationMode is automatic, generates a new unique identifier.
|
staticprivateinherited |
If AssignationMode is manual, checks the unique identifier provided is valid.
[in] | new_unique_id | The proposed new unique id. If it already exists an exception will be thrown. |
|
private |
List of all Coords on the processor.
What is the meaning of "processor_wise" and "ghost" for Coords?
For a Dof, the "ghost" concept (relevant only for parallel runs) is clear cut:
Regarding Coords, the definition as such isn't so clear, but is nonetheless useful:
|
private |
List of ghost Coords.
What is the meaning of "processor_wise" and "ghost" for Coords?
For a Dof, the "ghost" concept (relevant only for parallel runs) is clear cut:
Regarding Coords, the definition as such isn't so clear, but is nonetheless useful:
|
private |
List of all the geometric elements of the mesh, sort by dimension.
Key is the dimension, and value is the list of all geometric elements of that dimension in the mesh.
Underlying order is expected to be by geometric element nature (all triangles3, then all triangles6, etc...).
|
private |
List of all ghost GeometricElt.
These GeometricElt aren't directly handled by the current rank, but they are related for few LocalFEltSpace that gets some NodeBearer that are managed by the current rank, We shouldn't have to use them except for writing data on disk; the point of this list is mostly to keep track of them.
|
private |
Number of built vertex (processor-wise).
Interfaces that are present on a processor-wise GeomElt but which NodeBearer is handled by another processor is not counted here.
First index is the processor-wise count, second the ghost one.
|
private |
Number of built edges that are related to a NodeBearer.
Interfaces that are present on a processor-wise GeomElt but which NodeBearer is handled by another processor is not counted here.
If BuildEdgeList() has not been called, this quantity is an UninitializedIndex; fetching this quantity should lead to an assert.
First index is the processor-wise count, second the ghost one.
|
private |
Number of built faces.
Interfaces that are present on a processor-wise GeomElt but which NodeBearer is handled by another processor is not counted here.
If BuildFaceList() has not been called, this quantity is an UninitializedIndex; fetching this quantity should lead to an assert. First index is the processor-wise count, second the ghost one.
|
private |
Number of built volumes.
Interfaces that are present on a processor-wise GeomElt but which NodeBearer is handled by another processor is not counted here.
If BuildFaceList() has not been called, this quantity is an UninitializedIndex; fetching this quantity should lead to an assert.
First index is the processor-wise count, second the ghost one.