#include <ERF_Interpolation_WENO.H>
|
| WENO5 (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 upw_lo, 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 upw_lo, 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 upw_lo, const amrex::Real) const |
|
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Evaluate (const amrex::Real &sm2, const amrex::Real &sm1, const amrex::Real &s, const amrex::Real &sp1, const amrex::Real &sp2) const |
|
|
amrex::Array4< const amrex::Real > | m_phi |
|
const amrex::Real | eps =1.0e-6 |
|
const amrex::Real | tol =1.0e-12 |
|
|
static constexpr amrex::Real | c1 =(13.0/12.0) |
|
static constexpr amrex::Real | g1 =(1.0/10.0) |
|
static constexpr amrex::Real | g2 =(3.0/5.0) |
|
static constexpr amrex::Real | g3 =(3.0/10.0) |
|
Interpolation operators used for WENO-5 scheme
◆ WENO5()
WENO5::WENO5 |
( |
const amrex::Array4< const amrex::Real > & |
phi | ) |
|
|
inline |
amrex::Array4< const amrex::Real > m_phi
Definition: ERF_Interpolation_WENO.H:253
◆ Evaluate()
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WENO5::Evaluate |
( |
const amrex::Real & |
sm2, |
|
|
const amrex::Real & |
sm1, |
|
|
const amrex::Real & |
s, |
|
|
const amrex::Real & |
sp1, |
|
|
const amrex::Real & |
sp2 |
|
) |
| const |
|
inline |
228 amrex::Real b1 =
c1 * (sm2 - 2.0 * sm1 + s) * (sm2 - 2.0 * sm1 + s) +
229 0.25 * (sm2 - 4.0 * sm1 + 3.0 * s) * (sm2 - 4.0 * sm1 + 3.0 * s);
230 amrex::Real b2 =
c1 * (sm1 - 2.0 * s + sp1) * (sm1 - 2.0 * s + sp1) +
231 0.25 * (sm1 - sp1) * (sm1 - sp1);
232 amrex::Real b3 =
c1 * (s - 2.0 * sp1 + sp2) * (s - 2.0 * sp1 + sp2) +
233 0.25 * (3.0 * s - 4.0 * sp1 + sp2) * (3.0 * s - 4.0 * sp1 + sp2);
236 amrex::Real w1 =
g1 / ( (
eps + b1) * (
eps + b1) );
237 amrex::Real w2 =
g2 / ( (
eps + b2) * (
eps + b2) );
238 amrex::Real w3 =
g3 / ( (
eps + b3) * (
eps + b3) );
241 amrex::Real wsum = w1 + w2 + w3;
244 amrex::Real v1 = 2.0 * sm2 - 7.0 * sm1 + 11.0 * s;
245 amrex::Real v2 = -sm1 + 5.0 * s + 2.0 * sp1;
246 amrex::Real v3 = 2.0 * s + 5.0 * sp1 - sp2;
249 return ( (w1 * v1 + w2 * v2 + w3 * v3) / (6.0 * wsum) );
const amrex::Real eps
Definition: ERF_Interpolation_WENO.H:254
static constexpr amrex::Real c1
Definition: ERF_Interpolation_WENO.H:256
static constexpr amrex::Real g2
Definition: ERF_Interpolation_WENO.H:258
static constexpr amrex::Real g3
Definition: ERF_Interpolation_WENO.H:259
static constexpr amrex::Real g1
Definition: ERF_Interpolation_WENO.H:257
Referenced by InterpolateInX(), InterpolateInY(), and InterpolateInZ().
◆ InterpolateInX()
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void WENO5::InterpolateInX |
( |
const int & |
i, |
|
|
const int & |
j, |
|
|
const int & |
k, |
|
|
const int & |
qty_index, |
|
|
amrex::Real & |
val_lo, |
|
|
amrex::Real |
upw_lo, |
|
|
const amrex::Real |
|
|
) |
| const |
|
inline |
146 amrex::Real sp2 =
m_phi(i+2, j , k , qty_index);
147 amrex::Real sp1 =
m_phi(i+1, j , k , qty_index);
148 amrex::Real s =
m_phi(i , j , k , qty_index);
149 amrex::Real sm1 =
m_phi(i-1, j , k , qty_index);
150 amrex::Real sm2 =
m_phi(i-2, j , k , qty_index);
151 amrex::Real sm3 =
m_phi(i-3, j , k , qty_index);
154 val_lo =
Evaluate(sm3,sm2,sm1,s ,sp1);
155 }
else if (upw_lo < -
tol) {
156 val_lo =
Evaluate(sp2,sp1,s ,sm1,sm2);
158 val_lo = 0.5 * (s + sm1);
const amrex::Real tol
Definition: ERF_Interpolation_WENO.H:255
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Evaluate(const amrex::Real &sm2, const amrex::Real &sm1, const amrex::Real &s, const amrex::Real &sp1, const amrex::Real &sp2) const
Definition: ERF_Interpolation_WENO.H:221
◆ InterpolateInY()
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void WENO5::InterpolateInY |
( |
const int & |
i, |
|
|
const int & |
j, |
|
|
const int & |
k, |
|
|
const int & |
qty_index, |
|
|
amrex::Real & |
val_lo, |
|
|
amrex::Real |
upw_lo, |
|
|
const amrex::Real |
|
|
) |
| const |
|
inline |
174 amrex::Real sp2 =
m_phi(i , j+2, k , qty_index);
175 amrex::Real sp1 =
m_phi(i , j+1, k , qty_index);
176 amrex::Real s =
m_phi(i , j , k , qty_index);
177 amrex::Real sm1 =
m_phi(i , j-1, k , qty_index);
178 amrex::Real sm2 =
m_phi(i , j-2, k , qty_index);
179 amrex::Real sm3 =
m_phi(i , j-3, k , qty_index);
182 val_lo =
Evaluate(sm3,sm2,sm1,s ,sp1);
183 }
else if (upw_lo < -
tol) {
184 val_lo =
Evaluate(sp2,sp1,s ,sm1,sm2);
186 val_lo = 0.5 * (s + sm1);
◆ InterpolateInZ()
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void WENO5::InterpolateInZ |
( |
const int & |
i, |
|
|
const int & |
j, |
|
|
const int & |
k, |
|
|
const int & |
qty_index, |
|
|
amrex::Real & |
val_lo, |
|
|
amrex::Real |
upw_lo, |
|
|
const amrex::Real |
|
|
) |
| const |
|
inline |
202 amrex::Real sp2 =
m_phi(i , j , k+2, qty_index);
203 amrex::Real sp1 =
m_phi(i , j , k+1, qty_index);
204 amrex::Real s =
m_phi(i , j , k , qty_index);
205 amrex::Real sm1 =
m_phi(i , j , k-1, qty_index);
206 amrex::Real sm2 =
m_phi(i , j , k-2, qty_index);
207 amrex::Real sm3 =
m_phi(i , j , k-3, qty_index);
210 val_lo =
Evaluate(sm3,sm2,sm1,s ,sp1);
211 }
else if (upw_lo < -
tol) {
212 val_lo =
Evaluate(sp2,sp1,s ,sm1,sm2);
214 val_lo = 0.5 * (s + sm1);
◆ c1
constexpr amrex::Real WENO5::c1 =(13.0/12.0) |
|
staticconstexprprivate |
◆ eps
const amrex::Real WENO5::eps =1.0e-6 |
|
private |
◆ g1
constexpr amrex::Real WENO5::g1 =(1.0/10.0) |
|
staticconstexprprivate |
◆ g2
constexpr amrex::Real WENO5::g2 =(3.0/5.0) |
|
staticconstexprprivate |
◆ g3
constexpr amrex::Real WENO5::g3 =(3.0/10.0) |
|
staticconstexprprivate |
◆ m_phi
amrex::Array4<const amrex::Real> WENO5::m_phi |
|
private |
◆ tol
const amrex::Real WENO5::tol =1.0e-12 |
|
private |
The documentation for this struct was generated from the following file: