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

#include <ERF_Interpolation_UPW.H>

Collaboration diagram for CENTERED6:

Public Member Functions

 CENTERED6 (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 &sp2, const amrex::Real &sp1, const amrex::Real &s, const amrex::Real &sm1, const amrex::Real &sm2, const amrex::Real &sm3) const
 
int GetUpwindCellNumber () const
 

Private Attributes

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

Static Private Attributes

static constexpr amrex::Real g1 =(37.0/60.0)
 
static constexpr amrex::Real g2 =(2.0/15.0)
 
static constexpr amrex::Real g3 =(1.0/60.0)
 

Detailed Description

Interpolation operators used for 6th order centered scheme

Constructor & Destructor Documentation

◆ CENTERED6()

CENTERED6::CENTERED6 ( const amrex::Array4< const amrex::Real > &  phi)
inline
436  : m_phi(phi) {}
amrex::Array4< const amrex::Real > m_phi
Definition: ERF_Interpolation_UPW.H:529

Member Function Documentation

◆ Evaluate()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real CENTERED6::Evaluate ( const amrex::Real &  sp2,
const amrex::Real &  sp1,
const amrex::Real &  s,
const amrex::Real &  sm1,
const amrex::Real &  sm2,
const amrex::Real &  sm3 
) const
inline
516  {
517  // Averages and diffs
518  amrex::Real a1 = (s + sm1);
519  amrex::Real a2 = (sp1 + sm2);
520  amrex::Real a3 = (sp2 + sm3);
521 
522  // Interpolated value
523  return ( g1*a1 - g2*a2 + g3*a3 );
524  }
static constexpr amrex::Real g2
Definition: ERF_Interpolation_UPW.H:531
static constexpr amrex::Real g1
Definition: ERF_Interpolation_UPW.H:530
static constexpr amrex::Real g3
Definition: ERF_Interpolation_UPW.H:532

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

Here is the caller graph for this function:

◆ GetUpwindCellNumber()

int CENTERED6::GetUpwindCellNumber ( ) const
inline
526 {return 3;}

◆ InterpolateInX()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED6::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
448  {
449  // Data to interpolate on
450  amrex::Real sp2 = m_phi(i+2, j , k , qty_index);
451  amrex::Real sp1 = m_phi(i+1, j , k , qty_index);
452  amrex::Real s = m_phi(i , j , k , qty_index);
453  amrex::Real sm1 = m_phi(i-1, j , k , qty_index);
454  amrex::Real sm2 = m_phi(i-2, j , k , qty_index);
455  amrex::Real sm3 = m_phi(i-3, j , k , qty_index);
456 
457  // Interpolate lo
458  val_lo = Evaluate(sp2,sp1,s,sm1,sm2,sm3);
459  }
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate(const amrex::Real &sp2, const amrex::Real &sp1, const amrex::Real &s, const amrex::Real &sm1, const amrex::Real &sm2, const amrex::Real &sm3) const
Definition: ERF_Interpolation_UPW.H:510
Here is the call graph for this function:

◆ InterpolateInY()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED6::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
471  {
472  // Data to interpolate on
473  amrex::Real sp2 = m_phi(i , j+2, k , qty_index);
474  amrex::Real sp1 = m_phi(i , j+1, k , qty_index);
475  amrex::Real s = m_phi(i , j , k , qty_index);
476  amrex::Real sm1 = m_phi(i , j-1, k , qty_index);
477  amrex::Real sm2 = m_phi(i , j-2, k , qty_index);
478  amrex::Real sm3 = m_phi(i , j-3, k , qty_index);
479 
480  // Interpolate lo
481  val_lo = Evaluate(sp2,sp1,s,sm1,sm2,sm3);
482  }
Here is the call graph for this function:

◆ InterpolateInZ()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE void CENTERED6::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
494  {
495  // Data to interpolate on
496  amrex::Real sp2 = m_phi(i , j , k+2, qty_index);
497  amrex::Real sp1 = m_phi(i , j , k+1, qty_index);
498  amrex::Real s = m_phi(i , j , k , qty_index);
499  amrex::Real sm1 = m_phi(i , j , k-1, qty_index);
500  amrex::Real sm2 = m_phi(i , j , k-2, qty_index);
501  amrex::Real sm3 = m_phi(i , j , k-3, qty_index);
502 
503  // Interpolate lo
504  val_lo = Evaluate(sp2,sp1,s,sm1,sm2,sm3);
505  }
Here is the call graph for this function:

Member Data Documentation

◆ g1

constexpr amrex::Real CENTERED6::g1 =(37.0/60.0)
staticconstexprprivate

Referenced by Evaluate().

◆ g2

constexpr amrex::Real CENTERED6::g2 =(2.0/15.0)
staticconstexprprivate

Referenced by Evaluate().

◆ g3

constexpr amrex::Real CENTERED6::g3 =(1.0/60.0)
staticconstexprprivate

Referenced by Evaluate().

◆ m_phi

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

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