ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CENTERED2 Struct Reference

#include <ERF_Interpolation_UPW.H>

Collaboration diagram for CENTERED2:

Public Member Functions

 CENTERED2 (const amrex::Array4< const amrex::Real > &phi, const amrex::Real)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInX (const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInY (const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInZ (const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate (const amrex::Real &s, const amrex::Real &sm1) const
 
int GetUpwindCellNumber () const
 

Private Attributes

amrex::Array4< const amrex::Real > m_phi
 

Static Private Attributes

static constexpr amrex::Real g1 =(0.5)
 

Detailed Description

Interpolation operators used for 2nd order centered scheme

Constructor & Destructor Documentation

◆ CENTERED2()

CENTERED2::CENTERED2 ( const amrex::Array4< const amrex::Real > &  phi,
const amrex::Real   
)
inline
13  : m_phi(phi) {}
amrex::Array4< const amrex::Real > m_phi
Definition: ERF_Interpolation_UPW.H:85

Member Function Documentation

◆ Evaluate()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real CENTERED2::Evaluate ( const amrex::Real &  s,
const amrex::Real &  sm1 
) const
inline
74  {
75  // Averages and diffs
76  amrex::Real a1 = (s + sm1);
77 
78  // Interpolated value
79  return ( g1*a1 );
80  }
static constexpr amrex::Real g1
Definition: ERF_Interpolation_UPW.H:86

Referenced by InterpolateInX(), InterpolateInY(), and InterpolateInZ().

Here is the caller graph for this function:

◆ GetUpwindCellNumber()

int CENTERED2::GetUpwindCellNumber ( ) const
inline
82 {return 1;}

◆ InterpolateInX()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED2::InterpolateInX ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real &  val_lo,
amrex::Real   
) const
inline
24  {
25  // Data to interpolate on
26  amrex::Real s = m_phi(i , j , k , qty_index);
27  amrex::Real sm1 = m_phi(i-1, j , k , qty_index);
28 
29  // Interpolate lo
30  val_lo = Evaluate(s,sm1);
31  }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate(const amrex::Real &s, const amrex::Real &sm1) const
Definition: ERF_Interpolation_UPW.H:72

Referenced by EBAdvectionSrcForScalarsWrapper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterpolateInY()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED2::InterpolateInY ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real &  val_lo,
amrex::Real   
) const
inline
42  {
43  // Data to interpolate on
44  amrex::Real s = m_phi(i , j , k , qty_index);
45  amrex::Real sm1 = m_phi(i , j-1, k , qty_index);
46 
47  // Interpolate lo
48  val_lo = Evaluate(s,sm1);
49  }

Referenced by EBAdvectionSrcForScalarsWrapper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterpolateInZ()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED2::InterpolateInZ ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real &  val_lo,
amrex::Real   
) const
inline
60  {
61  // Data to interpolate on
62  amrex::Real s = m_phi(i , j , k , qty_index);
63  amrex::Real sm1 = m_phi(i , j , k-1, qty_index);
64 
65  // Interpolate lo
66  val_lo = Evaluate(s,sm1);
67  }

Referenced by EBAdvectionSrcForScalarsWrapper().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ g1

constexpr amrex::Real CENTERED2::g1 =(0.5)
staticconstexprprivate

Referenced by Evaluate().

◆ m_phi

amrex::Array4<const amrex::Real> CENTERED2::m_phi
private

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