DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
EulerP_BC.hpp
Go to the documentation of this file.
1/**
2 * @file EulerP_BC.hpp
3 * @brief Boundary condition types, implementations, and handler for the EulerP module.
4 *
5 * Provides:
6 * - `BCType:` Enumeration of supported boundary condition types (Far, Wall, Sym, etc.)
7 * - `BCFunc_Impl:` Template specializations for each BC type (currently stubs, TODO)
8 * - `BC_DeviceView` / `BC:` Device-callable and host-side single BC objects
9 * - `BCHandlerDeviceView` / `BCHandler:` Device-callable and host-side BC managers
10 * - `BCInput:` JSON-deserializable input struct for BC configuration
11 *
12 * The BC system uses a runtime switch-dispatch in `BC_DeviceView::apply()` to route
13 * to the appropriate `BCFunc_Impl` specialization, enabling device-callable BC evaluation
14 * on both Host and CUDA backends.
15 */
16#pragma once
18#include "DNDS/ConfigEnum.hpp"
19#include "EulerP.hpp"
20#include "EulerP_Physics.hpp"
22#include "Geom/Geometric.hpp"
23
24namespace DNDS::EulerP
25{
26 /**
27 * @brief Enumeration of boundary condition types for the EulerP module.
28 *
29 * Mirrors the BC types in the Euler module. JSON-serializable via DNDS_DEFINE_ENUM_JSON.
30 */
31 enum class BCType : uint8_t
32 {
33 Unknown = 0, ///< Uninitialized or unrecognized BC type.
34 Far, ///< Farfield BC (characteristic-based).
35 Wall, ///< No-slip viscous wall (adiabatic).
36 WallInvis, ///< Inviscid (slip) wall BC.
37 WallIsothermal, ///< No-slip viscous wall with fixed temperature.
38 Out, ///< Supersonic/subsonic outflow BC.
39 OutP, ///< Outflow with specified back-pressure.
40 In, ///< Supersonic/subsonic inflow BC.
41 InPsTs, ///< Inflow with specified stagnation pressure and temperature.
42 Sym, ///< Symmetry plane BC.
43 Special, ///< Special-purpose BC for benchmark cases (e.g., DMR, Riemann).
44 };
45
47 BCType,
48 {
49 {BCType::Unknown, nullptr},
50 {BCType::Far, "Far"},
51 {BCType::Wall, "Wall"},
52 {BCType::WallInvis, "WallInvis"},
53 {BCType::WallIsothermal, "WallIsothermal"},
54 {BCType::Out, "Out"},
55 {BCType::OutP, "OutP"},
56 {BCType::In, "In"},
57 {BCType::InPsTs, "InPsTs"},
58 {BCType::Sym, "Sym"},
59 {BCType::Special, "Special"},
60 })
61
62 /// @brief Type alias for the device-resident BC parameter storage vector.
63 template <DeviceBackend B>
64 using BCStorageVecDeviceView = vector_DeviceView<B, real, int32_t>;
65
66 /**
67 * @brief Primary template for boundary condition function implementations.
68 *
69 * Each specialization provides a static `apply()` method implementing the
70 * specific BC logic for one `BCType.` All current specializations are stubs
71 * that assert false (implementations are TODO).
72 *
73 * @tparam B Device backend (Host or CUDA).
74 * @tparam T The BCType this specialization implements.
75 */
76 template <DeviceBackend B, BCType T>
78
79 /**
80 * @brief Macro defining the standard BC apply interface signature.
81 *
82 * Expands to a static device-callable apply function taking:
83 * - `U:` Input conservative state
84 * - `UOut:` Output (ghost) conservative state
85 * - `uSiz:` Number of variables
86 * - `x:` Face centroid coordinates
87 * - `n:` Outward face normal
88 * - `id:` Boundary zone ID
89 * - `value:` BC parameter storage view
90 * - `phy:` Physics device view
91 */
92#define DNDS_EULERP_BC_INTERFACE_APPLY \
93 template <class tU, class tUOut, class tx, class tn> \
94 DNDS_DEVICE_CALLABLE static void apply( \
95 tU &&U, tUOut &&UOut, int32_t uSiz, \
96 tx &&x, tn &&n, \
97 Geom::t_index id, \
98 BCStorageVecDeviceView<B> value, PhysicsDeviceView<B> &phy)
99
100 /// @brief Farfield BC implementation (TODO: not yet implemented).
101 template <DeviceBackend B>
103 {
105 {
106 DNDS_HD_assert(false); // TODO
107 }
108 };
109
110 /// @brief No-slip viscous wall BC implementation (TODO: not yet implemented).
111 template <DeviceBackend B>
113 {
115 {
116 DNDS_HD_assert(false); // TODO
117 }
118 };
119
120 /// @brief Isothermal viscous wall BC implementation (TODO: not yet implemented).
121 template <DeviceBackend B>
123 {
125 {
126 DNDS_HD_assert(false); // TODO
127 }
128 };
129
130 /// @brief Outflow BC implementation (TODO: not yet implemented).
131 template <DeviceBackend B>
133 {
135 {
136 DNDS_HD_assert(false); // TODO
137 }
138 };
139
140 /// @brief Outflow with back-pressure BC implementation (TODO: not yet implemented).
141 template <DeviceBackend B>
143 {
145 {
146 DNDS_HD_assert(false); // TODO
147 }
148 };
149
150 /// @brief Inflow with stagnation pressure/temperature BC implementation (TODO: not yet implemented).
151 template <DeviceBackend B>
153 {
155 {
156 DNDS_HD_assert(false); // TODO
157 }
158 };
159
160 /// @brief Symmetry plane BC implementation (TODO: not yet implemented).
161 template <DeviceBackend B>
163 {
165 {
166 DNDS_HD_assert(false); // TODO
167 }
168 };
169
170 /// @brief Special-purpose BC implementation for benchmark cases (TODO: not yet implemented).
171 template <DeviceBackend B>
173 {
175 {
176 DNDS_HD_assert(false); // TODO
177 }
178 };
179
180 /// @brief General inflow BC implementation (TODO: not yet implemented).
181 template <DeviceBackend B>
183 {
185 {
186 DNDS_HD_assert(false); // TODO
187 }
188 };
189
190 /// @brief Inviscid (slip) wall BC implementation (TODO: not yet implemented).
191 template <DeviceBackend B>
193 {
195 {
196 DNDS_HD_assert(false); // TODO
197 }
198 };
199
200 /**
201 * @brief Device-callable view of a single boundary condition.
202 *
203 * Holds a device-resident view of BC parameter values, the boundary zone ID,
204 * and the BC type. The `apply()` method uses a runtime switch to dispatch
205 * to the appropriate `BCFunc_Impl` specialization.
206 *
207 * @tparam B Device backend (Host or CUDA).
208 */
209 template <DeviceBackend B>
211 {
212 BCStorageVecDeviceView<B> values; ///< Device-resident BC parameter values.
213 Geom::t_index id = Geom::BC_ID_NULL; ///< Boundary zone identifier.
214 BCType type = BCType::Unknown; ///< Type of boundary condition.
215
216 public:
218
219 /**
220 * @brief Constructs a BC device view from values, zone ID, and type.
221 * @param n_values Device view of BC parameter values.
222 * @param n_id Boundary zone identifier.
223 * @param n_type Boundary condition type.
224 */
226 BCStorageVecDeviceView<B> n_values,
227 Geom::t_index n_id,
228 BCType n_type)
229 : values(n_values), id(n_id), type(n_type) {}
230
231 DNDS_DEVICE_CALLABLE Geom::t_index getId() const { return id; } ///< Returns the boundary zone ID.
232 DNDS_DEVICE_CALLABLE BCType getType() const { return type; } ///< Returns the boundary condition type.
233 DNDS_DEVICE_CALLABLE int32_t getNValues() const { return values.size(); } ///< Returns the number of BC parameter values.
234 DNDS_DEVICE_CALLABLE real value(int32_t i) const { return values[i]; } ///< Returns the i-th BC parameter value.
235
236 /**
237 * @brief Applies this boundary condition to compute the ghost state.
238 *
239 * Dispatches to the appropriate `BCFunc_Impl` specialization based on the runtime
240 * `type` field using a switch statement. Asserts on unknown types.
241 *
242 * @tparam tU Input conservative state type (deduced).
243 * @tparam tUOut Output ghost state type (deduced).
244 * @tparam tx Coordinate vector type (deduced).
245 * @tparam tn Normal vector type (deduced).
246 * @param U Input conservative state at the boundary face.
247 * @param[out] UOut Output ghost conservative state.
248 * @param uSiz Number of variables.
249 * @param x Face centroid coordinates.
250 * @param n Outward face unit normal.
251 * @param phy Physics device view for thermodynamic computations.
252 */
253 template <class tU, class tUOut, class tx, class tn>
254 DNDS_DEVICE_CALLABLE void apply(tU &&U, tUOut &&UOut, int32_t uSiz,
255 tx &&x, tn &&n,
257 {
258#define DNDS_EULERP_CASE_BC_APPLY(type) \
259 case type: \
260 { \
261 BCFunc_Impl<B, type>::apply(U, UOut, uSiz, x, n, id, values, phy); \
262 } \
263 break;
264 switch (type)
265 {
276 default:
277 DNDS_HD_assert(false);
278 }
279 }
280 };
281
282 /**
283 * @brief Host-side boundary condition object managing parameter values and device transfer.
284 *
285 * Stores BC parameters in a `host_device_vector` for transparent host/device transfer.
286 * Provides property accessors for zone ID, type, and values. Use `deviceView<B>()`
287 * to obtain a `BC_DeviceView` for kernel invocation.
288 */
289 class BC
290 {
291 host_device_vector<real> values; ///< BC parameter values (e.g., freestream state, wall temperature).
292 Geom::t_index id = Geom::BC_ID_NULL; ///< Boundary zone identifier.
293 BCType type = BCType::Unknown; ///< Boundary condition type.
294
295 public:
296 [[nodiscard]] Geom::t_index getId() const { return id; } ///< Returns the boundary zone ID.
297 void setId(Geom::t_index n_id) { id = n_id; } ///< Sets the boundary zone ID.
298 [[nodiscard]] BCType getType() const { return type; } ///< Returns the BC type.
299 void setType(BCType n_type) { type = n_type; } ///< Sets the BC type.
300 [[nodiscard]] int32_t getNValues() const { return size_t_to_signed<int32_t>(values.size()); } ///< Returns the number of parameter values.
301 [[nodiscard]] real value(int i) const { return values.at(i); } ///< Returns the i-th parameter value (bounds-checked).
302 void setValues(const std::vector<real> &v) { values = v; } ///< Sets BC parameter values from a vector.
303 [[nodiscard]] auto getValues() const { return std::vector<real>(values); } ///< Returns a copy of BC parameter values as std::vector.
304
305 /// @brief Transfers BC values to host memory.
306 void to_host()
307 {
308 values.to_host();
309 }
310
311 /// @brief Transfers BC values to the specified device backend.
312 /// @param B Target device backend.
314 {
315 values.to_device(B);
316 }
317
318 /// @brief Returns the current device backend where BC values reside.
320 {
321 return values.device();
322 }
323
324 template <DeviceBackend B>
325 using t_deviceView = BC_DeviceView<B>; ///< Device view type alias.
326
327 /**
328 * @brief Creates a device-callable view of this BC object.
329 * @tparam B Target device backend.
330 * @return A `BC_DeviceView<B>` for use in device kernels.
331 */
332 template <DeviceBackend B>
334 {
336 "not on this device: " + std::string(device_backend_name(B)));
337 return t_deviceView<B>(values.deviceView<B, int32_t>(), id, type);
338 }
339 };
340
341 /**
342 * @brief Device-callable view of the BC handler providing BC lookup by zone ID.
343 *
344 * Holds a device-resident array of `BC_DeviceView` objects indexed by boundary zone ID.
345 *
346 * @tparam B Device backend (Host or CUDA).
347 */
348 template <DeviceBackend B>
350 {
351 vector_DeviceView<B, BC_DeviceView<B>, int32_t> bcs; ///< Device array of BC views indexed by zone ID.
352
353 public:
355
356 /// @brief Constructs from a device view of BC_DeviceView array.
358
359 /**
360 * @brief Looks up a boundary condition by zone ID.
361 * @param id Boundary zone identifier.
362 * @return Reference to the `BC_DeviceView` for the given zone.
363 */
365 {
366 DNDS_HD_assert(id < bcs.size() && id >= 0);
367 return bcs[id];
368 }
369 };
370
371 /**
372 * @brief Simple struct for JSON-deserialized boundary condition input specification.
373 *
374 * Used to read BC definitions from JSON configuration files before constructing
375 * the `BCHandler.` JSON-serializable via nlohmann_json intrusive macros.
376 */
377 struct BCInput
378 {
379 BCType type; ///< Boundary condition type.
380 std::string name; ///< Boundary zone name (must match mesh zone names).
381 std::vector<real> value; ///< BC parameter values (meaning depends on BC type).
383 BCInput,
384 type, name, value)
385 };
386
387 /**
388 * @brief Host-side boundary condition handler managing all BC objects for a simulation.
389 *
390 * Constructed from a list of `BCInput` specifications and a name-to-ID mapping.
391 * Automatically assigns default BC types for standard mesh zones (WALL, WALL_INVIS,
392 * FAR, and SPECIAL benchmark zones). Supports host/device transfer of all managed BCs.
393 *
394 * Use `id2bc(id)` to look up a BC by zone ID, and `deviceView<B>()` to obtain a
395 * `BCHandlerDeviceView` for kernel invocation.
396 */
398 {
399 std::vector<BC> bcs; ///< Array of BC objects indexed by zone ID.
400
401 public:
402 /**
403 * @brief Constructs the BC handler from JSON-deserialized inputs and a name-to-ID map.
404 *
405 * Allocates BC slots for all zone IDs, applies user-specified BC inputs, then
406 * sets default types for standard zones:
407 * - `BC_ID_DEFAULT_WALL` → BCType::Wall
408 * - `BC_ID_DEFAULT_WALL_INVIS` → BCType::WallInvis
409 * - `BC_ID_DEFAULT_FAR` → BCType::Far
410 * - Special benchmark zone IDs → BCType::Special
411 *
412 * @param bc_inputs Vector of BCInput specifications from JSON configuration.
413 * @param name2id Name-to-ID mapping from mesh zone names to integer IDs.
414 * @throws std::runtime_error If a BC input name is not found in name2id.
415 */
416 BCHandler(const std::vector<BCInput> &bc_inputs, Geom::AutoAppendName2ID &name2id)
417 {
418 bcs.resize(name2id.id_cap);
419 for (auto &[name, id] : name2id.n2id_map)
420 {
421 if (id >= 0)
422 bcs.at(id).setId(id);
423 }
424 for (const auto &input : bc_inputs)
425 {
426 DNDS_assert_info(name2id.n2id_map.count(input.name), fmt::format("bc input [{}] name not found in name2id", input.name));
427 auto id = name2id.n2id_map.at(input.name);
428 bcs.at(id).setType(input.type);
429 bcs.at(id).setId(id);
430 bcs.at(id).setValues(input.value);
431 }
432 {
433 auto &bcC = bcs.at(Geom::BC_ID_DEFAULT_WALL);
434 DNDS_assert_info(bcC.getType() == BCType::Unknown, "you should not input WALL as custom bc");
435 bcC.setType(BCType::Wall);
436 }
437 {
438 auto &bcC = bcs.at(Geom::BC_ID_DEFAULT_WALL_INVIS);
439 DNDS_assert_info(bcC.getType() == BCType::Unknown, "you should not input WALL_INVIS as custom bc");
440 bcC.setType(BCType::WallInvis);
441 }
442 {
443 auto &bcC = bcs.at(Geom::BC_ID_DEFAULT_FAR);
444 DNDS_assert_info(bcC.getType() == BCType::Unknown, "you should not input FAR as custom bc");
445 bcC.setType(BCType::Far);
446 }
447 for (auto id : std::vector<Geom::t_index>{Geom::BC_ID_DEFAULT_SPECIAL_2DRiemann_FAR,
448 Geom::BC_ID_DEFAULT_SPECIAL_DMR_FAR,
449 Geom::BC_ID_DEFAULT_SPECIAL_IV_FAR,
450 Geom::BC_ID_DEFAULT_SPECIAL_RT_FAR})
451 {
452 auto &bcC = bcs.at(id);
453 DNDS_assert_info(bcC.getType() == BCType::Unknown, "you should set default BC id" + std::to_string(id));
454 bcC.setType(BCType::Special);
455 }
456 }
457
458 /**
459 * @brief Looks up a boundary condition by zone ID.
460 * @param id Boundary zone identifier.
461 * @return Reference to the `BC` object for the given zone.
462 */
464 {
465 DNDS_HD_assert(id < bcs.size());
466 return bcs[id];
467 }
468
469 /// @brief Transfers all BC values to host memory.
470 void to_host()
471 {
472 for (auto &bc : bcs)
473 bc.to_host();
474 }
475
476 /// @brief Transfers all BC values to the specified device backend.
477 /// @param B Target device backend.
479 {
480 for (auto &bc : bcs)
481 bc.to_device(B);
482 }
483
484 /// @brief Returns the device backend where BCs reside (asserts all BCs are on the same device).
486 {
488 if (bcs.size())
489 B = bcs[0].device();
490 for (auto &bc : bcs)
491 {
492 DNDS_assert(bc.device() == B);
493 }
494 return B;
495 }
496
497 /**
498 * @brief Move-only device view wrapper owning the BC device view storage.
499 *
500 * Wraps a `host_device_vector` of `BC_DeviceView` and the resulting
501 * `BCHandlerDeviceView.` Move-only to prevent accidental copies that
502 * would invalidate device pointers.
503 *
504 * @tparam B Device backend.
505 */
506 template <DeviceBackend B>
508 {
509 host_device_vector<BC_DeviceView<B>> bcs_device_view; ///< Owned device storage of BC views.
510 BCHandlerDeviceView<B> view; ///< The handler device view referencing bcs_device_view.
511
517
518 //! only permit moving to avoid host_device_vector to change
519 // also avoids accidentally copying this to device...
520 t_deviceView(t_deviceView &&R) noexcept = default;
521 t_deviceView(const t_deviceView &R) = delete;
524
525 operator BCHandlerDeviceView<B>() const
526 {
527 return view;
528 }
529 };
530
531 /**
532 * @brief Creates a device view of all managed BCs for kernel invocation.
533 *
534 * Builds a `host_device_vector` of `BC_DeviceView` from each managed BC,
535 * transfers it to the specified device backend, and returns an owning
536 * `t_deviceView` wrapper. The returned object is move-only.
537 *
538 * @tparam B Target device backend.
539 * @return A `t_deviceView<B>` owning the device BC array.
540 */
541 template <DeviceBackend B>
543 {
545 bcs_device_view.resize(bcs.size());
546 index i = 0;
547 for (auto &bc : bcs)
548 {
549 DNDS_assert(bc.device() == B ||
550 (B == DeviceBackend::Host && bc.device() == DeviceBackend::Unknown));
551 bcs_device_view[i++] = bc.template deviceView<B>();
552 }
553 bcs_device_view.to_device(B);
554
555 return t_deviceView<B>{std::move(bcs_device_view)};
556 }
557 };
558}
559
560namespace DNDS
561{
562 // DNDS_DEVICE_STORAGE_BASE_DELETER_INST(EulerP::BC_DeviceView<DeviceBackend::Host>, extern)
563 // DNDS_DEVICE_STORAGE_INST(EulerP::BC_DeviceView<DeviceBackend::Host>, DeviceBackend::Host, extern)
564 // #ifdef DNDS_USE_CUDA
565 // DNDS_DEVICE_STORAGE_BASE_DELETER_INST(EulerP::BC_DeviceView<DeviceBackend::CUDA>, extern)
566 // DNDS_DEVICE_STORAGE_INST(EulerP::BC_DeviceView<DeviceBackend::CUDA>, DeviceBackend::CUDA, extern)
567 // #endif
568}
Extended enum-to-JSON serialization macro that also exposes allowed string values for JSON Schema gen...
#define DNDS_DEFINE_ENUM_JSON(EnumType_,...)
Define JSON serialization for an enum AND expose its allowed string values.
#define DNDS_DEVICE_TRIVIAL_COPY_DEFINE(T, T_Self)
Definition Defines.hpp:83
#define DNDS_DEVICE_CALLABLE
Definition Defines.hpp:76
#define DNDS_DEVICE_TRIVIAL_COPY_DEFINE_NO_EMPTY_CTOR(T, T_Self)
Definition Defines.hpp:91
Device memory abstraction layer with backend-specific storage and factory creation.
#define DNDS_assert_info(expr, info)
Debug-only assertion with an extra std::string info message.
Definition Errors.hpp:113
#define DNDS_assert(expr)
Debug-only assertion (compiled out when DNDS_NDEBUG is defined). Prints the expression + file/line + ...
Definition Errors.hpp:108
#define DNDS_HD_assert(cond)
Host-only expansion of DNDS_HD_assert (equivalent to DNDS_assert).
Definition Errors.hpp:189
Core type definitions and utilities for the EulerP alternative Navier-Stokes evaluator module.
#define DNDS_EULERP_CASE_BC_APPLY(type)
#define DNDS_EULERP_BC_INTERFACE_APPLY
Macro defining the standard BC apply interface signature.
Definition EulerP_BC.hpp:92
Physics model definitions for the EulerP module: gas properties, state conversions,...
#define DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_AND_UNORDERED_JSON(Type,...)
Like DNDS_NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_ORDERED_JSON but additionally installs the unordered-JS...
Definition JsonUtil.hpp:125
Device-callable view of the BC handler providing BC lookup by zone ID.
DNDS_DEVICE_CALLABLE BC_DeviceView< B > & id2bc(Geom::t_index id)
Looks up a boundary condition by zone ID.
Host-side boundary condition handler managing all BC objects for a simulation.
void to_host()
Transfers all BC values to host memory.
t_deviceView< B > deviceView()
Creates a device view of all managed BCs for kernel invocation.
BC & id2bc(Geom::t_index id)
Looks up a boundary condition by zone ID.
void to_device(DeviceBackend B)
Transfers all BC values to the specified device backend.
DeviceBackend device()
Returns the device backend where BCs reside (asserts all BCs are on the same device).
BCHandler(const std::vector< BCInput > &bc_inputs, Geom::AutoAppendName2ID &name2id)
Constructs the BC handler from JSON-deserialized inputs and a name-to-ID map.
Device-callable view of a single boundary condition.
DNDS_DEVICE_CALLABLE int32_t getNValues() const
Returns the number of BC parameter values.
DNDS_DEVICE_CALLABLE BCType getType() const
Returns the boundary condition type.
DNDS_DEVICE_CALLABLE Geom::t_index getId() const
Returns the boundary zone ID.
DNDS_DEVICE_CALLABLE real value(int32_t i) const
Returns the i-th BC parameter value.
DNDS_DEVICE_CALLABLE void apply(tU &&U, tUOut &&UOut, int32_t uSiz, tx &&x, tn &&n, PhysicsDeviceView< B > &phy)
Applies this boundary condition to compute the ghost state.
Host-side boundary condition object managing parameter values and device transfer.
DeviceBackend device()
Returns the current device backend where BC values reside.
void setId(Geom::t_index n_id)
Sets the boundary zone ID.
BCType getType() const
Returns the BC type.
t_deviceView< B > deviceView()
Creates a device-callable view of this BC object.
void to_device(DeviceBackend B)
Transfers BC values to the specified device backend.
BC_DeviceView< B > t_deviceView
Device view type alias.
Geom::t_index getId() const
Returns the boundary zone ID.
auto getValues() const
Returns a copy of BC parameter values as std::vector.
void setValues(const std::vector< real > &v)
Sets BC parameter values from a vector.
void setType(BCType n_type)
Sets the BC type.
int32_t getNValues() const
Returns the number of parameter values.
real value(int i) const
Returns the i-th parameter value (bounds-checked).
void to_host()
Transfers BC values to host memory.
const T & at(size_t i) const
Definition Vector.hpp:188
Host + optional device vector of trivially copyable T.
Definition Vector.hpp:217
DNDS_HOST void to_device(DeviceBackend backend=DeviceBackend::Host)
Definition Vector.hpp:312
t_deviceView< B, TSize > deviceView()
Definition Vector.hpp:351
DNDS_HOST size_t size() const
Definition Vector.hpp:266
DeviceBackend device()
Definition Vector.hpp:390
DNDS_HOST void to_host()
Definition Vector.hpp:339
Non-owning device-callable view {pointer, size} over a typed array.
Definition Vector.hpp:148
Namespace for the EulerP alternative evaluator module with GPU support.
Definition EulerP.hpp:29
BCType
Enumeration of boundary condition types for the EulerP module.
Definition EulerP_BC.hpp:32
@ InPsTs
Inflow with specified stagnation pressure and temperature.
@ Sym
Symmetry plane BC.
@ WallInvis
Inviscid (slip) wall BC.
@ WallIsothermal
No-slip viscous wall with fixed temperature.
@ Out
Supersonic/subsonic outflow BC.
@ Unknown
Uninitialized or unrecognized BC type.
@ Wall
No-slip viscous wall (adiabatic).
@ Special
Special-purpose BC for benchmark cases (e.g., DMR, Riemann).
@ Far
Farfield BC (characteristic-based).
@ In
Supersonic/subsonic inflow BC.
@ OutP
Outflow with specified back-pressure.
int32_t t_index
Definition Geometric.hpp:6
the host side operators are provided as implemented
DeviceBackend
Enumerates the backends a DeviceStorage / Array can live on.
@ Unknown
Unset / sentinel.
@ Host
Plain CPU memory.
const char * device_backend_name(DeviceBackend B)
Canonical string name for a DeviceBackend (used in log messages).
int64_t index
Global row / DOF index type (signed 64-bit; handles multi-billion-cell meshes).
Definition Defines.hpp:107
double real
Canonical floating-point scalar used throughout DNDSR (double precision).
Definition Defines.hpp:105
Primary template for boundary condition function implementations.
Definition EulerP_BC.hpp:77
Move-only device view wrapper owning the BC device view storage.
t_deviceView(const t_deviceView &R)=delete
t_deviceView & operator=(const t_deviceView &R)=delete
host_device_vector< BC_DeviceView< B > > bcs_device_view
Owned device storage of BC views.
t_deviceView(t_deviceView &&R) noexcept=default
only permit moving to avoid host_device_vector to change
t_deviceView(host_device_vector< BC_DeviceView< B > > &&n_bcs_device_view)
t_deviceView & operator=(t_deviceView &&R)=delete
BCHandlerDeviceView< B > view
The handler device view referencing bcs_device_view.
Simple struct for JSON-deserialized boundary condition input specification.
std::string name
Boundary zone name (must match mesh zone names).
std::vector< real > value
BC parameter values (meaning depends on BC type).
BCType type
Boundary condition type.
Device-callable view of physics parameters providing thermodynamic operations.
Eigen::Matrix< real, 5, 1 > v
tVec x(NCells)
Eigen::Vector3d n(1.0, 0.0, 0.0)