30 auto &c = this->config_data = t_jsonconfig::object();
31 c[
"threadsPerBlock"] = 128;
32 c[
"pullAllInputArgs"] =
true;
33 c[
"serializeCUDAExecution"] =
false;
47 auto validate_keys_run = [](
const t_jsonconfig &user,
const t_jsonconfig &def,
const std::string &path,
auto &&validate_keys_runF)
49 if (!user.is_object() || !def.is_object())
51 for (
const auto &item : user.items())
53 const std::string &key = item.key();
55 if (!def.contains(key))
56 throw std::runtime_error(
57 "Invalid configuration key at path '" + path + key +
"'");
62 if (uval.is_object() && dval.is_object())
63 validate_keys_runF(uval, dval, path + key +
".", validate_keys_runF);
66 validate_keys_run(config_in, config_data,
"", validate_keys_run);
150 fv->mesh->PrintParallelVTKHDFDataArray(
158 { return arrCellCentScalar_names.at(i); },
161 return i < arrCellCentScalar_offset
162 ? uPrimCell->father->operator()(iC, 0)
163 : arrCellCentScalar.at(i - arrCellCentScalar_offset)->father->operator[](iC)(0);
166 { return arrCellCentVec_names.at(i); },
169 return i < arrCellCentVec_offset
170 ? uPrimCell->father->operator()(iC, iV + 1)
171 : arrCellCentVec.at(i - arrCellCentVec_offset)->father->operator[](iC)(iV);
174 { return arrNodeScalar_names.at(i); },
177 return i < arrNodeScalar_offset
178 ? uPrimNode->father->operator()(iN, 0)
179 : arrNodeScalar.at(i - arrNodeScalar_offset)->father->operator[](iN)(0);
182 { return arrNodeVec_names.at(i); },
185 return i < arrNodeVec_offset
186 ? uPrimNode->father->operator()(iN, iV + 1)
187 : arrNodeVec.at(i - arrNodeVec_offset)->father->operator[](iN)(iV);
224 else if (B == DeviceBackend::CUDA)
250 auto execute = [&](
auto b = std::integral_constant<DeviceBackend, DeviceBackend::Host>())
280 execute(std::integral_constant<DeviceBackend, DeviceBackend::Host>());
283 else if (B == DeviceBackend::CUDA)
285 execute(std::integral_constant<DeviceBackend, DeviceBackend::CUDA>());
327 execute(std::integral_constant<DeviceBackend, DeviceBackend::Host>());
330 else if (B == DeviceBackend::CUDA)
332 execute(std::integral_constant<DeviceBackend, DeviceBackend::CUDA>());
351 auto execute = [&](
auto b = std::integral_constant<DeviceBackend, DeviceBackend::Host>())
373 execute(std::integral_constant<DeviceBackend, DeviceBackend::Host>());
376 else if (B == DeviceBackend::CUDA)
378 execute(std::integral_constant<DeviceBackend, DeviceBackend::CUDA>());
396 auto execute = [&](
auto b = std::integral_constant<DeviceBackend, DeviceBackend::Host>())
407 execute(std::integral_constant<DeviceBackend, DeviceBackend::Host>());
410 else if (B == DeviceBackend::CUDA)
412 execute(std::integral_constant<DeviceBackend, DeviceBackend::CUDA>());
433 auto execute = [&](
auto b = std::integral_constant<DeviceBackend, DeviceBackend::Host>())
439 for (
auto &
uS :
arg.uScalar)
440 uS->trans.waitPersistentPull();
441 for (
auto &
uS :
arg.uScalarPrim)
442 uS->trans.waitPersistentPull();
443 for (
auto &
uS :
arg.uScalarGrad)
444 uS->trans.waitPersistentPull();
445 for (
auto &
uS :
arg.uScalarGradPrim)
446 uS->trans.waitPersistentPull();
457 execute(std::integral_constant<DeviceBackend, DeviceBackend::Host>());
460 else if (B == DeviceBackend::CUDA)
462 execute(std::integral_constant<DeviceBackend, DeviceBackend::CUDA>());
Helpers for shipping an array-of-views (e.g., ArrayDeviceView) to the device in one contiguous buffer...
Device memory abstraction layer with backend-specific storage and factory creation.
Assertion / error-handling macros and supporting helper functions.
#define DNDS_check_throw(expr)
Runtime check active in both debug and release builds. Throws std::runtime_error if expr evaluates to...
Core type definitions and utilities for the EulerP alternative Navier-Stokes evaluator module.
Main evaluator class for the EulerP compressible Navier-Stokes solver module.
Backend-specific implementation layer for EulerP Evaluator kernel dispatch.
EvaluatorConfig()
Constructs the config with default values (threadsPerBlock=128, etc.).
void valid_patch_keys(const t_jsonconfig &config_in)
Validates that all keys in config_in exist in the current defaults.
void RecGradient(RecGradient_Arg &arg)
Performs Green-Gauss gradient reconstruction with Barth-Jespersen limiting.
void Flux2nd(Flux2nd_Arg &arg)
Evaluates 2nd-order inviscid (Roe) flux and accumulates into the cell RHS residual.
DeviceBackend device()
Queries and validates the device backend across all sub-objects.
void PrintDataVTKHDF(std::string fname, std::string series_name, std::vector< ssp< TUScalar > > &arrCellCentScalar, const std::vector< std::string > &arrCellCentScalar_names_in, std::vector< ssp< TUVec > > &arrCellCentVec, const std::vector< std::string > &arrCellCentVec_names_in, std::vector< ssp< TUScalar > > &arrNodeScalar, const std::vector< std::string > &arrNodeScalar_names_in, std::vector< ssp< TUVec > > &arrNodeVec, const std::vector< std::string > &arrNodeVec_names_in, ssp< TUDof > uPrimCell, ssp< TUDof > uPrimNode, double t)
Writes cell-centered and node-centered field data to a VTK-HDF5 file.
void PrepareFaceBuffer(int nVarsScalar)
Prepares all face buffers (DOF + scalars) for left and right states.
void EstEigenDt(EstEigenDt_Arg &arg)
Estimates per-face eigenvalues and computes per-cell local time steps.
void Cons2Prim(Cons2Prim_Arg &arg)
Converts conservative variables to primitive variables (no gradients or viscosity).
t_fv fv
Shared pointer to the Compact Finite Volume (VFV) reconstruction object.
void RecFace2nd(RecFace2nd_Arg &arg)
Performs 2nd-order face value reconstruction from cell-centered data.
void Cons2PrimMu(Cons2PrimMu_Arg &arg)
Converts conservative variables to primitive variables and computes viscosity.
Namespace for the EulerP alternative evaluator module with GPU support.
DeviceBackend
Enumerates the backends a DeviceStorage / Array can live on.
@ Unknown
Unset / sentinel.
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).
nlohmann::ordered_json t_jsonconfig
Project-wide JSON type alias: nlohmann/json with ordered keys.
Packed argument struct for conservative-to-primitive conversion with viscosity computation.
void Validate(Evaluator &self)
Validates all member arrays against the mesh topology and device backend.
Packed argument struct for conservative-to-primitive conversion without gradients or viscosity.
void Validate(Evaluator &self)
Validates all member arrays against the mesh topology and device backend.
Packed argument struct for eigenvalue estimation and local time-step computation.
void Validate(Evaluator &self)
Validates all member arrays, distinguishing cell-located from face-located fields.
Packed argument struct for 2nd-order inviscid (and eventually viscous) flux evaluation.
void Validate(Evaluator &self)
Validates member arrays, auto-detecting cell vs. face location by name suffix.
Packed argument struct for 2nd-order face value reconstruction.
void Validate(Evaluator &self)
Validates member arrays, auto-detecting cell vs. face location by name suffix.
Packed argument struct for Green-Gauss gradient reconstruction with Barth-Jespersen limiting.
void Validate(Evaluator &self)
Validates all member arrays against the mesh topology and device backend.
Non-trivially-copyable device view holding shared_ptr to fv and device views of BC/physics.
Device-side argument struct for conservative-to-primitive + viscosity kernel.
Device-side argument struct for conservative-to-primitive conversion (no gradients/viscosity).
Device-side argument struct for eigenvalue estimation and time-step computation.
Device-side argument struct for 2nd-order flux evaluation and RHS accumulation.
Device-side argument struct for 2nd-order face value reconstruction.
Device-side argument struct for gradient reconstruction kernels.
static void Flux2nd(Flux2nd_Arg &arg)
Evaluates 2nd-order Roe flux per face and scatters to cell RHS.
static void Cons2PrimMu(Cons2PrimMu_Arg &arg)
Executes conservative-to-primitive conversion with viscosity computation.
static void EstEigenDt_GetFaceLam(EstEigenDt_Arg &arg)
First pass: computes per-face eigenvalue estimates from cell states.
static void Cons2Prim(Cons2Prim_Arg &arg)
Executes conservative-to-primitive conversion (no gradients/viscosity).
static void EstEigenDt_FaceLam2CellDt(EstEigenDt_Arg &arg)
Second pass: accumulates face eigenvalues to cells and computes local dt.
static void RecFace2nd(RecFace2nd_Arg &arg)
Executes 2nd-order face value reconstruction from cell-centered data.
static void RecGradient_BarthLimiter(RecGradient_Arg &arg)
Barth-Jespersen gradient limiter applied to reconstructed gradients.
static void RecGradient_GGRec(RecGradient_Arg &arg)
Green-Gauss gradient reconstruction: boundary ghost values + cell gradient computation.