CartesianMPI.h¶
-
template<typename
T
, typenameMesh
, Cubism::EntityTypeEntity
= Cubism::EntityType::Cell, size_tRANK
= 0, typenameUserState
= Block::FieldState, template<typename> classAlloc
= AlignedBlockAllocator>
classCubism::Grid
::
CartesianMPI
: public Cubism::Grid::Cartesian<T, Mesh, Entity, RANK, UserState, Alloc> Cartesian MPI block (tensor) field.
Cartesian topology composed of block Field.h for the specified entity type. As opposed to an individual block Field.h, this class manages a structure of arrays (SoA) memory layout for all the blocks in the rank local Cartesian topology instead of just individual blocks. See the Cartesian.h grid section for a non-distributed variant of this class as well as the
UserState
extension.- Template Parameters
T
: Field data typeMesh
: Mesh type to be associated with fieldsEntity
: Entity typeRANK
: Rank of (tensor) fieldsAlloc
: Allocator for field data
Public Types
-
using
BaseType
= typename Assembler::BaseType¶ Block (scalar, tensor, face) field type.
-
using
DataType
= typename Assembler::DataType¶ Data type of carried fields.
-
using
FieldContainer
= typename Assembler::FieldContainer¶ Container type for field views.
-
using
IndexFunctor
= Block::PeriodicIndexFunctor<FieldContainer, BaseType::Class, RANK>¶ Periodic block field access by index.
-
using
MultiIndex
= typename IndexRangeType::MultiIndex¶ Type for higher dimensional index.
Public Functions
-
inline
CartesianMPI
(const MPI_Comm &comm, const MultiIndex &nprocs, const MultiIndex &nblocks, const MultiIndex &block_cells, const PointType &begin = PointType(0), const PointType &end = PointType(1), const PointType &gbegin = PointType(0), const PointType &gend = PointType(1))¶ Main constructor for a Cartesian MPI block field topology.
- Parameters
comm
: MPI communicator for this Cartesian topologynprocs
: Number of MPI processes in each dimensionnblocks
: Number of blocks per rankblock_cells
: Number of cells in each blockbegin
: Physical origin for the full (all ranks) Cartesian grid (lower left)end
: Physical end for the full (all ranks) Cartesian grid (top right)gbegin
: Global begin of physical domaingend
: Global end of physical domain
-
CartesianMPI
() = default¶ Default constructor.
-
CartesianMPI
(const CartesianMPI &c) = delete¶ Deleted copy constructor.
-
CartesianMPI
(CartesianMPI &&c) = delete¶ Deleted move constructor.
-
CartesianMPI &
operator=
(const CartesianMPI &c) = default¶ Default copy assignment.
-
CartesianMPI &
operator=
(CartesianMPI &&c) = delete¶ Deleted move assignment.
-
inline virtual MultiIndex
getGlobalSize
() const override¶ Global size of the grid in all dimensions.
- Return
Number of blocks in all dimensions in the global grid
-
inline MultiIndex
getNumProcs
() const¶ MPI processes in the topology.
- Return
Number of processes in the MPI topology
-
inline MultiIndex
getProcIndex
() const¶ Cartesian index of MPI process.
- Return
Multi-dimensional index of the process
-
inline int
getCartRank
() const¶ MPI rank.
- Return
Rank of the process in the Cartesian communicator
-
inline MPI_Comm
getCartComm
() const¶ MPI communicator.
- Return
Cartesian MPI communicator
-
inline bool
isRoot
() const¶ Test for root process.
- Return
True if this is the root rank