StructuredUniform.h¶
-
template<typename
TReal
, size_tDIM
>
classCubism::Mesh
::
StructuredUniform
: public Cubism::Mesh::StructuredBase<TReal, DIM>¶ Structured uniform mesh.
- Template Parameters
TReal
: Float type for mesh entitiesDIM
: Mesh dimension
Public Types
-
using
BaseMesh
= StructuredBase<TReal, DIM>¶ Base mesh type.
-
using
EntityType
= Cubism::EntityType¶ Mesh entity type.
-
using
IndexRangeType
= Core::IndexRange<DIM>¶ Index range used to address discrete mesh entities.
-
using
MeshIntegrity
= Cubism::MeshIntegrity¶ Mesh integrity.
-
using
MultiIndex
= typename IndexRangeType::MultiIndex¶ Multi-dimensional index.
Public Functions
-
inline
StructuredUniform
(const PointType &begin, const PointType &end, const MultiIndex &cells, const MeshIntegrity type)¶ Standard mesh constructor.
- Parameters
begin
: Lower left point of physical domainend
: Upper right point of physical domaincells
: Number of cells in meshtype
: Mesh integrity type (full mesh or sub-mesh)
-
inline
StructuredUniform
(const PointType &end, const MultiIndex &cells, const MeshIntegrity type)¶ Standard mesh constructor.
Physical begin at 0
- Parameters
end
: Upper right point of physical domaincells
: Number of cells in meshtype
: Mesh integrity type (full mesh or sub-mesh)
-
inline
StructuredUniform
(const MultiIndex &cells)¶ Standard mesh constructor.
Physical domain [0, 1], always a full mesh type
- Parameters
cells
: Number of cells in mesh
-
inline
StructuredUniform
(const RangeType &grange, const RangeType &range, const IndexRangeType &crange, const MeshIntegrity type)¶ Standard mesh constructor.
Used for MPI subdomains
- Parameters
grange
: Global domain range spanned by this meshrange
: Domain range spanned by this meshcrange
: Cell range spanned by this meshtype
: Mesh integrity type (full mesh or sub-mesh)
-
inline
StructuredUniform
(const RangeType &grange, const RangeType &range, const IndexRangeType &crange, const IndexRangeType &nrange, const std::vector<IndexRangeType> &frange, const MeshIntegrity type)¶ Low-level mesh constructor.
Used for grid topology classes and sub-meshes
- Parameters
grange
: Global domain range spanned by this meshrange
: Domain range spanned by this meshcrange
: Cell range spanned by this meshnrange
: Node range spanned by this meshfrange
: Face range spanned by this meshtype
: Mesh integrity type (full mesh or sub-mesh)
-
inline virtual std::unique_ptr<StructuredUniform>
getSubMesh
(const IndexRangeType &range, const EntityType entity, const size_t d = 0) const¶ Get sub-mesh instance.
An empty mesh is returned if there is no common intersection. If
range
is larger it will be clipped to the boundaries of this mesh.Note
This method is not part of the
BaseMesh
interface.- Return
New sub-mesh instance
- Parameters
range
: Index range of new meshentity
: Entity type corresponding torange
d
: Direction indicator (for Face entities only)
-
inline virtual std::unique_ptr<StructuredUniform>
getSubMesh
(const PointType &begin, const PointType &end) const¶ Get sub-mesh instance.
If
begin
orend
is outside of the physical range spanned by this mesh, then they will be adjusted to the begin and/or end points of the range corresponding to this mesh, respectively. The extracted discrete mesh is always guaranteed to include thebegin
andend
points. Therefore,getRange().getBegin()
of the extracted sub-mesh may be smaller in any component thanbegin
and vice versagetRange().getEnd()
may be larger in any component thanend
.Note
This method is not part of the
BaseMesh
interface.- Return
New sub-mesh instance
- Parameters
begin
: Lower left point of physical domain for sub-meshend
: Upper right point of physical domain for sub-mesh
-
inline PointType
getGlobalCoordsCell
(const MultiIndex &p) const¶ Get global cell coordinates.
This is a non-virtual method. Prefer this method for excessive coordinate lookup in loops.
- Return
Global cell coordinates
- Parameters
p
: Local multi-dimensional cell index
-
inline PointType
getGlobalCoordsNode
(const MultiIndex &p) const¶ Get global node coordinates.
This is a non-virtual method. Prefer this method for excessive coordinate lookup in loops.
- Return
Global node coordinates
- Parameters
p
: Local multi-dimensional node index
-
template<typename
Dir
= size_t>
inline PointTypegetGlobalCoordsFace
(const MultiIndex &p, const Dir dir) const¶ Get global face coordinates.
This is a non-virtual method. Prefer this method for excessive coordinate lookup in loops.
- Return
Global face coordinates
- Template Parameters
Dir
: Special type that defines a cast tosize_t
- Parameters
p
: Local multi-dimensional face indexdir
: Face direction identifier
-
inline PointType
getCoordsCell
(const MultiIndex &p) const¶ Get local cell coordinates.
This is a non-virtual method. Prefer this method for excessive coordinate lookup in loops.
- Return
Local cell coordinates
- Parameters
p
: Local multi-dimensional cell index
-
inline PointType
getCoordsNode
(const MultiIndex &p) const¶ Get local node coordinates.
This is a non-virtual method. Prefer this method for excessive coordinate lookup in loops.
- Return
Local node coordinates
- Parameters
p
: Local multi-dimensional node index
-
template<typename
Dir
= size_t>
inline PointTypegetCoordsFace
(const MultiIndex &p, const Dir dir) const¶ Get local face coordinates.
This is a non-virtual method. Prefer this method for excessive coordinate lookup in loops.
- Return
Local face coordinates
- Template Parameters
Dir
: Special type that defines a cast tosize_t
- Parameters
p
: Local multi-dimensional face indexdir
: Face direction identifier