Proto  3.2
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Proto::BoxOp< T, C_STATE, C_AUX, MEM > Class Template Reference

Abstract Box-Scope Operator. More...

#include <Proto_BoxOp.H>

Inheritance diagram for Proto::BoxOp< T, 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 Member Functions

 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 init ()
 Initialize. More...
 
virtual T spectralRadius () const
 Spectral Radius (User Defined) 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, const StateData &a_state, 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 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 StateData operator() (const StateData &a_state, const AuxData &a_aux, Box a_range, T a_scale=1.0) const
 Apply (Out of Place) More...
 
virtual StateData operator() (const StateData &a_state, 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 applyBC (Array< StateData, DIM > &a_fluxes, const StateData &a_state, Face a_face) const
 Apply User Specified Boundary Condition. 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...
 

Static Public Member Functions

static constexpr unsigned int numState ()
 Get Number of State Variables. More...
 
static constexpr unsigned int numAux ()
 Get Number of Auxiliary Variables. More...
 

Protected Attributes

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, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
class Proto::BoxOp< T, C_STATE, C_AUX, MEM >

Abstract Box-Scope Operator.

BoxOp is the class from which all operators on single patches, levels of patches, and AMR hierarchies are derived. Representable operators are of the form:

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.)
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, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
typedef BoxData<T, C_STATE, MEM> Proto::BoxOp< T, C_STATE, C_AUX, MEM >::StateData

◆ AuxData

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

Constructor & Destructor Documentation

◆ BoxOp() [1/4]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Proto::BoxOp< T, C_STATE, C_AUX, MEM >::BoxOp ( )
inline

Default Constructor.

Referenced by Proto::BoxOp< T, C_STATE, C_AUX, MEM >::box().

◆ BoxOp() [2/4]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Proto::BoxOp< T, C_STATE, C_AUX, MEM >::BoxOp ( const DisjointBoxLayout a_layout,
const LevelIndex a_index,
a_dx 
)
inline

Non-Trivial Isotropic Constructor.

Parameters
dxGrid spacing

◆ BoxOp() [3/4]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
Proto::BoxOp< T, C_STATE, C_AUX, MEM >::BoxOp ( const DisjointBoxLayout a_layout,
const LevelIndex a_index,
Array< T, DIM >  a_dx 
)
inline

Non-Trivial Anisotropic Constructor.

Parameters
dxGrid spacing

◆ BoxOp() [4/4]

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

Member Function Documentation

◆ numState()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
static constexpr unsigned int Proto::BoxOp< T, C_STATE, C_AUX, MEM >::numState ( )
inlinestatic

Get Number of State Variables.

Allows C_STATE to be known after template parameter binding

◆ numAux()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
static constexpr unsigned int Proto::BoxOp< T, C_STATE, C_AUX, MEM >::numAux ( )
inlinestatic

Get Number of Auxiliary Variables.

Allows C_AUX to be known after template parameter binding

◆ operator=()

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

◆ define() [1/2]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::define ( const DisjointBoxLayout a_layout,
const LevelIndex a_index,
a_dx 
)
inline

Lazy Isotropic Constructor.

Parameters
dxGrid spacing

◆ define() [2/2]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::define ( const DisjointBoxLayout a_layout,
const LevelIndex a_index,
Array< T, DIM >  a_dx 
)
inline

Lazy Anisotropic Constructor.

Parameters
dxGrid spacing

◆ init()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
virtual void Proto::BoxOp< T, 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 in Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >.

◆ spectralRadius()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
virtual T Proto::BoxOp< T, 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 in Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >.

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

◆ operator()() [1/6]

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

Apply (In Place)

Compute L(phi, rho)

Parameters
outputEvaluated operator (output)
stateState variables
auxAuxiliary variables

Referenced by Proto::BoxOp< T, C_STATE, C_AUX, MEM >::spectralRadius().

◆ operator()() [2/6]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, 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 in Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >.

◆ operator()() [3/6]

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

Apply (In Place, Flux Output)

Compute L(phi, rho)

Parameters
outputEvaluated operator (output)
stateState variables
auxAuxiliary variables

◆ operator()() [4/6]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, 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 in Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >.

◆ operator()() [5/6]

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

Apply (Out of Place)

Compute L(phi, rho).

Parameters
stateState variables
auxAuxiliary variables
rangeRange of the output data

◆ operator()() [6/6]

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
BoxOp< T, C_STATE, C_AUX, MEM >::StateData Proto::BoxOp< T, 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 in Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >.

◆ applyBC() [1/2]

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

Apply All Boundary Conditions.

◆ applyBC() [2/2]

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

Apply User Specified Boundary Condition.

Reimplemented in Proto::MBBoxOp< T, MAP, C_STATE, C_AUX, MEM >.

◆ flux() [1/2]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::flux ( StateData a_flux,
const StateData a_state,
const AuxData a_aux,
int  a_dir 
) const
inlinevirtual

User Defined Flux.

Compute F(phi, rho) in the direction dir

Parameters
fluxComputed flux (output)
stateState variables
auxAuxiliary variables
dirDirection in [0, DIM)

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

◆ flux() [2/2]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::flux ( StateData a_flux,
const StateData a_state,
int  a_dir 
) const
inlinevirtual

User Defined Flux.

Compute F(phi) in the direction dir

Parameters
fluxComputed flux (output)
stateState variables
dirDirection in [0, DIM)

◆ source() [1/2]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::source ( StateData a_source,
const StateData a_state,
const AuxData a_aux 
) const
inlinevirtual

User Defined Source.

Compute S(phi, rho)

Parameters
sourceComputed flux (output)
stateState variables
auxAuxiliary variables

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

◆ source() [2/2]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::source ( StateData a_source,
const StateData a_state 
) const
inlinevirtual

User Defined Source.

Compute S(phi)

Parameters
sourceComputed flux (output)
stateState variables

◆ diag() [1/2]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::diag ( StateData a_diag,
const StateData a_state,
const AuxData a_aux 
) const
inlinevirtual

User Defined Diagonal.

Compute D(phi, rho)

Parameters
diagComputed flux (output)
stateState variables
auxAuxiliary variables

◆ diag() [2/2]

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::diag ( StateData a_diag,
const StateData a_state 
) const
inlinevirtual

User Defined Diagonal.

Compute D(phi)

Parameters
diagComputed flux (output)
stateState variables

◆ setDiagScale()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::setDiagScale ( a_value)
inline

TODO: not implemented (see MMB version which has this implemented)

Set Diagonal Term Scaling.

Set Diagonal Term Scaling Sets the value of d

◆ setFluxScale()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::setFluxScale ( a_value)
inline

Set Flux Term Scaling.

Sets the value of f

◆ setTime()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::setTime ( a_time)
inline

Set Time.

◆ setRKStage()

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
void Proto::BoxOp< T, C_STATE, C_AUX, MEM >::setRKStage ( unsigned int  a_stage)
inline

Set Runge Kutta Stage.

◆ diagScale()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::diagScale ( ) const
inline

Read Diagonal Term Scaling.

References Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_scaleDiag.

◆ fluxScale()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::fluxScale ( ) const
inline

Read Flux Term Scaling.

References Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_scaleFlux.

◆ RKStage()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
unsigned int Proto::BoxOp< T, C_STATE, C_AUX, MEM >::RKStage ( ) const
inline

Read Flux Term Scaling.

References Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_RKStage.

◆ time()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::time ( ) const
inline

◆ dx()

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

Get Grid Spacing.

Referenced by Proto::BoxOp< T, C_STATE, C_AUX, MEM >::time().

◆ dxMin()

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::dxMin ( ) const
inline

Get Min Grid Spacing.

◆ dxMax()

template<typename T , unsigned int C_STATE, unsigned int C_AUX, MemType MEM>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::dxMax ( ) const
inline

Get Max Grid Spacing.

Get Grid Spacing.

◆ index()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
const LevelIndex& Proto::BoxOp< T, C_STATE, C_AUX, MEM >::index ( ) const
inline

◆ layout()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
const DisjointBoxLayout& Proto::BoxOp< T, C_STATE, C_AUX, MEM >::layout ( ) const
inline

◆ box()

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
const Box& Proto::BoxOp< T, C_STATE, C_AUX, MEM >::box ( ) const
inline

Member Data Documentation

◆ m_scaleDiag

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_scaleDiag
protected

DEPRECATED Mapped Multiblock Utilities

Referenced by Proto::BoxOp< T, C_STATE, C_AUX, MEM >::diagScale().

◆ m_scaleFlux

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_scaleFlux
protected

◆ m_time

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
T Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_time
protected

◆ m_RKStage

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
unsigned int Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_RKStage
protected

◆ m_index

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
LevelIndex Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_index
protected

◆ m_layout

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
DisjointBoxLayout Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_layout
protected

◆ m_definedSrce

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
bool Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_definedSrce
mutableprotected

◆ m_definedFlux

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
bool Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_definedFlux
mutableprotected

◆ m_dx

template<typename T, unsigned int C_STATE, unsigned int C_AUX, MemType MEM = MEMTYPE_DEFAULT>
Array<T, DIM> Proto::BoxOp< T, C_STATE, C_AUX, MEM >::m_dx
protected

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