32 struct PartitionOptions;
70 return std::make_tuple(
88 return std::make_tuple(
108 return std::make_tuple(
118 return std::make_tuple(
183 std::vector<Geom::NodeIndexPBI>
ret;
195 std::vector<Geom::NodeIndexPBI>
ret;
218 template <
class TPair>
226 auto result = pair.trans.pLGhostMapping->search_indexAppend(
iGlobal, rank, val);
238 template <
class TPair>
247 return pair.trans.pLGhostMapping->operator()(-1,
iLocal);
256 template <
class TPair>
264 if (
iLocal >= pair.father->Size())
266 return pair.father->pLGlobalMapping->operator()(
mpi.
rank,
iLocal);
275 template <
class TPair>
281 auto [
ret, rank, val] = pair.father->pLGlobalMapping->search(
iGlobal);
331 template <
class TAdj,
class TFn>
356 template <
class TPair,
class TFn>
360 auto tmp = std::make_shared<TArr>(*pair.father);
361 if constexpr (TPair::IsCSR())
362 pair.father->Decompress();
366 if constexpr (TPair::IsCSR())
367 pair.father->ResizeRow(
iNew,
tmp->RowSize(i));
369 pair(
iNew,
j) = (*tmp)(i,
j);
371 if constexpr (TPair::IsCSR())
372 pair.father->Compress();
376 const tPoint &translation1,
379 const tPoint &translation2,
382 const tPoint &translation3,
505 template <
class tC2n>
508 cs.resize(Eigen::NoChange,
c2n.size());
521 template <
class tC2n,
class tCoordExt>
524 cs.resize(Eigen::NoChange,
c2n.size());
537 template <
class tC2n,
class tC2nPbi>
540 cs.resize(Eigen::NoChange,
c2n.size());
553 template <
class tC2n,
class tC2nPbi,
class tCoordExt>
556 cs.resize(Eigen::NoChange,
c2n.size());
644 template <
class FA,
class FB,
class F0 = std::function<
void(
void)>>
693 const std::string &name,
696 template <
class TFTrans>
767 template <
typename F>
776 template <DeviceBackend B>
779 template <DeviceBackend B>
791 bytes +=
v.ref.father->FullSizeBytes();
793 bytes +=
v.ref.son->FullSizeBytes();
852 int ascii_precision{16};
853 std::string vtuFloatEncodeMode =
"ascii";
923 template <
class tC2n,
class tCoordExt>
926 cs.resize(Eigen::NoChange, c2n.size());
927 for (
rowsize i = 0; i < c2n.size(); i++)
929 index iNode = c2n[i];
930 cs(EigenAll, i) = coo->operator[](iNode);
937 template <
class tC2n,
class tC2nPbi,
class tCoordExt>
940 cs.resize(Eigen::NoChange, c2n.size());
941 for (
rowsize i = 0; i < c2n.size(); i++)
943 index iNode = c2n[i];
944 cs(EigenAll, i) =
mesh->periodicInfo.GetCoordByBits(coo->operator[](iNode), c2nPbi[i]);
952 if (!
mesh->isPeriodic)
976 AutoAppendName2ID appended_name2id;
978 return appended_name2id;
1040 int arraySiz,
int arraySizPoint,
1045 double t,
int flag);
1052 std::string fname, std::string seriesName,
1053 int arraySiz,
int vecArraySiz,
int arraySizPoint,
int vecArraySizPoint,
1062 double t,
int flag = 0);
1067 vtuFloatEncodeMode =
v;
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.
pybind11-style configuration registration with macro-based field declaration and namespace-scoped tag...
#define DNDS_FIELD(name_, desc_,...)
Register a field inside a DNDS_DECLARE_CONFIG body.
Device memory abstraction layer with backend-specific storage and factory creation.
CRTP mixin that provides uniform to_device/to_host/device/getDeviceArrayBytes for classes that enumer...
#define DNDS_assert_info(expr, info)
Debug-only assertion with an extra std::string info message.
#define DNDS_assert(expr)
Debug-only assertion (compiled out when DNDS_NDEBUG is defined). Prints the expression + file/line + ...
#define DNDS_check_throw_info(expr, info)
Same as DNDS_check_throw but attaches a user-supplied info message to the thrown std::runtime_error.
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.
CRTP mixin giving a class uniform to_device / to_host / device / getDeviceArrayBytes methods.
EnumValuesTag enum_values(std::vector< std::string > vals)
Create an enum allowed-values tag.
RangeTag range(double min)
Create a minimum-only range constraint.
decltype(tAdj1Pair::father) tAdj1
std::function< std::string(int)> tFGetName
tFGetData tFDataFieldQuery
@ SerialReadAndDistribute
std::function< std::string(int)> tFDataFieldName
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
DNDS::ssp< DNDS::ParArray< ElemInfo > > tElemInfoArray
std::function< std::string(t_index)> t_FBCID_2_Name
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)
std::function< t_index(const std::string &)> t_FBCName_2_ID
decltype(tPbiPair::father) tPbi
decltype(tCoordPair::father) tCoord
std::vector< std::vector< index > > tLocalMatStruct
void AllreduceOneIndex(index &v, MPI_Op op, const MPIInfo &mpi)
Single-scalar Allreduce helper for indices (in-place, count = 1).
ssp< SerializerBase > SerializerBaseSSP
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.
void for_each_member_list(TList &&obj_member_list, F &&f)
Invoke f(member) for every element of a std::tuple of members.
double real
Canonical floating-point scalar used throughout DNDSR (double precision).
int MPI_int
MPI counterpart type for MPI_int (= C int). Used for counts and ranks in MPI calls.
ssp< TArray > father
Owned-side array (must be resized before ghost setup).
index Size() const
Combined row count (father->Size() + son->Size()).
ssp< TArray > son
Ghost-side array (sized automatically by createMPITypes / BorrowAndPull).
DNDS_DECLARE_CONFIG(PartitionOptions)
DNDS_DEVICE_CALLABLE auto GetVectorByBits(const Eigen::Matrix< real, dim, nVec > &v, const NodePeriodicBits &bits)
DNDS_DEVICE_CALLABLE tPoint GetCoordByBits(const tPoint &c, const NodePeriodicBits &bits) const
void SetASCIIPrecision(int n)
void MeshPartitionCell2Cell(const PartitionOptions &options)
void GetCoordsOnCellSerial(index iCell, tSmallCoords &cs, tCoord &coo)
analog of mesh's method
DNDS::ArrayTransformerType< tCoord::element_type >::Type coordSerialOutTrans
void GetCurrentOutputArrays(int flag, tCoordPair &coordOut, tAdjPair &cell2nodeOut, tPbiPair &cell2nodePbiOut, tElemInfoArrayPair &cellElemInfoOut, index &nCell, index &nNode)
void ReadFromOpenFOAMAndConvertSerial(const std::string &fName, const std::map< std::string, std::string > &nameMapping, const t_FBCName_2_ID &FBCName_2_ID=FBC_Name_2_ID_Default)
DNDS::ArrayTransformerType< tElemInfoArray::element_type >::Type cellElemInfoSerialOutTrans
void ReadFromCGNSSerial(const std::string &fName, const t_FBCName_2_ID &FBCName_2_ID)
reads a cgns file as serial input
void BuildSerialOut()
should be called to build data for serial out
DNDS::ArrayTransformerType< tAdj::element_type >::Type cell2nodeSerialOutTrans
void SetVTKFloatEncodeMode(const std::string &v)
tAdj cell2cellSerialFacial
tElemInfoArray bndElemInfoSerial
DNDS::ssp< UnstructuredMesh > mesh
void PartitionReorderToMeshCell2Cell()
void PrintSerialPartVTKDataArray(std::string fname, std::string seriesName, int arraySiz, int vecArraySiz, int arraySizPoint, int vecArraySizPoint, const tFGetName &names, const tFGetData &data, const tFGetName &vectorNames, const tFGetVecData &vectorData, const tFGetName &namesPoint, const tFGetData &dataPoint, const tFGetName &vectorNamesPoint, const tFGetVecData &vectorDataPoint, double t, int flag=0)
names(idata) data(idata, ivolume)
DNDS::ArrayTransformerType< tPbi::element_type >::Type cell2nodePbiSerialOutTrans
UnstructuredMeshSerialRW(const decltype(mesh) &n_mesh, DNDS::MPI_int n_mRank)
DNDS::ArrayTransformerType< tAdj::element_type >::Type bnd2nodeSerialOutTrans
DNDS::ArrayTransformerType< tElemInfoArray::element_type >::Type bndElemInfoSerialOutTrans
auto ReadFromCGNSSerial(const std::string &fName)
void PrintSerialPartPltBinaryDataArray(std::string fname, int arraySiz, int arraySizPoint, const tFGetName &names, const tFGetData &data, const tFGetName &namesPoint, const tFGetData &dataPoint, double t, int flag)
names(idata) data(idata, ivolume) https://tecplot.azureedge.net/products/360/current/360_data_format_...
void BuildCell2Cell()
build cell2cell topology, with node-neighbors included
std::vector< DNDS::MPI_int > cellPartition
void __GetCoordsSerial(const tC2n &c2n, tSmallCoords &cs, tCoordExt &coo)
directly load coords; gets faulty if isPeriodic!, analog of mesh's method
void __GetCoordsOnElemSerial(const tC2n &c2n, const tC2nPbi &c2nPbi, tSmallCoords &cs, tCoordExt &coo)
specially for periodicity, analog of mesh's method
std::vector< DNDS::MPI_int > bndPartition
tAdj1 node2nodeOrigSerial
tAdj1 cell2cellOrigSerial
void Deduplicate1to1Periodic(real searchEps=1e-8)
tElemInfoArray cellElemInfoSerial
std::vector< DNDS::MPI_int > nodePartition
RBF::RBFKernelType kernel
DNDS_DECLARE_CONFIG(WallDistOptions)
index NumFaceGhost() const
tCoordPair nodeWallDist
wall dist:
void AdjLocal2GlobalN2CB()
UnstructuredMeshDeviceView< B > t_deviceView
void __GetCoordsOnElem(const tC2n &c2n, const tC2nPbi &c2nPbi, tSmallCoords &cs)
specially for periodicity
index BndIndexGlobal2Local_NoSon(index i)
index NodeIndexGlobal2Local_NoSon(index i)
auto device_array_list_facial()
tCoordPair coordsPeriodicRecreated
auto device_array_list_primary()
Elem::Element GetCellElement(index iC)
void RecreatePeriodicNodes()
tPbiPair cell2nodePbi
periodic only, after reader
UnstructuredMesh(const DNDS::MPIInfo &n_mpi, int n_dim)
tCoordPair coordsElevDisp
only elevation
void ElevatedNodesSolveInternalSmooth()
std::unordered_map< index, index > face2bndM
void GetCoordsOnCell(index iCell, tSmallCoords &cs, tCoordPair &coo)
void __GetCoords(const tC2n &c2n, tSmallCoords &cs)
directly load coords; gets faulty if isPeriodic!
index NumNodeProc() const
index CellIndexLocal2Global_NoSon(index i)
tPbiPair face2nodePbi
periodic only, after interpolated
std::vector< index > node2bndNode
void BuildGhostPrimary()
building ghost (son) from primary (currently only cell2cell)
tPoint GetCoordNodeOnFace(index iFace, rowsize if2n)
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
index NumNodeGhost() const
void AdjGlobal2LocalN2CB()
std::vector< index > cell2parentCell
void GetCoordsOnCell(index iCell, tSmallCoords &cs)
void AdjLocal2GlobalC2F()
auto device_array_list_C2F()
void AdjGlobal2LocalPrimaryForBnd()
std::vector< uint8_t > vtkCellType
MeshAdjState adjC2CFaceState
std::vector< index > node2parentNode
parent built
auto getBnd2NodeIndexPbiRow(index iBnd)
tAdjPair cell2nodePeriodicRecreated
index LocalPartStart(int iPart) const
index NumCellProc() const
index NodeIndexLocal2Global_NoSon(index i)
void AdjLocal2GlobalFacial()
index NodeIndexGlobal2Local(DNDS::index i)
void AdjGlobal2LocalPrimary()
void ElevatedNodesSolveInternalSmoothV1Old()
tLocalMatStruct cell2cellFaceVLocalParts
for cell local factorization
std::vector< index > vtkCell2nodeOffsets
for parallel out
void ElevatedNodesGetBoundarySmooth(const std::function< bool(t_index)> &FiFBndIdNeedSmooth)
index BndIndexLocal2Global_NoSon(index i)
index CellIndexGlobal2Local(DNDS::index i)
tLocalMatStruct GetCell2CellFaceVLocal(bool onLocalPartition=false)
void ElevatedNodesSolveInternalSmoothV1()
index IndexGlobal2Local(TPair &pair, DNDS::index iGlobal)
Global-to-local conversion using father+son ghost mapping.
void RecoverNode2CellAndNode2Bnd()
only requires father part of cell2node, bnd2node and coords generates node2cell and node2bnd (father ...
MeshAdjState adjN2CBState
void for_each_device_member(F &&f)
void ReorderLocalCells(int nParts=1, int nPartsInner=1)
index IndexLocal2Global_NoSon(TPair &pair, index iLocal)
Local-to-global conversion using only the father's global mapping (no son / ghost layer).
void op_on_device_arrays(F &&f)
index NumFaceProc() const
void AdjGlobal2LocalC2F()
struct DNDS::Geom::UnstructuredMesh::HDF5OutSetting hdf5OutSetting
void BuildBisectO1FormO2(UnstructuredMesh &meshO2)
void GetCoordsOnFace(index iFace, tSmallCoords &cs)
void SetHDF5OutSetting(size_t chunkSiz, int deflateLevel, bool coll_on_data, bool coll_on_meta)
tPoint GetCoordNodeOnCell(index iCell, rowsize ic2n)
void ReadSerialize(Serializer::SerializerBaseSSP serializerP, const std::string &name)
void PrintParallelVTKHDFDataArray(std::string fname, std::string seriesName, int arraySiz, int vecArraySiz, int arraySizPoint, int vecArraySizPoint, const tFGetName &names, const tFGetData &data, const tFGetName &vectorNames, const tFGetVecData &vectorData, const tFGetName &namesPoint, const tFGetData &dataPoint, const tFGetName &vectorNamesPoint, const tFGetVecData &vectorDataPoint, double t, MPI_Comm commDup)
auto getCell2NodeIndexPbiRow(index iCell)
tAdjPair cell2cellFace
constructed on demand
index CellIndexGlobal2Local_NoSon(index i)
bool CellIsFaceBack(index iCell, index iFace) const
t_index GetFaceZone(index iF)
Elem::Element GetBndElement(index iB)
index BndIndexLocal2Global(DNDS::index i)
void ElevatedNodesSolveInternalSmoothV2()
tAdjPair node2cell
inverse relations
std::vector< index > bnd2faceV
Elem::Element GetFaceElement(index iF)
index CellIndexLocal2Global(DNDS::index i)
index IndexLocal2Global(TPair &pair, DNDS::index iLocal)
Local-to-global conversion using father+son ghost mapping.
void AdjLocal2GlobalPrimary()
MeshAdjState adjPrimaryState
void ObtainSymmetricSymbolicFactorization(Direct::SerialSymLUStructure &symLU, Direct::DirectPrecControl control) const
void __GetCoords(const tC2n &c2n, tSmallCoords &cs, tCoordExt &coo)
directly load coords; gets faulty if isPeriodic!
index CellFaceOther(index iCell, index iFace) const
tElemInfoArrayPair faceElemInfo
void SetPeriodicGeometry(const tPoint &translation1, const tPoint &rotationCenter1, const tPoint &eulerAngles1, const tPoint &translation2, const tPoint &rotationCenter2, const tPoint &eulerAngles2, const tPoint &translation3, const tPoint &rotationCenter3, const tPoint &eulerAngles3)
void BuildCell2CellFace()
struct DNDS::Geom::UnstructuredMesh::ElevationInfo elevationInfo
void AdjGlobal2LocalC2CFace()
std::vector< index > localPartitionStarts
void __GetCoordsOnElem(const tC2n &c2n, const tC2nPbi &c2nPbi, tSmallCoords &cs, tCoordExt &coo)
specially for periodicity
MeshAdjState adjFacialState
index BndIndexGlobal2Local(DNDS::index i)
void BuildO2FromO1Elevation(UnstructuredMesh &meshO1)
void RecoverCell2CellAndBnd2Cell()
needs to use RecoverNode2CellAndNode2Bnd before doing this. Requires node2cell.father and builds a ve...
void WriteSerialize(Serializer::SerializerBaseSSP serializerP, const std::string &name)
tElemInfoArrayPair cellElemInfo
void ObtainLocalFactFillOrdering(Direct::SerialSymLUStructure &symLU, Direct::DirectPrecControl control)
void PrintMeshCGNS(std::string fname, const t_FBCID_2_Name &fbcid2name, const std::vector< std::string > &allNames)
static void ConvertAdjEntries(TAdj &adj, index nRows, TFn &&fn)
Apply a conversion function to every entry of an adjacency array's first nRows rows.
index NumCellGhost() const
index vtkCell2NodeGlobalSiz
index NumBndGhost() const
void AdjLocal2GlobalC2CFace()
void ReadSerializeAndDistribute(Serializer::SerializerBaseSSP serializerP, const std::string &name, const PartitionOptions &partitionOptions)
Reads mesh from an H5 serializer using even-split distribution, then repartitions via ParMetis for lo...
static void PermuteRows(TPair &pair, index nRows, TFn &&old2new)
Permute the father rows of an ArrayPair according to a mapping function.
index LocalPartEnd(int iPart) const
void AdjGlobal2LocalFacial()
tPoint GetCoordWallDistOnFace(index iFace, rowsize if2n)
t_index GetCellZone(index iC)
index IndexGlobal2Local_NoSon(TPair &pair, index iGlobal)
Global-to-local conversion using only the father's global mapping (no son / ghost layer).
void ConstructBndMesh(UnstructuredMesh &bMesh)
tElemInfoArrayPair bndElemInfo
void AdjLocal2GlobalPrimaryForBnd()
void BuildVTKConnectivity()
tPoint GetCoordWallDistOnCell(index iCell, rowsize ic2n)
t_index GetBndZone(index iB)
auto device_array_list_N2CB()
MeshElevationState elevState
void BuildNodeWallDist(const std::function< bool(Geom::t_index)> &fBndIsWall, WallDistOptions options=WallDistOptions{})
index NodeIndexLocal2Global(DNDS::index i)
tAdjPair cell2face
interpolated
std::vector< index > vtkCell2node
std::vector< index > nodeRecreated2nodeLocal
void TransformCoords(TFTrans &&FTrans)
Lightweight bundle of an MPI communicator and the calling rank's coordinates.
int rank
This rank's 0-based index within comm (-1 until initialised).
Eigen::Matrix< real, 5, 1 > v
Eigen::Vector3d n(1.0, 0.0, 0.0)