![]() |
Block-Structured AMR Software Framework
|
Derived Type Record. More...
#include <AMReX_Derive.H>
Classes | |
| struct | StateRange |
| An element of a linked list to point to state quantities in AmrLevels. More... | |
Public Types | |
| using | DeriveBoxMap = std::function< Box(const Box &)> |
| A pointer to function taking and returning a Box. | |
Public Member Functions | |
| ~DeriveRec () | |
| The destructor. | |
| DeriveRec (DeriveRec const &)=delete | |
| Non-copyable; derived metadata owns non-trivial resources. | |
| DeriveRec (DeriveRec &&)=delete | |
| Non-movable to keep internal pointers/registrations stable. | |
| DeriveRec & | operator= (DeriveRec const &)=delete |
| Copy assignment disabled for the same reason as the copy constructor. | |
| DeriveRec & | operator= (DeriveRec &&)=delete |
| Move assignment disabled to avoid dangling references inside registries. | |
| const std::string & | name () const noexcept |
| The name of the derived type. | |
| const std::string & | variableName (int comp) const noexcept |
Return the name of derived component comp. | |
| IndexType | deriveType () const noexcept |
| The IndexType of the derived type. | |
| DeriveFunc | derFunc () const noexcept |
| The DeriveFunc used to calculate the derived type. | |
| DeriveFunc3D | derFunc3D () const noexcept |
| Dimension-agnostic version of derFunc() that always takes 3-component bounds. | |
| DeriveFuncFab | derFuncFab () const noexcept |
| Callable that operates on a FAB-sized box instead of raw pointers. | |
| DeriveFuncMF | derFuncMF () const noexcept |
| MultiFab variant that fills directly without per-box callbacks. | |
| DeriveBoxMap | boxMap () const noexcept |
| Maps state data box to derived data box. | |
| Interpolater * | interp () const noexcept |
| Type of interpolater to use in computing derived type. | |
| int | numDerive () const noexcept |
| Number of components in the derived type. | |
| int | numRange () const noexcept |
| Number of different chunks of state data needed for derived type. | |
| int | numState () const noexcept |
| Total number of state variables needed for derived type. | |
| const int * | getBC () const noexcept |
| The boundary conditions. | |
| const int * | getBC3D () const noexcept |
| Boundary-condition array padded/truncated to three entries. | |
| void | getRange (int k, int &state_indx, int &src_comp, int &num_comp) const |
Describe which chunk of state data is needed for derived component range k. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| Construct a record driven by a Fortran-style DeriveFunc. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFunc3D der_func_3d, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| Construct a record using a dimension-agnostic DeriveFunc3D callback. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFuncFab der_func_fab, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| Construct a record whose implementation operates directly on FABs. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFuncMF der_func_mf, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| Construct a record whose implementation operates on MultiFabs. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveRec::DeriveBoxMap box_map) | |
| Construct a placeholder record without attaching a callable yet. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, Vector< std::string > const &var_names, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| Same as the basic constructor but labels each derived component. | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, Vector< std::string > const &var_names, DeriveFunc3D der_func_3d, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| 3-D callback variant (parameters mirror the previous constructor). | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, Vector< std::string > const &var_names, DeriveFuncFab der_func_fab, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| FAB callback variant (parameters mirror the previous constructor). | |
| DeriveRec (std::string name, IndexType result_type, int nvar_derive, Vector< std::string > const &var_names, DeriveFuncMF der_func_mf, DeriveBoxMap box_map, Interpolater *interp=&pc_interp) | |
| MultiFab callback variant (parameters mirror the previous constructor). | |
| void | addRange (const DescriptorList &d_list, int state_indx, int src_comp, int num_comp) |
| Append another chunk of state data requirements. | |
| void | buildBC (const DescriptorList &d_list) |
Build the 1D/2D BC arrays from the registered state descriptors d_list. | |
| void | buildBC3D (const DescriptorList &d_list) |
Build the 3D BC arrays from the registered state descriptors d_list. | |
Static Public Member Functions | |
| static Box | TheSameBox (const Box &box) noexcept |
| Identity mapping from destination to source boxes. | |
| static Box | GrowBoxByOne (const Box &box) noexcept |
| Convenience mapper that grows the supplied box by one cell in every direction. | |
Friends | |
| class | DeriveList |
Derived Type Record.
Computes quantities derived from state data.
DeriveRec is designed to compute quantities which can be derived from the state data contained in AmrLevel and its derivatives. Some examples might be kinetic energy, vorticity, concentration gradients ...
| using amrex::DeriveRec::DeriveBoxMap = std::function<Box(const Box&)> |
A pointer to function taking and returning a Box.
| amrex::DeriveRec::~DeriveRec | ( | ) |
The destructor.
|
delete |
Non-copyable; derived metadata owns non-trivial resources.
|
delete |
Non-movable to keep internal pointers/registrations stable.
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| DeriveFunc | der_func, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
Construct a record driven by a Fortran-style DeriveFunc.
| name | Derived quantity name (unique registry key). |
| result_type | Index type describing the derived FAB layout. |
| nvar_derive | Number of components produced by the derive function. |
| der_func | Function pointer invoked to compute the quantity. |
| box_map | Mapping from destination boxes back to source boxes. |
| interp | Interpolater used when populating finer levels (defaults to piecewise-constant). |
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| DeriveFunc3D | der_func_3d, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
Construct a record using a dimension-agnostic DeriveFunc3D callback.
Parameters mirror the DeriveFunc constructor but der_func_3d follows the 3-D argument shape.
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| DeriveFuncFab | der_func_fab, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
Construct a record whose implementation operates directly on FABs.
Parameters match the scalar constructor but der_func_fab is a callable accepting FABs.
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| DeriveFuncMF | der_func_mf, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
Construct a record whose implementation operates on MultiFabs.
Parameters match the scalar constructor but der_func_mf takes MultiFabs.
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| DeriveRec::DeriveBoxMap | box_map | ||
| ) |
Construct a placeholder record without attaching a callable yet.
| name | Derived quantity name. |
| result_type | Index type describing the derived FAB layout. |
| nvar_derive | Number of components produced. |
| box_map | Mapping from destination boxes back to source boxes. |
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| Vector< std::string > const & | var_names, | ||
| DeriveFunc | der_func, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
Same as the basic constructor but labels each derived component.
| name | Derived quantity name. |
| result_type | Index type describing the derived FAB layout. |
| nvar_derive | Number of components produced. |
| var_names | Human-readable names for each component. |
| der_func | Fortran-style callback. |
| box_map | Mapping from destination to source boxes. |
| interp | Interpolater override (defaults to piecewise-constant). |
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| Vector< std::string > const & | var_names, | ||
| DeriveFunc3D | der_func_3d, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
3-D callback variant (parameters mirror the previous constructor).
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| Vector< std::string > const & | var_names, | ||
| DeriveFuncFab | der_func_fab, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
FAB callback variant (parameters mirror the previous constructor).
| amrex::DeriveRec::DeriveRec | ( | std::string | name, |
| IndexType | result_type, | ||
| int | nvar_derive, | ||
| Vector< std::string > const & | var_names, | ||
| DeriveFuncMF | der_func_mf, | ||
| DeriveBoxMap | box_map, | ||
| Interpolater * | interp = &pc_interp |
||
| ) |
MultiFab callback variant (parameters mirror the previous constructor).
| void amrex::DeriveRec::addRange | ( | const DescriptorList & | d_list, |
| int | state_indx, | ||
| int | src_comp, | ||
| int | num_comp | ||
| ) |
Append another chunk of state data requirements.
| d_list | Descriptor registry providing metadata. |
| state_indx | Index into the descriptor list. |
| src_comp | Starting component inside the chosen state descriptor. |
| num_comp | Number of components to sample for this range. |
|
noexcept |
Maps state data box to derived data box.
| void amrex::DeriveRec::buildBC | ( | const DescriptorList & | d_list | ) |
Build the 1D/2D BC arrays from the registered state descriptors d_list.
| void amrex::DeriveRec::buildBC3D | ( | const DescriptorList & | d_list | ) |
Build the 3D BC arrays from the registered state descriptors d_list.
|
noexcept |
The DeriveFunc used to calculate the derived type.
|
noexcept |
Dimension-agnostic version of derFunc() that always takes 3-component bounds.
|
noexcept |
Callable that operates on a FAB-sized box instead of raw pointers.
|
noexcept |
MultiFab variant that fills directly without per-box callbacks.
|
noexcept |
The IndexType of the derived type.
|
noexcept |
The boundary conditions.
|
noexcept |
Boundary-condition array padded/truncated to three entries.
Describe which chunk of state data is needed for derived component range k.
| k | Range index in [0,numRange()). |
| state_indx | Output: index into the state descriptor array. |
| src_comp | Output: starting component in the chosen state. |
| num_comp | Output: number of components to read. |
Convenience mapper that grows the supplied box by one cell in every direction.
| box | Destination box; the return value is grow(box,1). |
|
noexcept |
Type of interpolater to use in computing derived type.
|
noexcept |
The name of the derived type.
|
noexcept |
Number of components in the derived type.
|
noexcept |
Number of different chunks of state data needed for derived type.
|
noexcept |
Total number of state variables needed for derived type.
Move assignment disabled to avoid dangling references inside registries.
Copy assignment disabled for the same reason as the copy constructor.
Identity mapping from destination to source boxes.
| box | Destination box passed to the callback. |
|
noexcept |
Return the name of derived component comp.
|
friend |