Class MeshContinuum

Class Documentation

class MeshContinuum

Encapsulates all the necessary information required to fully define a computational domain.

Public Functions

MeshContinuum()
inline unsigned int GetDimension() const
inline void SetDimension(const unsigned int dim)
inline MeshType GetType() const
inline void SetType(const MeshType type)
inline CoordinateSystemType GetCoordinateSystem() const
inline void SetCoordinateSystem(const CoordinateSystemType coord_sys)
inline bool Extruded() const
inline void SetExtruded(const bool extruded)
std::array<size_t, 3> GetIJKInfo() const

Gets and orthogonal mesh interface object.

inline void SetOrthoAttributes(const OrthoMeshAttributes &attrs)
inline void SetGlobalVertexCount(const uint64_t count)
inline uint64_t GetGlobalVertexCount() const
size_t GetGlobalNumberOfCells() const
inline std::map<uint64_t, std::string> &GetBoundaryIDMap()
inline const std::map<uint64_t, std::string> &GetBoundaryIDMap() const
std::vector<uint64_t> GetUniqueBoundaryIDs() const

Returns the unique boundary ids present in the problem.

void ComputeGeometricInfo()

Compute the geometric data for the cells and faces in the mesh.

void ClearCellReferences()

Method to be called if cells and nodes have been transferred to another grid.

uint64_t MakeBoundaryID(const std::string &boundary_name) const

Makes a boundary id given a name. If the boundary name already exists, the associated boundary id will be returned. Other the id will be set to one more than the maximum boundary id.

void SetOrthogonalBoundaries()

Defines the standard x/y/z min/max boundaries.

std::shared_ptr<GridFaceHistogram> MakeGridFaceHistogram(double master_tolerance = 100.0, double slave_tolerance = 1.1) const

Populates a face histogram.

The function populates face_categories which is a structure containing pairs. Pair.first is the max dofs-per-face for the category and Pair.second is the number of faces in this category.

Parameters:
  • master_tolerance – Multiple histograms will only be attempted if the ratio of the maximum dofs-per-face to the average dofs-per-face is greater than this value. Default 1.2.

  • slave_tolerance – While traversing a sorted list of dofs-per-face, a new bin will only be generated when the ratio of the listed dofs-per-face to a running bin average exceeds this value. Defualt 1.1.

bool IsCellLocal(uint64_t global_id) const

Returns whether the cell with the given global id is locally owned.

size_t MapCellGlobalID2LocalID(uint64_t global_id) const

Given a global id of a cell, returns the local id if the cell is local, otherwise throws an out_of_range error.

void FindAssociatedVertices(const CellFace &cur_face, std::vector<short> &dof_mapping) const

Creates a mapping of the current face local ids to the adjacent face’s local ids.

void FindAssociatedCellVertices(const CellFace &cur_face, std::vector<short> &dof_mapping) const

Creates a mapping of the current face local ids to the adjacent cell’s local ids.

size_t CountCellsInLogicalVolume(const LogicalVolume &log_vol) const

Counts the number of cells within a logical volume across all partitions.

bool CheckPointInsideCell(const Cell &cell, const Vector3 &point) const

Checks whether a point is within a cell.

bool CheckPointInsideCellFace(const Cell &cell, size_t face_i, const Vector3 &point) const

Checks whether a point is within a cell face.

NDArray<uint64_t, 3> MakeIJKToGlobalIDMapping() const

Provides a mapping from cell ijk indices to global ids.

std::vector<Vector3> MakeCellOrthoSizes() const

Determines the bounding box size of each cell and returns it as a list of 3-component vectors, one Vector3 for each cell.

std::pair<Vector3, Vector3> GetLocalBoundingBox() const

Returns the bounding box corners for the locally owned cells.

void SetUniformBlockID(int blk_id)

Sets block ids for all cells to the specified block id.

void SetBlockIDFromLogicalVolume(const LogicalVolume &log_vol, int blk_id, bool sense)

Sets block IDs using a logical volume.

void SetBoundaryIDFromLogicalVolume(const LogicalVolume &log_vol, const std::string &boundary_name, bool sense = true)

Sets boundary ids using a logical volume.

Vector3 ComputeCentroidFromListOfNodes(const std::vector<uint64_t> &list) const

Computes the centroid from nodes specified by the given list.

std::array<std::array<Vector3, 3>, 4> GetTetrahedralFaceVertices(const Cell &cell, const CellFace &face, size_t side) const

Get the face vertices of a tetrahedron contained within the given face and side of a polyhedron.

std::shared_ptr<MPICommunicatorSet> MakeMPILocalCommunicatorSet() const

Gets the communicator-set for interprocess communication, associated with this mesh. If not created yet, it will create it.

std::map<int, double> ComputeVolumePerBlockID() const

Compute volume per block IDs.

Public Members

VertexHandler vertices
LocalCellHandler local_cells
GlobalCellHandler cells

Public Static Functions

static inline std::shared_ptr<MeshContinuum> New()

Returns a new instance of the spatial discretization.

static int GetCellDimension(const Cell &cell)

Returns the spatial dimensionality of the cell.

static size_t MapCellFace(const Cell &cur_cell, const Cell &adj_cell, unsigned int f)

Given the current cell, cell A, and its adjacent cell, cell B, with cell B adjacent to A at the f-th face of cell A. Will determine the af-th index of the face on cell B that interface with the f-th face of cell A.