73 template <EulerModel model>
76 int nVars = getNVars(model);
111 ArrayRECV<nVarsFixed> uRec, uRecLimited, uRecNew, uRecNew1, uRecOld, uRec1, uRecInc, uRecInc1, uRecB, uRecB1;
114 ArrayDOFV<1> alphaPP, alphaPP1, betaPP, betaPP1, alphaPP_tmp, dTauTmp;
120 ssp<ArrayEigenVector<Eigen::Dynamic>> outDist;
121 ssp<ArrayEigenVector<Eigen::Dynamic>> outSerial;
122 ArrayTransformerType<ArrayEigenVector<Eigen::Dynamic>>::Type outDist2SerialTrans;
124 ssp<ArrayEigenVector<Eigen::Dynamic>> outDistPoint;
125 ssp<ArrayEigenVector<Eigen::Dynamic>> outGhostPoint;
126 ssp<ArrayEigenVector<Eigen::Dynamic>> outSerialPoint;
127 ArrayTransformerType<ArrayEigenVector<Eigen::Dynamic>>::Type outDist2SerialTransPoint;
128 ArrayPair<ArrayEigenVector<Eigen::Dynamic>> outDistPointPair;
129 static const int maxOutFutures{3};
130 std::mutex outArraysMutex;
131 std::array<std::future<void>, maxOutFutures> outFuture;
133 ssp<ArrayEigenVector<Eigen::Dynamic>> outDistBnd;
135 ssp<ArrayEigenVector<Eigen::Dynamic>> outSerialBnd;
136 ArrayTransformerType<ArrayEigenVector<Eigen::Dynamic>>::Type outDist2SerialTransBnd;
138 std::mutex outBndArraysMutex;
139 std::array<std::future<void>, maxOutFutures> outBndFuture;
140 std::future<void> outSeqFuture;
145 ssp<BoundaryHandler<model>> pBCHandler;
218 config.field_json(&T::odeSettingsExtra,
"odeSettingsExtra",
"Extra ODE integrator settings (opaque JSON)");
312 "=== Step {termBold}[{step:4d}] ",
313 "res {termBold}{termRed}{resRel:.3e}{termReset} ",
314 "t,dT,dTaumin,CFL,nFix {termGreen}[{tSimu:.3e},{curDtImplicit:.3e},{curDtMin:.3e},{CFLNow:.3e},[alphaInc({nLimInc},{alphaMinInc}), betaRec({nLimBeta},{minBeta}), alphaRes({nLimAlpha},{minAlpha})]]{termReset} ",
315 "Time[{telapsed:.3f}] recTime[{trec:.3f}] rhsTime[{trhs:.3f}] commTime[{tcomm:.3f}] limTime[{tLim:.3f}] limTimeA[{tLimiterA:.3f}] limTimeB[{tLimiterB:.3f}]"};
317 "\t Internal === Step [{step:4d},{iStep:2d},{iter:4d}] ",
318 "res {termRed}{resRel:.3e}{termReset} ",
319 "t,dT,dTaumin,CFL,nFix {termGreen}[{tSimu:.3e},{curDtImplicit:.3e},{curDtMin:.3e},{CFLNow:.3e},[alphaInc({nLimInc},{alphaMinInc:.3g}), betaRec({nLimBeta},{minBeta:.3g}), alphaRes({nLimAlpha},{minAlpha:.3g})]]{termReset} ",
320 "Time[{telapsedM:.3f}] recTime[{trecM:.3f}] rhsTime[{trhsM:.3f}] commTime[{tcommM:.3f}] limTime[{tLimM:.3f}] limTimeA[{tLimiterA:.3f}] limTimeB[{tLimiterB:.3f}]"};
322 "step",
"iStep",
"iterAll",
"iter",
"tSimu",
323 "res",
"curDtImplicit",
"curDtMin",
"CFLNow",
324 "nLimInc",
"alphaMinInc",
325 "nLimBeta",
"minBeta",
326 "nLimAlpha",
"minAlpha",
327 "tWall",
"telapsed",
"trec",
"trhs",
"tcomm",
"tLim",
"tLimiterA",
"tLimiterB",
328 "fluxWall",
"CL",
"CD",
"AoA"};
489 std::string
meshFile =
"data/mesh/NACA0012_WIDE_H3.cgns";
588 config.field_section(&T::restartWriter,
"restartWriter",
"Restart file serializer settings");
589 config.field_section(&T::meshPartitionedWriter,
"meshPartitionedWriter",
"Partitioned mesh serializer settings");
763 config.template field_map_of<CoarseGridLinearSolverControl>(
764 &T::coarseGridLinearSolverControlList,
765 "coarseGridLinearSolverControlList",
766 "Per-level coarse grid linear solver settings");
767 config.field_section(&T::directPrecControl,
"directPrecControl",
768 "Direct preconditioner settings");
829 config.field_section(&T::recMatrixWriter,
"recMatrixWriter",
830 "Serializer for reconstruction matrix output");
836 nlohmann::ordered_json
bcSettings = nlohmann::ordered_json::array();
841 config.field_section(&T::timeMarchControl,
"timeMarchControl",
"Time marching settings");
842 config.field_section(&T::implicitReconstructionControl,
"implicitReconstructionControl",
"Implicit reconstruction settings");
843 config.field_section(&T::outputControl,
"outputControl",
"Output settings");
844 config.field_section(&T::implicitCFLControl,
"implicitCFLControl",
"Implicit CFL settings");
845 config.field_section(&T::convergenceControl,
"convergenceControl",
"Convergence monitoring settings");
846 config.field_section(&T::dataIOControl,
"dataIOControl",
"Data I/O and restart settings");
847 config.field_section(&T::boundaryDefinition,
"boundaryDefinition",
"Periodic boundary geometry");
848 config.field_section(&T::limiterControl,
"limiterControl",
"Slope limiter settings");
849 config.field_section(&T::linearSolverControl,
"linearSolverControl",
"Linear solver settings");
850 config.field_section(&T::timeAverageControl,
"timeAverageControl",
"Time averaging settings");
851 config.field_section(&T::others,
"others",
"Miscellaneous settings");
852 config.field_section(&T::restartState,
"restartState",
"Restart checkpoint state");
853 config.field_section(&T::eulerSettings,
"eulerSettings",
"Euler evaluator physics settings");
854 config.field_section(&T::vfvSettings,
"vfvSettings",
"Variational reconstruction settings");
855 config.field_json_schema(&T::bcSettings,
"bcSettings",
856 "Boundary condition settings (per-BC array)",
860 config.check(
"bcSettings must be a JSON array", [](
const T &s)
862 return s.bcSettings.is_array();
907 DNDS_assert_info(nVars == getNVars(model),
"do not change the nVars for this model");
909 nOUTSPoint = nVars + 2;
910 nOUTSBnd = nVars + 2 + nVars + 3 + 1 + 3;
922 for (
auto &f : outFuture)
923 if (f.valid() && f.wait_for(std::chrono::microseconds(10)) != std::future_status::ready)
925 for (
auto &f : outBndFuture)
926 if (f.valid() && f.wait_for(std::chrono::microseconds(10)) != std::future_status::ready)
928 if (outSeqFuture.valid() && outSeqFuture.wait_for(std::chrono::microseconds(10)) != std::future_status::ready)
947 void ConfigureFromJson(
const std::string &jsonName,
bool read =
false,
const std::string &jsonMergeName =
"",
948 const std::vector<std::string> &overwriteKeys = {},
const std::vector<std::string> &overwriteValues = {})
952 auto fIn = std::ifstream(jsonName);
954 gSetting = nlohmann::ordered_json::parse(fIn,
nullptr,
true,
true);
956 if (read && !jsonMergeName.empty())
958 fIn = std::ifstream(jsonMergeName);
960 auto gSettingAdd = nlohmann::ordered_json::parse(fIn,
nullptr,
true,
true);
963 DNDS_assert(overwriteKeys.size() == overwriteValues.size());
964 for (
size_t i = 0; i < overwriteKeys.size(); i++)
967 auto key = nlohmann::ordered_json::json_pointer(overwriteKeys[i].c_str());
970 std::string valString =
975 auto valDoc = nlohmann::ordered_json::parse(valString,
nullptr,
true,
true);
977 log() <<
"JSON: overwrite key: " << key << std::endl
978 <<
"JSON: overwrite val: " << valDoc[
"__val_entry"] << std::endl;
979 gSetting[key] = valDoc[
"__val_entry"];
981 catch (
const nlohmann::ordered_json::parse_error &e)
985 std::string valString =
990 auto valDoc = nlohmann::ordered_json::parse(valString,
nullptr,
true,
true);
992 log() <<
"JSON: overwrite key: " << key << std::endl
993 <<
"JSON: overwrite val: " << valDoc[
"__val_entry"] << std::endl;
994 gSetting[key] = valDoc[
"__val_entry"];
996 catch (
const std::exception &e)
998 std::cerr << e.what() <<
"\n";
999 std::cerr << overwriteValues[i] <<
"\n";
1003 catch (
const std::exception &e)
1005 std::cerr << e.what() <<
"\n";
1006 std::cerr << overwriteValues[i] <<
"\n";
1012 pBCHandler = std::make_shared<BoundaryHandler<model>>(nVars);
1014 gSetting[
"bcSettings"] = *pBCHandler;
1017 log() <<
"JSON: read value:" << std::endl
1018 << std::setw(4) <<
gSetting << std::endl;
1022 gSetting = nlohmann::ordered_json::object();
1025 gSetting[
"bcSettings"] = *pBCHandler;
1028 std::filesystem::path outFile{jsonName};
1029 std::filesystem::create_directories(outFile.parent_path() /
".");
1030 auto fIn = std::ofstream(jsonName);
1038 log() <<
"JSON: Parse " << (read ?
"read" :
"write")
1039 <<
" Done ===" << std::endl;
1083 std::filesystem::path outFile{logConfigFileName};
1084 std::filesystem::create_directories(outFile.parent_path() /
".");
1085 std::ofstream logConfig(logConfigFileName);
1087 gSetting[
"___Compile_Time_Defines"] = DNDS_Defines_state;
1088 gSetting[
"___Runtime_PartitionNumber"] = mpi.size;
1100 logConfig << std::setw(4) <<
gSetting;
1137 void PrintData(
const std::string &fname,
const std::string &fnameSeries,
1145 auto cwd = serializerP->GetCurrentPath();
1146 serializerP->CreatePath(name);
1147 serializerP->GoToPath(name);
1151 serializerP->GoToPath(cwd);
1153 nlohmann::ordered_json configJson;
1155 serializerP->WriteString(
"lastConfig", configJson.dump());
1159 serializerP->WriteInt(
"hasReconstructionValue", 1);
1163 serializerP->WriteInt(
"hasReconstructionValue", 0);
1167 template <
class TVal>
1168 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<TVal>>>
1175 template <
class TVal>
1176 std::enable_if_t<!std::is_arithmetic_v<std::remove_reference_t<TVal>>>
1187 if (name ==
"res" || name ==
"fluxWall")
1188 for (
int i = 0; i < nVars; i++)
1189 v_map[name + std::to_string(i)] = val[i];
1200 initVec.setZero(nVars);
1201 std::vector<std::string> realNames;
1203 if (name ==
"res" || name ==
"fluxWall")
1206 for (
int i = 0; i < nVars; i++)
1207 realNames.push_back(name + std::to_string(i));
1210 FillLogValue(v_map, name, 0.), realNames.push_back(name);
1218 return std::make_tuple(std::make_unique<DNDS::CsvLog>(
1298#define DNDS_EULERSOLVER_RUNNINGENV_GET_REF(name) auto &name = runningEnvironment.name
1300#define DNDS_EULERSOLVER_RUNNINGENV_GET_REF_LIST \
1301 auto &eval = *runningEnvironment.pEval; \
1302 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(logErr); \
1303 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(ode); \
1304 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(gmres); \
1305 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(gmresRec); \
1306 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(pcgRec); \
1307 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(pcgRec1); \
1308 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(tstart); \
1309 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(tstartInternal); \
1310 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(tInternalStats); \
1311 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(stepCount); \
1312 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(resBaseC); \
1313 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(resBaseCInternal); \
1314 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(tSimu); \
1315 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(tAverage); \
1316 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextTout); \
1317 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextStepOut); \
1318 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextStepOutC); \
1319 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextStepRestart); \
1320 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextStepRestartC); \
1321 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextStepOutAverage); \
1322 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nextStepOutAverageC); \
1324 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(CFLNow); \
1325 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(ifOutT); \
1326 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(curDtMin); \
1327 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(curDtImplicit); \
1328 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(curDtImplicitHistory); \
1329 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(step); \
1330 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(iterAll); \
1331 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(gradIsZero); \
1333 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nLimBeta); \
1334 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nLimAlpha); \
1335 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(minAlpha); \
1336 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(minBeta); \
1337 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(nLimInc); \
1338 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(alphaMinInc); \
1340 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(dtIncreaseCounter); \
1342 DNDS_EULERSOLVER_RUNNINGENV_GET_REF(addOutList);
1402#define DNDS_EULERSOLVER_INS_EXTERN(model, ext) \
1403 namespace DNDS::Euler \
1405 ext template void EulerSolver<model>::RunImplicitEuler(); \
1406 ext template void EulerSolver<model>::InitializeRunningEnvironment( \
1407 EulerSolver<model>::RunningEnvironment &env); \
1418#define DNDS_EULERSOLVER_PRINTDATA_INS_EXTERN(model, ext) \
1419 namespace DNDS::Euler \
1421 ext template void EulerSolver<model>::PrintData( \
1422 const std::string &fname, const std::string &fnameSeries, \
1423 const tCellScalarFGet &odeResidualF, \
1424 tAdditionalCellScalarList &additionalCellScalars, \
1425 TEval &eval, real tSimu, \
1426 PrintDataMode mode); \
1427 ext template void EulerSolver<model>::PrintRestart( \
1428 std::string fname); \
1429 ext template void EulerSolver<model>::ReadRestart( \
1430 std::string fname); \
1431 ext template void EulerSolver<model>::ReadRestartOtherSolver( \
1432 std::string fname, const std::vector<int> &dimStore); \
1443#define DNDS_EULERSOLVER_INIT_INS_EXTERN(model, ext) \
1444 namespace DNDS::Euler \
1446 ext template void EulerSolver<model>::ReadMeshAndInitialize(); \
1447 ext template bool EulerSolver<model>::functor_fstop( \
1448 int iter, ArrayDOFV<nVarsFixed> &cres, int iStep, RunningEnvironment &env); \
1449 ext template bool EulerSolver<model>::functor_fmainloop( \
1450 RunningEnvironment &env); \
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.
Streaming CSV writer with auto-rotation and a dual int-or-double value type.
#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 + ...
Boundary condition types, handlers, integration recorders, and 1-D profile utilities for the compress...
Core finite-volume evaluator for compressible Navier-Stokes / Euler equations.
#define DNDS_EULERSOLVER_INIT_INS_EXTERN(model, ext)
#define DNDS_EULERSOLVER_PRINTDATA_INS_EXTERN(model, ext)
#define DNDS_EULERSOLVER_INS_EXTERN(model, ext)
Ideal-gas Riemann solvers, flux functions, and thermodynamic utilities for the compressible Euler / N...
JSON-to-Eigen conversion utilities and nlohmann_json helper macros.
Pre-allocated object pool with RAII checkout/return semantics.
Configurable factory that builds either a SerializerJSON or a SerializerH5 with all tunables exposed ...
The VR class that provides any information needed in high-order CFV.
MPI-parallel distributed array of per-cell Degrees-of-Freedom (conservative variable vectors).
MPI-parallel distributed array of per-cell reconstruction coefficient matrices.
Per-zone boundary condition handler for Euler/Navier-Stokes solvers.
Core finite-volume evaluator for compressible Navier-Stokes / Euler equations.
static const int nVarsFixed
Number of conserved variables (compile-time fixed).
static const auto I4
Index of the energy equation (= dim+1).
ssp< CFV::VariationalReconstruction< gDim > > TpVFV
Shared pointer to the variational reconstruction object.
static const int gDim
Geometric dimension of the mesh.
static const int dim
Spatial dimension (2 or 3).
Top-level solver orchestrator for compressible Navier-Stokes / Euler equations.
void PrintData(const std::string &fname, const std::string &fnameSeries, const tCellScalarFGet &odeResidualF, tAdditionalCellScalarList &additionalCellScalars, TEval &eval, real TSimu=-1.0, PrintDataMode mode=PrintDataLatest)
Write solution data to VTK/HDF5/Tecplot output files.
auto & getU()
Get mutable reference to the DOF array.
TEval::TRec TRec
Reconstruction coefficient array type.
void ReadRestartOtherSolver(std::string fname, const std::vector< int > &dimStore)
Read a restart file from a different solver/model, remapping variable dimensions.
TEval::TVFV TVFV
Variational reconstruction type.
void WriteSerializer(Serializer::SerializerBaseSSP serializerP, const std::string &name)
Serialize the solution to a SerializerBase (currently unused standalone path).
void RunImplicitEuler()
Run the main implicit time-marching loop.
void ReadMeshAndInitialize()
Read the mesh and initialize the full solver pipeline.
TEval::TDiffU TDiffU
Gradient of conserved variables type.
EulerSolver(const MPIInfo &nmpi, int n_nVars=getNVars(model))
Construct an EulerSolver with MPI communicator information.
bool functor_fstop(int iter, ArrayDOFV< nVarsFixed > &cres, int iStep, RunningEnvironment &env)
Convergence/termination check functor called after each inner iteration.
void solveLinear(real alphaDiag, real t, TDof &cres, TDof &cx, TDof &cxInc, TRec &uRecC, TRec uRecIncC, JacobianDiagBlock< nVarsFixed > &JDC, tGMRES_u &gmres, int gridLevel)
Solve the implicit linear system at a given grid level.
static const int gDim
Geometric dimension of the mesh.
auto & getConfiguration()
Get mutable reference to the configuration.
auto & getAlphaPP()
Get mutable reference to the PP alpha array.
auto & getURecNew()
Get mutable reference to the new reconstruction array.
std::enable_if_t<!std::is_arithmetic_v< std::remove_reference_t< TVal > > > FillLogValue(tLogSimpleDIValueMap &v_map, const std::string &name, TVal &&val)
Fill a log value map entry for non-arithmetic types (vectors → per-component entries).
auto & getBCHandler()
Get mutable reference to the BC handler.
void InitializeRunningEnvironment(RunningEnvironment &env)
Populate a RunningEnvironment with allocated solvers, loggers, and initial state.
TEval::TVec TVec
Spatial vector type.
TEval::TpVFV TpVFV
Shared pointer to VFV type.
TEval::TU TU
Conservative variable vector type.
TEval::TScalar TScalar
Scalar reconstruction coefficient array type.
auto getMesh() const
Get shared pointer to the mesh.
auto & getEval()
Get mutable reference to the evaluator.
void doPrecondition(real alphaDiag, real t, TDof &crhs, TDof &cx, TDof &cxInc, TDof &uTemp, JacobianDiagBlock< nVarsFixed > &JDC, TU &sgsRes, bool &inputIsZero, bool &hasLUDone, int gridLevel)
Apply the preconditioner (SGS sweeps or ILU) to a right-hand side vector.
auto & getBetaPP()
Get mutable reference to the PP beta array.
auto & getDTauTmp()
Get mutable reference to the dTau temporary.
auto & getURec()
Get mutable reference to the reconstruction array.
void ReadRestart(std::string fname)
Read a restart file and populate u (and optionally uRec) from it.
EulerEvaluator< model > TEval
Evaluator type for this model.
~EulerSolver()
Destructor. Waits for all async output futures to complete.
struct DNDS::Euler::EulerSolver::Configuration config
TEval::TJacobianU TJacobianU
Flux Jacobian matrix type.
bool functor_fmainloop(RunningEnvironment &env)
Main outer-loop functor: performs one full time step (reconstruction, RHS, linear solve,...
nlohmann::ordered_json gSetting
Full JSON configuration (read from file, may be modified at runtime).
void PrintConfig(bool updateCommit=false)
Write the current configuration to a JSON log file.
std::enable_if_t< std::is_arithmetic_v< std::remove_reference_t< TVal > > > FillLogValue(tLogSimpleDIValueMap &v_map, const std::string &name, TVal &&val)
Fill a log value map entry for arithmetic types (scalars).
TEval::TMat TMat
Spatial matrix type.
auto & getURecLimited()
Get mutable reference to the limited reconstruction array.
static const int dim
Spatial dimension (2 or 3).
void ConfigureFromJson(const std::string &jsonName, bool read=false, const std::string &jsonMergeName="", const std::vector< std::string > &overwriteKeys={}, const std::vector< std::string > &overwriteValues={})
Load or write solver configuration from/to a JSON file.
auto getMPI() const
Get MPI communicator info.
std::string output_stamp
Unique stamp appended to output filenames for this run.
std::tuple< std::unique_ptr< CsvLog >, tLogSimpleDIValueMap > LogErrInitialize()
Initialize the CSV error logger and value map for convergence monitoring.
static const int nVarsFixed
Compile-time number of conserved variables.
static const int I4
Energy equation index (= dim + 1).
tCellScalarList tAdditionalCellScalarList
Type alias for additional output scalar list.
TEval::TDof TDof
Cell-centered DOF array type.
PrintDataMode
Output mode selector for PrintData.
@ PrintDataTimeAverage
Output the time-averaged solution.
@ PrintDataLatest
Output the current (latest) solution.
void PrintRestart(std::string fname)
Write the current solution state to a restart file.
auto & getJSource()
Get mutable reference to the source Jacobian.
auto & getIfUseLimiter()
Get mutable reference to the limiter flag array.
auto getVFV() const
Get shared pointer to the VFV reconstruction.
Per-cell diagonal or block-diagonal Jacobian storage for implicit time stepping.
Generic object pool: caches unique_ptr<T> instances and hands them out with RAII return-on-destructio...
DNDS::ArrayPair< DNDS::ArrayEigenVector< 1 > > tScalarPair
EnumValuesTag enum_values(std::vector< std::string > vals)
Create an enum allowed-values tag.
RangeTag range(double min)
Create a minimum-only range constraint.
std::vector< std::tuple< std::string, const tCellScalarFGet > > tCellScalarList
List of (field_name, getter_function) pairs for cell-scalar output.
std::function< real(index)> tCellScalarFGet
Function type returning a scalar value for a given cell index [0, NumCell).
nlohmann::ordered_json bcSettingsSchema()
Build a JSON Schema (draft-07) for the bcSettings array.
MPI_int Barrier(MPI_Comm comm)
Wrapper over MPI_Barrier.
ssp< SerializerBase > SerializerBaseSSP
std::map< std::string, LogSimpleDIValue > tLogSimpleDIValueMap
Convenience alias: the title -> value map type passed to CsvLog::WriteLine.
DNDS_CONSTANT const rowsize DynamicSize
Template parameter flag: "row width is set at runtime but uniform".
void from_json(const nlohmann::ordered_json &j, host_device_vector< real > &v)
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).
std::ostream & log()
Return the current DNDSR log stream (either std::cout or the installed file).
void to_json(nlohmann::ordered_json &j, const host_device_vector< real > &v)
DNDS_CONSTANT const real veryLargeReal
Catch-all upper bound ("practically infinity") for physical scalars.
std::string GetSetVersionName(const std::string &ver)
Read/set the build version string accessible from code.
void WriteSerialize(Serializer::SerializerBaseSSP serializerP, const std::string &name, bool includePIG=true, bool includeSon=true)
Writes the ArrayPair (father, optional son, optional ghost mapping).
A means to translate nlohmann json into c++ primitive data types and back; and stores then during com...
Master configuration struct for the compressible Euler/Navier-Stokes evaluator.
Periodic boundary geometry definitions.
Eigen::Vector< real, -1 > PeriodicTranslation2
Eigen::Vector< real, -1 > PeriodicRotationCent3
Eigen::Vector< real, -1 > PeriodicRotationEulerAngles3
Eigen::Vector< real, -1 > PeriodicRotationEulerAngles2
Eigen::Vector< real, -1 > PeriodicRotationEulerAngles1
Eigen::Vector< real, -1 > PeriodicTranslation1
DNDS_DECLARE_CONFIG(BoundaryDefinition)
Eigen::Vector< real, -1 > PeriodicRotationCent2
Eigen::Vector< real, -1 > PeriodicRotationCent1
Eigen::Vector< real, -1 > PeriodicTranslation3
Convergence monitoring parameters.
real rhsThresholdInternal
DNDS_DECLARE_CONFIG(ConvergenceControl)
Data I/O control parameters.
real meshElevationRBFRadius
std::string vtuFloatEncodeMode
real meshElevationRefDWall
std::string meshPartitionedReaderType
int meshElevationInternalSmoother
std::string outRestartName
real meshElevationRBFPower
real rectifyNearPlaneThres
real meshElevationMaxIncludedAngle
Geom::UnstructuredMesh::WallDistOptions meshWallDistOptions
DNDS_DECLARE_CONFIG(DataIOControl)
Serializer::SerializerFactory meshPartitionedWriter
Geom::RBF::RBFKernelType meshElevationRBFKernel
Geom::UnstructuredMeshSerialRW::PartitionOptions meshPartitionOptions
std::vector< std::string > outCellScalarNames
const std::string & getOutLogName()
Serializer::SerializerFactory restartWriter
const std::string & getOutRestartName()
int meshElevationBoundaryMode
Implicit CFL number control parameters.
DNDS_DECLARE_CONFIG(ImplicitCFLControl)
Implicit reconstruction control parameters.
int nRecMultiplyForZeroedGrad
int zeroRecForStepsInternal
DNDS_DECLARE_CONFIG(ImplicitReconstructionControl)
Slope limiter control parameters.
bool ppRecLimiterCompressToMean
int smoothIndicatorProcedure
int nPartialLimiterStartLocal
DNDS_DECLARE_CONFIG(LimiterControl)
int centralSmoothInputResidual
DNDS_DECLARE_CONFIG(CoarseGridLinearSolverControl)
Linear solver control parameters.
DNDS_DECLARE_CONFIG(LinearSolverControl)
int multiGridLPInnerNIter
Direct::DirectPrecControl directPrecControl
std::map< std::string, CoarseGridLinearSolverControl > coarseGridLinearSolverControlList
Miscellaneous solver options (axisymmetric mode, passive scalar freezing, rec matrix output).
Serializer::SerializerFactory recMatrixWriter
DNDS_DECLARE_CONFIG(Others)
Output control parameters.
std::vector< std::string > logfileOutputTitles
std::vector< std::string > consoleMainOutputFormat
int consoleOutputEveryFix
std::vector< std::string > consoleMainOutputFormatInternal
DNDS_DECLARE_CONFIG(OutputControl)
int nConsoleCheckInternal
Restart checkpoint state.
std::string lastRestartFile
DNDS_DECLARE_CONFIG(RestartState)
std::vector< int > otherRestartStoreDim
std::string otherRestartFile
Time-averaging control for unsteady simulations.
DNDS_DECLARE_CONFIG(TimeAverageControl)
Time marching control parameters.
bool timeMarchIsTwoStage()
DNDS_DECLARE_CONFIG(TimeMarchControl)
nlohmann::ordered_json odeSettingsExtra
Complete solver configuration, serializable to/from JSON.
CFV::VRSettings vfvSettings
Variational reconstruction settings.
struct DNDS::Euler::EulerSolver::Configuration::DataIOControl dataIOControl
struct DNDS::Euler::EulerSolver::Configuration::ImplicitReconstructionControl implicitReconstructionControl
std::map< std::string, std::string > bcNameMapping
Mapping from mesh BC names to solver BC type names.
EulerEvaluatorSettings< model > eulerSettings
Physics settings passed to the EulerEvaluator.
struct DNDS::Euler::EulerSolver::Configuration::TimeAverageControl timeAverageControl
struct DNDS::Euler::EulerSolver::Configuration::Others others
void ReadWriteJson(nlohmann::ordered_json &jsonObj, int nVars, bool read)
Backward-compatible bidirectional JSON read/write.
struct DNDS::Euler::EulerSolver::Configuration::LinearSolverControl linearSolverControl
struct DNDS::Euler::EulerSolver::Configuration::TimeMarchControl timeMarchControl
struct DNDS::Euler::EulerSolver::Configuration::LimiterControl limiterControl
struct DNDS::Euler::EulerSolver::Configuration::BoundaryDefinition boundaryDefinition
DNDS_DECLARE_CONFIG(Configuration)
struct DNDS::Euler::EulerSolver::Configuration::RestartState restartState
struct DNDS::Euler::EulerSolver::Configuration::ConvergenceControl convergenceControl
struct DNDS::Euler::EulerSolver::Configuration::OutputControl outputControl
nlohmann::ordered_json bcSettings
Boundary condition definitions (JSON array).
struct DNDS::Euler::EulerSolver::Configuration::ImplicitCFLControl implicitCFLControl
Mutable state bundle for the time-marching loop.
std::unique_ptr< tPCG_uRec > pcgRec
tAdditionalCellScalarList addOutList
std::tuple< std::unique_ptr< CsvLog >, tLogSimpleDIValueMap > logErr
std::unique_ptr< tPCG_uRec > pcgRec1
ssp< ODE::ImplicitDualTimeStep< ArrayDOFV< nVarsFixed >, ArrayDOFV< 1 > > > ode
Eigen::VectorFMTSafe< real, -1 > resBaseC
ssp< EulerEvaluator< model > > pEval
Eigen::VectorFMTSafe< real, -1 > resBaseCInternal
std::unique_ptr< tGMRES_uRec > gmresRec
std::vector< real > curDtImplicitHistory
std::map< std::string, ScalarStatistics > tInternalStats
std::unique_ptr< tGMRES_u > gmres
Lightweight bundle of an MPI communicator and the calling rank's coordinates.
Config-backed factory selecting between JSON and HDF5 serializers.
Eigen::Matrix wrapper that hides begin/end from fmt.