15 static const t_index INTERNAL_ZONE = -1;
45 static_assert(
sizeof(
ElemInfo) <= (4ULL * 2));
102#define DNDS_COPY_MEMBER_VIEW(obj, member) \
103 member = (obj).member.template deviceView<B>();
104#define DNDS_COPY_MEMBER(obj, member) \
105 member = (obj).member;
107 template <DeviceBackend B>
141 return std::make_tuple(
153 template <
class TMain>
175 return std::make_tuple(
180 template <
class TMain>
201 return std::make_tuple(
209 template <
class TMain>
222 return std::make_tuple(
227 template <
class TMain>
234 template <
class TMain>
295 template <
class FA,
class FB,
class F0>
297 index iFace,
rowsize if2c, FA &&fA, FB &&fB, F0 &&f0 = []() {})
315 template <
class tC2n>
318 cs.resize(Eigen::NoChange, c2n.size());
319 for (
rowsize i = 0; i < c2n.size(); i++)
321 index iNode = c2n[i];
323 cs(EigenAll, i) =
coords[iNode];
330 template <
class tC2n,
class tCoordExt>
333 cs.resize(Eigen::NoChange, c2n.size());
334 for (
rowsize i = 0; i < c2n.size(); i++)
336 index iNode = c2n[i];
338 cs(EigenAll, i) = coo[iNode];
345 template <
class tC2n,
class tC2nPbi>
348 cs.resize(Eigen::NoChange, c2n.size());
349 for (
rowsize i = 0; i < c2n.size(); i++)
351 index iNode = c2n[i];
360 template <
class tC2n,
class tC2nPbi,
class tCoordExt>
363 cs.resize(Eigen::NoChange, c2n.size());
364 for (
rowsize i = 0; i < c2n.size(); i++)
366 index iNode = c2n[i];
Adjacency array (CSR-like index storage) built on ParArray.
Eigen-vector array: each row is an Eigen::Map over contiguous real storage.
Father-son array pairs with device views and ghost communication.
Core 2D variable-length array container with five data layouts.
#define DNDS_DEVICE_TRIVIAL_COPY_DEFINE(T, T_Self)
#define DNDS_DEVICE_CALLABLE
#define DNDS_DEVICE_TRIVIAL_COPY_DEFINE_NO_EMPTY_CTOR(T, T_Self)
Device memory abstraction layer with backend-specific storage and factory creation.
#define DNDS_assert(expr)
Debug-only assertion (compiled out when DNDS_NDEBUG is defined). Prints the expression + file/line + ...
#define DNDS_HD_assert(cond)
Host-only expansion of DNDS_HD_assert (equivalent to DNDS_assert).
#define DNDS_COPY_MEMBER(obj, member)
#define DNDS_COPY_MEMBER_VIEW(obj, member)
Tiny reflection-style helpers (MemberRef, MemberPtr) and for_each_member_* visitors used by config / ...
#define DNDS_MAKE_1_MEMBER_REF(x)
Construct a MemberRef capturing x and its stringified name.
decltype(tAdj1Pair::father) tAdj1
std::function< std::string(int)> tFGetName
decltype(tAdj8Pair::father) tAdj8
decltype(tAdj4Pair::father) tAdj4
decltype(tIndPair::father) tInd
decltype(tAdj2Pair::father) tAdj2
decltype(tAdjPair::father) tAdj
std::function< DNDS::real(int, DNDS::index)> tFGetData
std::function< DNDS::real(int, DNDS::index, DNDS::rowsize)> tFGetVecData
decltype(tAdj3Pair::father) tAdj3
DNDS::ssp< DNDS::ParArray< ElemInfo > > tElemInfoArray
Eigen::Matrix< real, 3, Eigen::Dynamic > tSmallCoords
DNDS_DEVICE_CALLABLE bool FaceIDIsPeriodic(t_index id)
DNDS_DEVICE_CALLABLE bool FaceIDIsPeriodicDonor(t_index id)
DNDS_DEVICE_CALLABLE bool FaceIDIsPeriodicMain(t_index id)
decltype(tPbiPair::father) tPbi
decltype(tCoordPair::father) tCoord
the host side operators are provided as implemented
DNDS_CONSTANT const index UnInitIndex
Sentinel "not initialised" index value (= INT64_MIN).
int32_t rowsize
Row-width / per-row element-count type (signed 32-bit).
int64_t index
Global row / DOF index type (signed 64-bit; handles multi-billion-cell meshes).
std::shared_ptr< T > ssp
Shortened alias for std::shared_ptr used pervasively in DNDSR.
double real
Canonical floating-point scalar used throughout DNDSR (double precision).
DNDS_DEVICE_CALLABLE index Size() const
Combined father + son row count.
Mutable device view onto an ArrayPair (for CUDA kernels).
Convenience bundle of a father, son, and attached ArrayTransformer.
ssp< TArray > father
Owned-side array (must be resized before ghost setup).
DNDS_DEVICE_CALLABLE Elem::ElemType getElemType() const
t_index zone
positive for BVnum, 0 for internal Elems, Negative for ?
static std::string pybind11_name()
DNDS_DEVICE_CALLABLE void setElemType(Elem::ElemType t)
static MPI_Datatype CommType()
DNDS_DEVICE_CALLABLE tPoint GetCoordByBits(const tPoint &c, const NodePeriodicBits &bits) const
tAdj2Pair::t_deviceView< B > face2cell
DNDS_DEVICE_CALLABLE index NumCellGhost() const
DNDS_DEVICE_CALLABLE index NumCellProc() const
DNDS_DEVICE_CALLABLE index NumBndGhost() const
DNDS_DEVICE_CALLABLE index NumBndProc() const
tAdjPair::t_deviceView< B > cell2node
MeshAdjState adjN2CBState
DNDS_DEVICE_CALLABLE void GetCoordsOnCell(index iCell, tSmallCoords &cs, tCoordPair &coo)
DNDS_DEVICE_CALLABLE void GetCoordsOnFace(index iFace, tSmallCoords &cs)
DNDS_DEVICE_CALLABLE t_index GetCellZone(index iC)
DNDS_DEVICE_CALLABLE index CellFaceOther(index iCell, index iFace) const
tAdj2Pair::t_deviceView< B > bnd2cell
tAdjPair::t_deviceView< B > bnd2node
void create_view_N2CB(TMain &&m_obj)
DNDS_DEVICE_CALLABLE void __GetCoordsOnElem(const tC2n &c2n, const tC2nPbi &c2nPbi, tSmallCoords &cs)
specially for periodicity
DNDS_HOST void create_view_facial(TMain &&m_obj)
DNDS_HOST auto device_array_list_facial()
tAdjPair::t_deviceView< B > cell2face
interpolated
tCoordPair::t_deviceView< B > coords
reader
void create_view_primary(TMain &&m_obj)
DNDS_DEVICE_CALLABLE bool CellIsFaceBack(index iCell, index iFace) const
tAdjPair::t_deviceView< B > face2node
DNDS_DEVICE_CALLABLE t_index GetBndZone(index iB)
DNDS_DEVICE_CALLABLE void __GetCoords(const tC2n &c2n, tSmallCoords &cs, tCoordExt &coo)
directly load coords; gets faulty if isPeriodic!
tAdjPair::t_deviceView< B > node2cell
DNDS_DEVICE_CALLABLE void __GetCoordsOnElem(const tC2n &c2n, const tC2nPbi &c2nPbi, tSmallCoords &cs, tCoordExt &coo)
specially for periodicity
DNDS_HOST auto device_array_list_C2F()
DNDS_HOST void create_view_C2F(TMain &&m_obj)
DNDS_DEVICE_CALLABLE Elem::Element GetBndElement(index iB)
DNDS_DEVICE_CALLABLE index NumNode() const
tElemInfoArrayPair::t_deviceView< B > cellElemInfo
tPbiPair::t_deviceView< B > cell2nodePbi
periodic only, after reader
DNDS_DEVICE_CALLABLE t_index GetFaceZone(index iF)
tAdjPair::t_deviceView< B > node2bnd
DNDS_DEVICE_CALLABLE index NumFace() const
tAdj1Pair::t_deviceView< B > face2bnd
MeshAdjState adjPrimaryState
tAdj1Pair::t_deviceView< B > bnd2face
DNDS_DEVICE_CALLABLE UnstructuredMeshDeviceView(TMain &mesh, index placeholder)
DNDS_DEVICE_CALLABLE void GetCoordsOnCell(index iCell, tSmallCoords &cs)
tPbiPair::t_deviceView< B > face2nodePbi
periodic only, after interpolated
auto device_array_list_primary()
DNDS_DEVICE_CALLABLE Elem::Element GetFaceElement(index iF)
tPbiPair::t_deviceView< B > bnd2nodePbi
DNDS_DEVICE_CALLABLE index NumNodeProc() const
DNDS_DEVICE_CALLABLE auto CellOtherCellPeriodicHandle(index iFace, rowsize if2c, FA &&fA, FB &&fB, F0 &&f0=[]() {})
fA executes when if2c points to the donor side; fB the main side
DNDS_DEVICE_CALLABLE index NumCell() const
DNDS_DEVICE_CALLABLE Elem::Element GetCellElement(index iC)
MeshAdjState adjFacialState
DNDS_DEVICE_CALLABLE index NumFaceProc() const
DNDS_DEVICE_CALLABLE index NumBnd() const
tElemInfoArrayPair::t_deviceView< B > bndElemInfo
DNDS_DEVICE_CALLABLE index NumNodeGhost() const
tElemInfoArrayPair::t_deviceView< B > faceElemInfo
DNDS_DEVICE_CALLABLE tPoint GetCoordNodeOnCell(index iCell, rowsize ic2n)
DNDS_DEVICE_CALLABLE index NumFaceGhost() const
auto device_array_list_N2CB()
DNDS_DEVICE_CALLABLE void __GetCoords(const tC2n &c2n, tSmallCoords &cs)
directly load coords; gets faulty if isPeriodic!
DNDS_DEVICE_CALLABLE tPoint GetCoordNodeOnFace(index iFace, rowsize if2n)
tAdjPair::t_deviceView< B > cell2cell