Block-Structured AMR Software Framework
amrex::DeriveRec Class Reference

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. More...
 

Public Member Functions

 ~DeriveRec ()
 The destructor. More...
 
 DeriveRec (DeriveRec const &)=delete
 
 DeriveRec (DeriveRec &&)=delete
 
DeriveRecoperator= (DeriveRec const &)=delete
 
DeriveRecoperator= (DeriveRec &&)=delete
 
const std::string & name () const noexcept
 The name of the derived type. More...
 
const std::string & variableName (int comp) const noexcept
 The names of components. More...
 
IndexType deriveType () const noexcept
 The IndexType of the derived type. More...
 
DeriveFunc derFunc () const noexcept
 The DeriveFunc used to calculate the derived type. More...
 
DeriveFunc3D derFunc3D () const noexcept
 
DeriveFuncFab derFuncFab () const noexcept
 
DeriveFuncMF derFuncMF () const noexcept
 
DeriveBoxMap boxMap () const noexcept
 Maps state data box to derived data box. More...
 
Interpolaterinterp () const noexcept
 Type of interpolater to use in computing derived type. More...
 
int numDerive () const noexcept
 Number of components in the derived type. More...
 
int numRange () const noexcept
 Number of different chunks of state data needed for derived type. More...
 
int numState () const noexcept
 Total number of state variables needed for derived type. More...
 
const intgetBC () const noexcept
 The boundary conditions. More...
 
const intgetBC3D () const noexcept
 
void getRange (int k, int &state_indx, int &src_comp, int &num_comp) const
 Sets state_indx, src_comp and num_comp for the kth range (or chunk) of state data components needed to calculate the derived quantity. More...
 
 DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater *interp=&pc_interp)
 Constructor. More...
 
 DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFunc3D der_func_3d, DeriveBoxMap box_map, Interpolater *interp=&pc_interp)
 
 DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFuncFab der_func_fab, DeriveBoxMap box_map, Interpolater *interp=&pc_interp)
 
 DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveFuncMF der_func_mf, DeriveBoxMap box_map, Interpolater *interp=&pc_interp)
 
 DeriveRec (std::string name, IndexType result_type, int nvar_derive, DeriveRec::DeriveBoxMap box_map)
 Constructor without a Fortran function. More...
 
 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)
 Constructor. More...
 
 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)
 
 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)
 
 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)
 
void addRange (const DescriptorList &d_list, int state_indx, int src_comp, int num_comp)
 
void buildBC (const DescriptorList &d_list)
 
void buildBC3D (const DescriptorList &d_list)
 

Static Public Member Functions

static Box TheSameBox (const Box &box) noexcept
 
static Box GrowBoxByOne (const Box &box) noexcept
 

Private Attributes

std::string derive_name
 Name of derived quantity. More...
 
Vector< std::string > variable_names
 Names of derived variables. More...
 
IndexType der_type
 Type of derived quantity. More...
 
int n_derive = 0
 Number of components in derived quantity. More...
 
DeriveFunc func = nullptr
 Function that computes derived quantity from state variables. More...
 
DeriveFunc3D func_3d = nullptr
 
DeriveFuncFab func_fab = nullptr
 
DeriveFuncMF func_mf = nullptr
 
Interpolatermapper = nullptr
 Interpolater for mapping crse grid derived data to finer levels. More...
 
DeriveBoxMap bx_map = nullptr
 Box mapper that specifies constituent region given derived region. More...
 
int n_state = 0
 Total number of state variables. More...
 
int nsr = 0
 Number of state ranges. More...
 
StateRangerng = nullptr
 List of state data subranges required to derive given quantity. More...
 
intbcr = nullptr
 Array of bndry types. More...
 
intbcr3D = nullptr
 

Friends

class DeriveList
 

Detailed Description

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 ...

Member Typedef Documentation

◆ DeriveBoxMap

using amrex::DeriveRec::DeriveBoxMap = std::function<Box(const Box&)>

A pointer to function taking and returning a Box.

Constructor & Destructor Documentation

◆ ~DeriveRec()

amrex::DeriveRec::~DeriveRec ( )

The destructor.

◆ DeriveRec() [1/11]

amrex::DeriveRec::DeriveRec ( DeriveRec const &  )
delete

◆ DeriveRec() [2/11]

amrex::DeriveRec::DeriveRec ( DeriveRec &&  )
delete

◆ DeriveRec() [3/11]

amrex::DeriveRec::DeriveRec ( std::string  name,
IndexType  result_type,
int  nvar_derive,
DeriveFunc  der_func,
DeriveBoxMap  box_map,
Interpolater interp = &pc_interp 
)

Constructor.

Parameters
name
result_type
nvar_derive
der_func
box_map
interp

◆ DeriveRec() [4/11]

amrex::DeriveRec::DeriveRec ( std::string  name,
IndexType  result_type,
int  nvar_derive,
DeriveFunc3D  der_func_3d,
DeriveBoxMap  box_map,
Interpolater interp = &pc_interp 
)

◆ DeriveRec() [5/11]

amrex::DeriveRec::DeriveRec ( std::string  name,
IndexType  result_type,
int  nvar_derive,
DeriveFuncFab  der_func_fab,
DeriveBoxMap  box_map,
Interpolater interp = &pc_interp 
)

◆ DeriveRec() [6/11]

amrex::DeriveRec::DeriveRec ( std::string  name,
IndexType  result_type,
int  nvar_derive,
DeriveFuncMF  der_func_mf,
DeriveBoxMap  box_map,
Interpolater interp = &pc_interp 
)

◆ DeriveRec() [7/11]

amrex::DeriveRec::DeriveRec ( std::string  name,
IndexType  result_type,
int  nvar_derive,
DeriveRec::DeriveBoxMap  box_map 
)

Constructor without a Fortran function.

Parameters
name
result_type
nvar_derive
box_map

◆ DeriveRec() [8/11]

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 
)

Constructor.

Parameters
name
result_type
nvar_derive
var_names
der_func
box_map
interp

◆ DeriveRec() [9/11]

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 
)

◆ DeriveRec() [10/11]

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 
)

◆ DeriveRec() [11/11]

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 
)

Member Function Documentation

◆ addRange()

void amrex::DeriveRec::addRange ( const DescriptorList d_list,
int  state_indx,
int  src_comp,
int  num_comp 
)

◆ boxMap()

DeriveRec::DeriveBoxMap amrex::DeriveRec::boxMap ( ) const
noexcept

Maps state data box to derived data box.

◆ buildBC()

void amrex::DeriveRec::buildBC ( const DescriptorList d_list)

◆ buildBC3D()

void amrex::DeriveRec::buildBC3D ( const DescriptorList d_list)

◆ derFunc()

DeriveFunc amrex::DeriveRec::derFunc ( ) const
noexcept

The DeriveFunc used to calculate the derived type.

◆ derFunc3D()

DeriveFunc3D amrex::DeriveRec::derFunc3D ( ) const
noexcept

◆ derFuncFab()

DeriveFuncFab amrex::DeriveRec::derFuncFab ( ) const
noexcept

◆ derFuncMF()

DeriveFuncMF amrex::DeriveRec::derFuncMF ( ) const
noexcept

◆ deriveType()

IndexType amrex::DeriveRec::deriveType ( ) const
noexcept

The IndexType of the derived type.

◆ getBC()

const int * amrex::DeriveRec::getBC ( ) const
noexcept

The boundary conditions.

◆ getBC3D()

const int * amrex::DeriveRec::getBC3D ( ) const
noexcept

◆ getRange()

void amrex::DeriveRec::getRange ( int  k,
int state_indx,
int src_comp,
int num_comp 
) const

Sets state_indx, src_comp and num_comp for the kth range (or chunk) of state data components needed to calculate the derived quantity.

Parameters
k
state_indx
src_comp
num_comp

◆ GrowBoxByOne()

Box amrex::DeriveRec::GrowBoxByOne ( const Box box)
staticnoexcept

◆ interp()

Interpolater * amrex::DeriveRec::interp ( ) const
noexcept

Type of interpolater to use in computing derived type.

◆ name()

const std::string & amrex::DeriveRec::name ( ) const
noexcept

The name of the derived type.

◆ numDerive()

int amrex::DeriveRec::numDerive ( ) const
noexcept

Number of components in the derived type.

◆ numRange()

int amrex::DeriveRec::numRange ( ) const
noexcept

Number of different chunks of state data needed for derived type.

◆ numState()

int amrex::DeriveRec::numState ( ) const
noexcept

Total number of state variables needed for derived type.

◆ operator=() [1/2]

DeriveRec& amrex::DeriveRec::operator= ( DeriveRec &&  )
delete

◆ operator=() [2/2]

DeriveRec& amrex::DeriveRec::operator= ( DeriveRec const &  )
delete

◆ TheSameBox()

Box amrex::DeriveRec::TheSameBox ( const Box box)
staticnoexcept

◆ variableName()

const std::string & amrex::DeriveRec::variableName ( int  comp) const
noexcept

The names of components.

Parameters
comp

Friends And Related Function Documentation

◆ DeriveList

friend class DeriveList
friend

Member Data Documentation

◆ bcr

int* amrex::DeriveRec::bcr = nullptr
private

Array of bndry types.

◆ bcr3D

int* amrex::DeriveRec::bcr3D = nullptr
private

◆ bx_map

DeriveBoxMap amrex::DeriveRec::bx_map = nullptr
private

Box mapper that specifies constituent region given derived region.

◆ der_type

IndexType amrex::DeriveRec::der_type
private

Type of derived quantity.

◆ derive_name

std::string amrex::DeriveRec::derive_name
private

Name of derived quantity.

◆ func

DeriveFunc amrex::DeriveRec::func = nullptr
private

Function that computes derived quantity from state variables.

◆ func_3d

DeriveFunc3D amrex::DeriveRec::func_3d = nullptr
private

◆ func_fab

DeriveFuncFab amrex::DeriveRec::func_fab = nullptr
private

◆ func_mf

DeriveFuncMF amrex::DeriveRec::func_mf = nullptr
private

◆ mapper

Interpolater* amrex::DeriveRec::mapper = nullptr
private

Interpolater for mapping crse grid derived data to finer levels.

◆ n_derive

int amrex::DeriveRec::n_derive = 0
private

Number of components in derived quantity.

◆ n_state

int amrex::DeriveRec::n_state = 0
private

Total number of state variables.

◆ nsr

int amrex::DeriveRec::nsr = 0
private

Number of state ranges.

◆ rng

StateRange* amrex::DeriveRec::rng = nullptr
private

List of state data subranges required to derive given quantity.

◆ variable_names

Vector<std::string> amrex::DeriveRec::variable_names
private

Names of derived variables.


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