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

#include <ERF_Interpolation_UPW.H>

Collaboration diagram for CENTERED4:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE CENTERED4 (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 &sp1, const amrex::Real &s, const amrex::Real &sm1, const amrex::Real &sm2) const
 
int GetUpwindCellNumber () const
 

Private Attributes

amrex::Array4< const amrex::Realm_phi
 

Static Private Attributes

static constexpr amrex::Real g1 =(amrex::Real(7.0)/amrex::Real(12.0))
 
static constexpr amrex::Real g2 =(amrex::Real(1)/amrex::Real(12.0))
 

Detailed Description

Interpolation operators used for 4th order centered scheme

Constructor & Destructor Documentation

◆ CENTERED4()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE CENTERED4::CENTERED4 ( const amrex::Array4< const amrex::Real > &  phi,
const amrex::Real   
)
inline
340  : m_phi(phi) {}
amrex::Array4< const amrex::Real > m_phi
Definition: ERF_Interpolation_UPW.H:421

Member Function Documentation

◆ Evaluate()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real CENTERED4::Evaluate ( const amrex::Real sp1,
const amrex::Real s,
const amrex::Real sm1,
const amrex::Real sm2 
) const
inline
409  {
410  // Averages and diffs
411  amrex::Real a1 = (s + sm1);
412  amrex::Real a2 = (sp1 + sm2);
413 
414  // Interpolated value
415  return ( g1*a1 - g2*a2 );
416  }
amrex::Real Real
Definition: ERF_ShocInterface.H:19
real(c_double), parameter a2
Definition: ERF_module_model_constants.F90:95
static constexpr amrex::Real g1
Definition: ERF_Interpolation_UPW.H:422
static constexpr amrex::Real g2
Definition: ERF_Interpolation_UPW.H:423

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

Here is the caller graph for this function:

◆ GetUpwindCellNumber()

int CENTERED4::GetUpwindCellNumber ( ) const
inline
418 {return 2;}

◆ InterpolateInX()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED4::InterpolateInX ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real val_lo,
amrex::Real   
) const
inline
351  {
352  // Data to interpolate on
353  amrex::Real sp1 = m_phi(i+1, j , k , qty_index);
354  amrex::Real s = m_phi(i , j , k , qty_index);
355  amrex::Real sm1 = m_phi(i-1, j , k , qty_index);
356  amrex::Real sm2 = m_phi(i-2, j , k , qty_index);
357 
358  // Interpolate lo
359  val_lo = Evaluate(sp1,s,sm1,sm2);
360  }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate(const amrex::Real &sp1, const amrex::Real &s, const amrex::Real &sm1, const amrex::Real &sm2) const
Definition: ERF_Interpolation_UPW.H:405
Here is the call graph for this function:

◆ InterpolateInY()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED4::InterpolateInY ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real val_lo,
amrex::Real   
) const
inline
371  {
372  // Data to interpolate on
373  amrex::Real sp1 = m_phi(i , j+1, k , qty_index);
374  amrex::Real s = m_phi(i , j , k , qty_index);
375  amrex::Real sm1 = m_phi(i , j-1, k , qty_index);
376  amrex::Real sm2 = m_phi(i , j-2, k , qty_index);
377 
378  // Interpolate lo
379  val_lo = Evaluate(sp1,s,sm1,sm2);
380  }
Here is the call graph for this function:

◆ InterpolateInZ()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED4::InterpolateInZ ( const int &  i,
const int &  j,
const int &  k,
const int &  qty_index,
amrex::Real val_lo,
amrex::Real   
) const
inline
391  {
392  // Data to interpolate on
393  amrex::Real sp1 = m_phi(i , j , k+1, qty_index);
394  amrex::Real s = m_phi(i , j , k , qty_index);
395  amrex::Real sm1 = m_phi(i , j , k-1, qty_index);
396  amrex::Real sm2 = m_phi(i , j , k-2, qty_index);
397 
398  // Interpolate lo
399  val_lo = Evaluate(sp1,s,sm1,sm2);
400  }
Here is the call graph for this function:

Member Data Documentation

◆ g1

constexpr amrex::Real CENTERED4::g1 =(amrex::Real(7.0)/amrex::Real(12.0))
staticconstexprprivate

Referenced by Evaluate().

◆ g2

constexpr amrex::Real CENTERED4::g2 =(amrex::Real(1)/amrex::Real(12.0))
staticconstexprprivate

Referenced by Evaluate().

◆ m_phi

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

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