268 print(std::ostream& os = std::cout)
const;
295 std::ostream& os = std::cout)
const;
std::basic_string< CepsChar > CepsString
C++ format string.
CepsGlobalIndex CepsCellGlobalIndex
Indices of cells.
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
CepsGlobalIndex CepsNodeGlobalIndex
Indices of nodes.
CepsArray< _Type, 3U > CepsArray3
C++ array, 3 elements.
std::unordered_multimap< _Key, _Tp, _Hash, _KeyEqual, _Alloc > CepsMultiMap
C++ multimap.
std::ostream & operator<<(std::ostream &os, const Geometry &g)
Displays some info about geometry.
PartitioningMethod
Enum only meant to hold the method typedef.
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
Abstract class for geometrical cell. On top of index and attributes managament, the cell has informat...
Base class for nodes used in meshes.
Class is used to compute a geometry (multiple meshes) partitioning.
Encapsulates all the geometrical data.
void printDataDistribution(CepsUInt *nCells, CepsUInt *nBdCells, CepsUInt *nNodes, CepsUInt *nHaloNodes, std::ostream &os=std::cout) const
Displays the data distribution (percentages of cell and nodes ownership) for each process.
void scale(CepsReal scaleFactor)
Scale the entire geometry.
CepsVector< CepsSet< CepsNodeGlobalIndex > > m_nodesToSend
List of nodes of which to send data to other process (build at partitioning)
const CepsMap< CepsAttribute, CepsUInt > & getPartitionWeights() const
Set the weights to be put on each region before partitioning.
CepsVector< CepsNodeGlobalIndex > m_nodePartitionMap
Map of node indices from read geometry to partitioned geometry.
CepsUInt m_maxNodeConnectivity
Maximum number of neighbors found for current geometry.
CepsBool has1dMesh() const
true if geometry has 1d data
CepsUInt getNbHaloNodesLocal() const
Number of halo nodes local to this process.
GeomNode * getNode(CepsNodeGlobalIndex globalID, CepsBool ownedOnly=false)
Returns a pointer to the node with given global ID. Nullptr if node is not owned or halo.
CepsUInt m_nbHaloNodes
Number of halo nodes (all meshes, all process)
void setPartitionWeightsFromString(const CepsString &s)
Sets the partition weights for given regions. Default is 1 everywhere.
CepsUInt getNbBoundaryCellsLocal() const
Number of boundary cells local to this process (3d, 2d and 1d). N.B as we have implemented a multiple...
CepsVector< GeomCellJunction * > m_junctionCells
Fake cells to join meshes.
void initialize()
Sets default values.
void setCoupledNodesFile(const CepsString &coupledNodesFile)
Reads mesh couplings from this file.
void set2dMesh(const CepsString &meshFileName)
Creates the 2D mesh data.
CepsArray3< CepsBool > m_hasMeshOfDim
If the geometry contains XD data.
CepsUInt getNbBoundaryCells() const
Number of boundary cells of the geometry (global).
const CepsVector< CepsUInt > & getNodeOffsetPerMesh()
Number of nodes per mesh.
Mesh * get3dMesh() const
Pointer on the 3D mesh.
InputParameters * m_parameters
Config used to setup the geometry, if any.
const CepsVector< CepsSet< CepsNodeGlobalIndex > > & getNodesToReceive()
List of nodes of which to get data to other process (build at partitioning)
void setPartitioningMethod(PartitioningMethod method)
Sets the partitioning method.
CepsArray3< Mesh * > m_meshes
pointer to xD mesh instance
const CepsVector< CepsString > & getVolumicFileNames() const
Files with 3D cells.
CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > m_coupledNodes
Pairs of coupled nodes.
const CepsVector< CepsString > & getCableFileNames() const
Files with 1D cells.
CepsReal m_maxCellDiameter
Largest cell size across meshes.
CepsBool m_hasCoupledNodes
Whether the geometry has connections or not.
CepsUInt getNbHaloNodes() const
Number of halo nodes of the geometry (global)
Geometry()
Default constructor.
CepsUInt m_nbNodes
Number of nodes (all meshes, all process)
const CepsVector< CepsUInt > & getCellOffsetPerMesh()
Number of cells per mesh.
Mesh * get2dMesh() const
Pointer on the 2D mesh.
CepsUInt m_nbCells
Number of non-boundary cells (all meshes, all process)
const CepsVector< CepsNodeGlobalIndex > & getNodePartitionMap()
The node index map from before to after partitioning.
CepsUInt getNbOwnedNodesLocal() const
Number of nodes local to this process, without halo nodes.
const CepsString & getCoupledNodesFileName() const
Coupled nodes file name.
CepsMap< CepsAttribute, CepsVector< CepsCellGlobalIndex > > m_connections
Junctions.
CepsBool has2dMesh() const
true if geometry has 2d data
PartitioningMethod m_partitioningMethod
How the geometry is partitioned.
CepsVector< CepsUInt > m_cellOffsetPerMesh
Offset of each mesh.
void setMeshOfDim(CepsUInt dim, const CepsString &meshFileName)
Creates mesh data of given dimension.
void getLocalDistribution(CepsUInt *nCells, CepsUInt *nBdCells, CepsUInt *nNodes, CepsUInt *nHaloNodes) const
Gets the local data distribution of all the domains.
CepsBool has3dMesh() const
true if geometry has 3d data
Mesh * get1dMesh() const
Pointer on the 1D mesh.
CepsReal computeMaxCellDiameter()
Finds the largest cell diameter.
const CepsVector< CepsString > & getFileNamesForDim(CepsUInt dim) const
Mesh file names.
CepsString m_coupledNodesFileName
Connections file name, if any.
void setupWithParameters(InputParameters *params)
Initializes the instance with all parameters.
CepsVector< CepsCellGlobalIndex > m_cellPartitionMap
Map of cell indices from read geometry to partitioned geometry.
PartitioningMethod getPartitioningMethod() const
Partitioning method (flavours of scotch)
CepsUInt getNbNodesLocal() const
Number of nodes local to this process, with halo nodes.
CepsReal getMaxCellDiameter() const
Get the largest diameter of geom cells across meshes.
const CepsVector< CepsString > & getSurfacicFileNames() const
Files with surfacic cells.
CepsVector< CepsSet< CepsNodeGlobalIndex > > m_nodesToReceive
List of nodes of which to get data to other process (build at partitioning)
CepsUInt computePartition()
Launches the computation of a partitioning. A Geometry may not be manipulated before a partitioning h...
const CepsVector< CepsSet< CepsNodeGlobalIndex > > & getNodesToSend()
List of nodes of which to send data to other process (build at partitioning)
void set3dMesh(const CepsString &meshFileName)
Creates the 3D mesh data.
void updateGeometryInfo()
Update each mesh info.
friend std::ostream & operator<<(std::ostream &os, const Geometry &g)
Displays some info.
void setPartitioningMethodFromString(const CepsString &s)
Sets the partioning method from the input string.
Mesh * getMeshOfDim(CepsUInt dim) const
Return the mesh of requested dimension.
CepsUInt getNbNodes() const
Number of nodes of the geometry (global)
CepsUInt m_nbBoundaryCells
Number of boundary cells (all meshes, all process)
CepsVector< CepsUInt > m_nodeOffsetPerMesh
Offset of each mesh.
void print(std::ostream &os=std::cout) const
Displays some info.
CepsUInt getMaxNodeConnectivity() const
Maximum number of adjacent nodes.
CepsUInt getNbCellsLocal() const
Number of cells local to this process (3d, 2d and 1d). N.B as we have implemented a multiple ownershi...
GeomCell * getCell(CepsCellGlobalIndex globalID)
Returns a pointer to the cell with given global ID. Nullptr if cell is not owned.
CepsUInt computeMaxNodeConnectivity()
Finds the maximum number of adjacent nodes.
CepsBool hasMeshOfDim(CepsUInt dim) const
true if geometry has data of requested dimension
CepsMap< CepsAttribute, CepsUInt > m_partitionWeights
nb of unknowns per regions for unbalanced partitions
CepsArray3< CepsVector< CepsString > > m_meshFilenames
All the meshes file names.
const CepsVector< CepsCellGlobalIndex > & getCellPartitionMap()
The node index map from before to after partitioning.
void setPartitionWeights(const CepsMap< CepsAttribute, CepsUInt > &weights)
Set the weights to be put on each region before partitioning.
void getGlobalDistribution(CepsUInt *nCells, CepsUInt *nBDCells, CepsUInt *nNodes, CepsUInt *nHaloNodes) const
Gets the global data distribution of the domains.
void set1dMesh(const CepsString &meshFileName)
Creates the 1D mesh data.
void updateMeshInfo(CepsUInt dim)
Communicate mesh ownership data to all processes.
const CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > & getCoupledNodes()
Coupled nodes local (owned or in the halo) of this process.
CepsUInt getNbCells() const
Number of non-boundary cells of the geometry (global).
Geometrical information of 1,2 or 3D distributed cells.
Geometry partitioning with PtScotch.