DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
VRDefines.hpp
Go to the documentation of this file.
1#pragma once
2#include "DNDS/Defines.hpp"
3#include "DNDS/MPI.hpp"
4#include "Geom/Quadrature.hpp"
5#include "Geom/Mesh.hpp"
9#include "DNDS/ArrayDOF.hpp"
10#include "Geom/BaseFunction.hpp"
11
12namespace DNDS::CFV
13{
14 /**
15 * @brief Returns the reconstruction DOF index range [start, end] (inclusive)
16 * for a given polynomial order within the given spatial dimension.
17 *
18 * Reconstruction DOFs exclude the cell mean (order-0 DOF), so the indices
19 * are 0-based into the rec coefficient matrix rows. For example, in 2D:
20 * order 1 -> [0, 1] (2 DOFs: dx, dy)
21 * order 2 -> [2, 4] (3 DOFs: dxx, dxy, dyy)
22 * order 3 -> [5, 8] (4 DOFs: dxxx, dxxy, dxyy, dyyy)
23 *
24 * @param pOrder Polynomial order (must be 1, 2, or 3)
25 * @return std::pair<int, int> {LimStart, LimEnd} (both inclusive)
26 */
27 template <int dim>
28 inline std::pair<int, int> GetRecDOFRange(int pOrder)
29 {
30 DNDS_assert(pOrder >= 1 && pOrder <= 3);
31 int limStart = Geom::Base::GetNDof<dim>(pOrder - 1) - 1;
32 int limEnd = Geom::Base::GetNDof<dim>(pOrder) - 2;
33 return {limStart, limEnd};
34 }
36 using tCoeff = decltype(tCoeffPair::father);
38 using t3Vecs = decltype(t3VecsPair::father);
42 using t3Mat = decltype(t3MatPair::father);
43
45 using tVVec = decltype(tVVecPair::father);
47 using tMats = decltype(tMatsPair::father);
49 using tVecs = decltype(tVecsPair::father);
51 using tVMat = decltype(tVMatPair::father);
52
53 struct RecAtr
54 {
56 uint8_t Order = static_cast<uint8_t>(-1);
57 uint8_t NDOF = static_cast<uint8_t>(-1);
58 uint8_t NDIFF = static_cast<uint8_t>(-1);
59 uint8_t intOrder = 1;
60
61 static MPI_Datatype CommType()
62 {
63 //! TODO: make this not endian-sensitive: use static registering
64 static_assert(sizeof(RecAtr) <= 1ULL * 16);
65 return MPI_INT8_T;
66 }
67 static int CommMult() { return 16; }
68 static std::string pybind11_name() { return "RecAtr"; }
69 };
70
72 using tRecAtr = decltype(tRecAtrPair::father);
73}
74
75namespace DNDS::CFV
76{
77 // Corresponds to mean/rec dofs
78 template <int nVarsFixed>
80
81 template <int nVarsFixed>
83
84 template <int nVarsFixed, int gDim>
86
88 using tScalar = decltype(tScalarPair::father);
89}
90
91namespace DNDS
92{
93// DNDS_DEVICE_STORAGE_BASE_DELETER_INST(CFV::RecAtr, extern)
94// DNDS_DEVICE_STORAGE_INST(CFV::RecAtr, DeviceBackend::Host, extern)
95// #ifdef DNDS_USE_CUDA
96// DNDS_DEVICE_STORAGE_INST(CFV::RecAtr, DeviceBackend::CUDA, extern)
97// #endif
98}
Degree-of-freedom array with vector-space operations (MPI-collective).
Eigen-matrix array: each row is an Eigen::Map<Matrix> over contiguous real storage.
Batch of uniform-sized Eigen matrices per row, with variable batch count.
Eigen-vector array: each row is an Eigen::Map over contiguous real storage.
Core type aliases, constants, and metaprogramming utilities for the DNDS framework.
#define DNDS_assert(expr)
Debug-only assertion (compiled out when DNDS_NDEBUG is defined). Prints the expression + file/line + ...
Definition Errors.hpp:108
MPI wrappers: MPIInfo, collective operations, type mapping, CommStrategy.
Primary solver state container: an ArrayEigenMatrix pair with MPI-collective vector-space operations.
Definition ArrayDOF.hpp:172
decltype(t3VecsPair::father) t3Vecs
Definition VRDefines.hpp:38
decltype(tVecsPair::father) tVecs
Definition VRDefines.hpp:49
decltype(tVVecPair::father) tVVec
Definition VRDefines.hpp:45
decltype(tMatsPair::father) tMats
Definition VRDefines.hpp:47
decltype(tScalarPair::father) tScalar
Definition VRDefines.hpp:88
decltype(t3MatPair::father) t3Mat
Definition VRDefines.hpp:42
decltype(tVMatPair::father) tVMat
Definition VRDefines.hpp:51
decltype(tCoeffPair::father) tCoeff
Definition VRDefines.hpp:36
std::pair< int, int > GetRecDOFRange(int pOrder)
Returns the reconstruction DOF index range [start, end] (inclusive) for a given polynomial order with...
Definition VRDefines.hpp:28
Geom::tCoord t3Vec
Definition VRDefines.hpp:40
decltype(tRecAtrPair::father) tRecAtr
Definition VRDefines.hpp:72
DNDS::ArrayPair< DNDS::ArrayEigenVector< 3 > > tCoordPair
decltype(tCoordPair::father) tCoord
the host side operators are provided as implemented
DNDS_CONSTANT const real UnInitReal
Sentinel "not initialised" real value (NaN). Cheap to detect with std::isnan or IsUnInitReal; survive...
Definition Defines.hpp:174
double real
Canonical floating-point scalar used throughout DNDSR (double precision).
Definition Defines.hpp:105
ssp< DNDS::ArrayEigenVector< NonUniformSize > > father
Owned-side array (must be resized before ghost setup).
static std::string pybind11_name()
Definition VRDefines.hpp:68
static int CommMult()
Definition VRDefines.hpp:67
static MPI_Datatype CommType()
Definition VRDefines.hpp:61