ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
CENTERED2 Struct Reference

#include <ERF_Interpolation_UPW.H>

Collaboration diagram for CENTERED2:

Public Member Functions

 CENTERED2 (const amrex::Array4< const amrex::Real > &phi)
 
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::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::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::Real) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate (const amrex::Real &s, const amrex::Real &sm1) 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)
inline
12  : 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
76  {
77  // Averages and diffs
78  amrex::Real a1 = (s + sm1);
79 
80  // Interpolated value
81  return ( g1*a1 );
82  }
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:

◆ 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 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:74
Here is the call 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 amrex::Real   
) const
inline
43  {
44  // Data to interpolate on
45  amrex::Real s = m_phi(i , j , k , qty_index);
46  amrex::Real sm1 = m_phi(i , j-1, k , qty_index);
47 
48  // Interpolate lo
49  val_lo = Evaluate(s,sm1);
50  }
Here is the call 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 amrex::Real   
) const
inline
62  {
63  // Data to interpolate on
64  amrex::Real s = m_phi(i , j , k , qty_index);
65  amrex::Real sm1 = m_phi(i , j , k-1, qty_index);
66 
67  // Interpolate lo
68  val_lo = Evaluate(s,sm1);
69  }
Here is the call 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: