DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::EulerP::BCHandler Class Reference

Host-side boundary condition handler managing all BC objects for a simulation. More...

#include <EulerP_BC.hpp>

Classes

struct  t_deviceView
 Move-only device view wrapper owning the BC device view storage. More...
 

Public Member Functions

 BCHandler (const std::vector< BCInput > &bc_inputs, Geom::AutoAppendName2ID &name2id)
 Constructs the BC handler from JSON-deserialized inputs and a name-to-ID map.
 
BCid2bc (Geom::t_index id)
 Looks up a boundary condition by zone ID.
 
void to_host ()
 Transfers all BC values to host memory.
 
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).
 
template<DeviceBackend B>
t_deviceView< B > deviceView ()
 Creates a device view of all managed BCs for kernel invocation.
 

Detailed Description

Host-side boundary condition handler managing all BC objects for a simulation.

Constructed from a list of BCInput specifications and a name-to-ID mapping. Automatically assigns default BC types for standard mesh zones (WALL, WALL_INVIS, FAR, and SPECIAL benchmark zones). Supports host/device transfer of all managed BCs.

Use id2bc(id) to look up a BC by zone ID, and deviceView<B>() to obtain a BCHandlerDeviceView for kernel invocation.

Definition at line 397 of file EulerP_BC.hpp.

Constructor & Destructor Documentation

◆ BCHandler()

DNDS::EulerP::BCHandler::BCHandler ( const std::vector< BCInput > &  bc_inputs,
Geom::AutoAppendName2ID &  name2id 
)
inline

Constructs the BC handler from JSON-deserialized inputs and a name-to-ID map.

Allocates BC slots for all zone IDs, applies user-specified BC inputs, then sets default types for standard zones:

Parameters
bc_inputsVector of BCInput specifications from JSON configuration.
name2idName-to-ID mapping from mesh zone names to integer IDs.
Exceptions
std::runtime_errorIf a BC input name is not found in name2id.

Definition at line 416 of file EulerP_BC.hpp.

Member Function Documentation

◆ device()

DeviceBackend DNDS::EulerP::BCHandler::device ( )
inline

Returns the device backend where BCs reside (asserts all BCs are on the same device).

Definition at line 485 of file EulerP_BC.hpp.

◆ deviceView()

template<DeviceBackend B>
t_deviceView< B > DNDS::EulerP::BCHandler::deviceView ( )
inline

Creates a device view of all managed BCs for kernel invocation.

Builds a host_device_vector of BC_DeviceView from each managed BC, transfers it to the specified device backend, and returns an owning t_deviceView wrapper. The returned object is move-only.

Template Parameters
BTarget device backend.
Returns
A t_deviceView<B> owning the device BC array.

Definition at line 542 of file EulerP_BC.hpp.

◆ id2bc()

BC & DNDS::EulerP::BCHandler::id2bc ( Geom::t_index  id)
inline

Looks up a boundary condition by zone ID.

Parameters
idBoundary zone identifier.
Returns
Reference to the BC object for the given zone.

Definition at line 463 of file EulerP_BC.hpp.

◆ to_device()

void DNDS::EulerP::BCHandler::to_device ( DeviceBackend  B)
inline

Transfers all BC values to the specified device backend.

Parameters
BTarget device backend.

Definition at line 478 of file EulerP_BC.hpp.

◆ to_host()

void DNDS::EulerP::BCHandler::to_host ( )
inline

Transfers all BC values to host memory.

Definition at line 470 of file EulerP_BC.hpp.


The documentation for this class was generated from the following file: