Proto  3.2
Public Types | Public Member Functions | Private Attributes | List of all members
Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM > Class Template Reference

Abstract Box-Scope Operator for Mapped Multiblock. More...

#include <Proto_MBBoxOp.H>

Inheritance diagram for Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >:
Inheritance graph
[legend]

Public Types

typedef BoxData< T, C_STATE, MEM > StateData
 
typedef BoxData< T, C_AUX, MEM > AuxData
 
- Public Types inherited from Proto::BoxOp< T, C_STATE, C_AUX, MEM >
typedef BoxData< T, C_STATE, MEM > StateData
 
typedef BoxData< T, C_AUX, MEM > AuxData
 

Public Member Functions

 MBBoxOp (const MBLevelMap< MAP, MEM > &a_map, const MBIndex &a_index)
 Non-Trivial Constructor. More...
 
 MBBoxOp (MBBoxOp< T, MAP, C_STATE, C_AUX, MEM > &&a_bop)=default
 
MBBoxOp< T, MAP, C_STATE, C_AUX, MEM > & operator= (MBBoxOp< T, MAP, C_STATE, C_AUX, MEM > &&a_bop)=default
 
virtual void init ()
 Initialize. More...
 
virtual T spectralRadius () const
 Spectral Radius (User Defined) More...
 
void operator() (StateData &a_output, const StateData &a_state, T a_scale=1.0) const
 Apply (In Place) More...
 
void operator() (StateData &a_output, Array< StateData, DIM > &a_fluxes, const StateData &a_state, T a_scale=1.0) const
 Apply (In Place, Flux Output) More...
 
virtual void apply (StateData &a_output, Array< StateData, DIM > &a_fluxes, const StateData &a_state) const
 
StateData operator() (const StateData &a_state, Box a_range, T a_scale=1.0) const
 Apply (Out of Place) More...
 
void boundaryConditions (Array< StateData, DIM > &a_fluxes, const StateData &a_state) const
 Apply All Boundary Conditions. More...
 
void divergence (StateData &a_divergence, const Array< StateData, DIM > &a_fluxes) const
 
virtual void applyBC (Array< StateData, DIM > &a_fluxes, const StateData &a_state, Face a_face) const
 Apply Boundary Condition (User Specified) More...
 
const MBLevelMap< MAP, MEM > & map () const
 Get Map. More...
 
MBIndex index () const
 Get Index. More...
 
const MBDisjointBoxLayoutlayout () const
 Get Layout. More...
 
unsigned int block () const
 Get Block. More...
 
Box box () const
 Get Box. More...
 
Array< T, DIM > dx () const
 Get Grid Spacing (Mapped Coordinates) More...
 
Array< T, DIM > da () const
 Get Differential Area (Mapped Coordinates) More...
 
const BoxData< double, DIM, MEM > & x () const
 Get Coordinates. More...
 
const BoxData< double, 1, MEM > & jacobian () const
 Get Coordinates. More...
 
- Public Member Functions inherited from Proto::BoxOp< T, C_STATE, C_AUX, MEM >
 BoxOp ()
 Default Constructor. More...
 
 BoxOp (const DisjointBoxLayout &a_layout, const LevelIndex &a_index, T a_dx)
 Non-Trivial Isotropic Constructor. More...
 
 BoxOp (const DisjointBoxLayout &a_layout, const LevelIndex &a_index, Array< T, DIM > a_dx)
 Non-Trivial Anisotropic Constructor. More...
 
 BoxOp (BoxOp< T, C_STATE, C_AUX, MEM > &&a_bop)=default
 
BoxOp< T, C_STATE, C_AUX, MEM > & operator= (BoxOp< T, C_STATE, C_AUX, MEM > &&a_bop)=default
 
void define (const DisjointBoxLayout &a_layout, const LevelIndex &a_index, T a_dx)
 Lazy Isotropic Constructor. More...
 
void define (const DisjointBoxLayout &a_layout, const LevelIndex &a_index, Array< T, DIM > a_dx)
 Lazy Anisotropic Constructor. More...
 
virtual void operator() (StateData &a_output, const StateData &a_state, const AuxData &a_aux, T a_scale=1.0) const
 Apply (In Place) More...
 
virtual void operator() (StateData &a_output, Array< StateData, DIM > &a_fluxes, const StateData &a_state, const AuxData &a_aux, T a_scale=1.0) const
 Apply (In Place, Flux Output) More...
 
virtual StateData operator() (const StateData &a_state, const AuxData &a_aux, Box a_range, T a_scale=1.0) const
 Apply (Out of Place) More...
 
void applyBC (Array< StateData, DIM > &a_fluxes, const StateData &a_state) const
 Apply All Boundary Conditions. More...
 
virtual void flux (StateData &a_flux, const StateData &a_state, const AuxData &a_aux, int a_dir) const
 User Defined Flux. More...
 
virtual void flux (StateData &a_flux, const StateData &a_state, int a_dir) const
 User Defined Flux. More...
 
virtual void source (StateData &a_source, const StateData &a_state, const AuxData &a_aux) const
 User Defined Source. More...
 
virtual void source (StateData &a_source, const StateData &a_state) const
 User Defined Source. More...
 
virtual void diag (StateData &a_diag, const StateData &a_state, const AuxData &a_aux) const
 User Defined Diagonal. More...
 
virtual void diag (StateData &a_diag, const StateData &a_state) const
 User Defined Diagonal. More...
 
void setDiagScale (T a_value)
 TODO: not implemented (see MMB version which has this implemented) More...
 
void setFluxScale (T a_value)
 Set Flux Term Scaling. More...
 
void setTime (T a_time)
 Set Time. More...
 
void setRKStage (unsigned int a_stage)
 Set Runge Kutta Stage. More...
 
diagScale () const
 Read Diagonal Term Scaling. More...
 
fluxScale () const
 Read Flux Term Scaling. More...
 
unsigned int RKStage () const
 Read Flux Term Scaling. More...
 
time () const
 Get Time. More...
 
Array< T, DIM > dx () const
 Get Grid Spacing. More...
 
dxMin () const
 Get Min Grid Spacing. More...
 
dxMax () const
 Get Max Grid Spacing. More...
 
const LevelIndexindex () const
 Get Index. More...
 
const DisjointBoxLayoutlayout () const
 Get Layout. More...
 
const Boxbox () const
 Get Box. More...
 

Private Attributes

MBIndex m_mbIndex
 
const MBLevelMap< MAP, MEM > & m_map
 

Additional Inherited Members

- Static Public Member Functions inherited from Proto::BoxOp< T, C_STATE, C_AUX, MEM >
static constexpr unsigned int numState ()
 Get Number of State Variables. More...
 
static constexpr unsigned int numAux ()
 Get Number of Auxiliary Variables. More...
 
- Protected Attributes inherited from Proto::BoxOp< T, C_STATE, C_AUX, MEM >
m_scaleDiag
 
m_scaleFlux
 
m_time
 
unsigned int m_RKStage
 
LevelIndex m_index
 
DisjointBoxLayout m_layout
 
bool m_definedSrce
 
bool m_definedFlux
 
Array< T, DIM > m_dx
 

Detailed Description

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
class Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >

Abstract Box-Scope Operator for Mapped Multiblock.

MBBoxOp is the class from which all mapped multiblock operators are derived. It is a special case of BoxOp with additional built in capabilities for providing mapped coordinate context.

FIXME: update this for mapped L(phi, rho) = d*D(phi, rho)*I + f*[Div(F(phi, rho)) + S(phi, rho)] L: Full Operator phi: State Variables rho: Auxiliary Variables D: Diagonal Component of L F: Flux Component of L S: Source Component of L I: Identity d: Diagonal Term Scaling f: Flux and Source Term Scaling

TODO: potentially template the op on the data-holder itself (e.g. BoxData) for additional flexibility.

Template Parameters
TDatatype of the data holder (e.g. int, double, etc.)
MAPDatatype of the MBMapOp (this is the same as the MBLevelMap's MAP parameter)
C_STATENumber of state variables
C_AUXNumber of auxiliary (non-state) variables
MEMProto::MemType of the data holder

Member Typedef Documentation

◆ StateData

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
typedef BoxData<T, C_STATE, MEM> Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::StateData

◆ AuxData

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
typedef BoxData<T, C_AUX, MEM> Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::AuxData

Constructor & Destructor Documentation

◆ MBBoxOp() [1/2]

template<typename T , typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::MBBoxOp ( const MBLevelMap< MAP, MEM > &  a_map,
const MBIndex a_index 
)
inline

Non-Trivial Constructor.

References MEMTYPE_DEFAULT.

◆ MBBoxOp() [2/2]

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::MBBoxOp ( MBBoxOp< T, MAP, C_STATE, C_AUX, MEM > &&  a_bop)
inlinedefault

Member Function Documentation

◆ operator=()

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
MBBoxOp<T,MAP,C_STATE,C_AUX,MEM>& Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::operator= ( MBBoxOp< T, MAP, C_STATE, C_AUX, MEM > &&  a_bop)
inlinedefault

◆ init()

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
virtual void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::init ( )
inlinevirtual

Initialize.

User defined function that is called inside of define. Useful for caching things like Stencil instances.

Reimplemented from Proto::BoxOp< T, C_STATE, C_AUX, MEM >.

◆ spectralRadius()

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
virtual T Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::spectralRadius ( ) const
inlinevirtual

Spectral Radius (User Defined)

Approximate spectral radius of the operator. Not required, but Needed for iterative solvers.

Reimplemented from Proto::BoxOp< T, C_STATE, C_AUX, MEM >.

◆ operator()() [1/3]

template<typename T, typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::operator() ( StateData a_output,
const StateData a_state,
a_scale = 1.0 
) const
inlinevirtual

Apply (In Place)

Compute L(phi)

Parameters
outputEvaluated operator (output)
stateState variables

Reimplemented from Proto::BoxOp< T, C_STATE, C_AUX, MEM >.

Referenced by Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::boundaryConditions().

◆ operator()() [2/3]

template<typename T, typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::operator() ( StateData a_output,
Array< StateData, DIM > &  a_fluxes,
const StateData a_state,
a_scale = 1.0 
) const
inlinevirtual

Apply (In Place, Flux Output)

Compute L(phi)

Parameters
outputEvaluated operator (output)
stateState variables

Reimplemented from Proto::BoxOp< T, C_STATE, C_AUX, MEM >.

◆ apply()

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
virtual void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::apply ( StateData a_output,
Array< StateData, DIM > &  a_fluxes,
const StateData a_state 
) const
inlinevirtual

◆ operator()() [3/3]

template<typename T, typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::StateData Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::operator() ( const StateData a_state,
Box  a_range,
a_scale = 1.0 
) const
inlinevirtual

Apply (Out of Place)

Compute L(phi)

Parameters
stateState variables
rangeRange of the output data

Reimplemented from Proto::BoxOp< T, C_STATE, C_AUX, MEM >.

◆ boundaryConditions()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::boundaryConditions ( Array< StateData, DIM > &  a_fluxes,
const StateData a_state 
) const
inline

Apply All Boundary Conditions.

Executes logic for determining which Face of a patch is on a domain boundary. Calls the user defined boundary condition function as needed

References Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::operator()().

◆ divergence()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::divergence ( StateData a_divergence,
const Array< StateData, DIM > &  a_fluxes 
) const
inline

◆ applyBC()

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
virtual void Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::applyBC ( Array< StateData, DIM > &  a_fluxes,
const StateData a_state,
Face  a_face 
) const
inlinevirtual

Apply Boundary Condition (User Specified)

Use this function to specify problem domain boundary conditions. The default behavior is a null-op, leaving the flux argument unchanged.

Reimplemented from Proto::BoxOp< T, C_STATE, C_AUX, MEM >.

References Proto::BoxOp< T, C_STATE, C_AUX, MEM >::flux(), and Proto::BoxOp< T, C_STATE, C_AUX, MEM >::source().

◆ map()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
const MBLevelMap< MAP, MEM > & Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::map ( ) const
inline

Get Map.

◆ index()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
MBIndex Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::index ( ) const
inline

Get Index.

◆ layout()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
const MBDisjointBoxLayout & Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::layout ( ) const
inline

Get Layout.

◆ block()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
unsigned int Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::block ( ) const
inline

Get Block.

◆ box()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Box Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::box ( ) const
inline

Get Box.

◆ dx()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Array< T, DIM > Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::dx ( ) const
inline

Get Grid Spacing (Mapped Coordinates)

◆ da()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Array< T, DIM > Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::da ( ) const
inline

Get Differential Area (Mapped Coordinates)

◆ x()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
const BoxData< double, DIM, MEM > & Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::x ( ) const
inline

Get Coordinates.

Output is immutable and node centered

◆ jacobian()

template<typename T , typename MAP , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
const BoxData< double, 1, MEM > & Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::jacobian ( ) const
inline

Get Coordinates.

Output is immutable and cell averaged

Member Data Documentation

◆ m_mbIndex

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
MBIndex Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::m_mbIndex
private

◆ m_map

template<typename T, typename MAP, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
const MBLevelMap<MAP, MEM>& Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >::m_map
private

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