#include <ERF_Interpolation_WENO.H>
|
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE | WENO5 (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 upw_lo) 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_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_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 =amrex::Real(1.0e-40) |
| |
|
| static constexpr amrex::Real | c1 =(amrex::Real(13.0)/amrex::Real(12.0)) |
| |
| static constexpr amrex::Real | g1 =(amrex::Real(1)/amrex::Real(10.0)) |
| |
| static constexpr amrex::Real | g2 =(amrex::Real(3)/amrex::Real(5.0)) |
| |
| static constexpr amrex::Real | g3 =(amrex::Real(3)/amrex::Real(10.0)) |
| |
Interpolation operators used for WENO-5 scheme
◆ WENO5()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE WENO5::WENO5 |
( |
const amrex::Array4< const amrex::Real > & |
phi, |
|
|
const amrex::Real |
|
|
) |
| |
|
inline |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real phi(amrex::Real d, amrex::Real z0, amrex::Real psi) noexcept
Definition: ERF_ImmersedWallCell.H:176
amrex::Array4< const amrex::Real > m_phi
Definition: ERF_Interpolation_WENO.H:268
◆ 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 |
243 amrex::Real b1 =
c1 * (sm2 - amrex::Real(2) * sm1 + s) * (sm2 - amrex::Real(2) * sm1 + s) +
244 amrex::Real(0.25) * (sm2 - amrex::Real(4.0) * sm1 + amrex::Real(3) * s) * (sm2 - amrex::Real(4.0) * sm1 + amrex::Real(3) * s);
245 amrex::Real b2 =
c1 * (sm1 - amrex::Real(2) * s + sp1) * (sm1 - amrex::Real(2) * s + sp1) +
246 amrex::Real(0.25) * (sm1 - sp1) * (sm1 - sp1);
247 amrex::Real b3 =
c1 * (s - amrex::Real(2) * sp1 + sp2) * (s - amrex::Real(2) * sp1 + sp2) +
248 amrex::Real(0.25) * (amrex::Real(3) * s - amrex::Real(4.0) * sp1 + sp2) * (amrex::Real(3) * s - amrex::Real(4.0) * sp1 + sp2);
251 amrex::Real w1 =
g1 / ( (
eps + b1) * (
eps + b1) );
252 amrex::Real w2 =
g2 / ( (
eps + b2) * (
eps + b2) );
253 amrex::Real w3 =
g3 / ( (
eps + b3) * (
eps + b3) );
256 amrex::Real wsum = w1 + w2 + w3;
259 amrex::Real v1 = amrex::Real(2) * sm2 - amrex::Real(7.0) * sm1 + amrex::Real(11.0) * s;
260 amrex::Real v2 = -sm1 + amrex::Real(5.0) * s + amrex::Real(2) * sp1;
261 amrex::Real v3 = amrex::Real(2) * s + amrex::Real(5.0) * sp1 - sp2;
264 return ( (w1 * v1 + w2 * v2 + w3 * v3) / (amrex::Real(6.0) * wsum) );
const amrex::Real eps
Definition: ERF_Interpolation_WENO.H:272
static constexpr amrex::Real c1
Definition: ERF_Interpolation_WENO.H:274
static constexpr amrex::Real g2
Definition: ERF_Interpolation_WENO.H:276
static constexpr amrex::Real g3
Definition: ERF_Interpolation_WENO.H:277
static constexpr amrex::Real g1
Definition: ERF_Interpolation_WENO.H:275
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 |
|
inline |
157 if (upw_lo != amrex::Real(0)) upw_lo = (upw_lo > 0) ? amrex::Real(1) : -amrex::Real(1);
160 amrex::Real sp2 =
m_phi(i+2, j , k , qty_index);
161 amrex::Real sp1 =
m_phi(i+1, j , k , qty_index);
162 amrex::Real s =
m_phi(i , j , k , qty_index);
163 amrex::Real sm1 =
m_phi(i-1, j , k , qty_index);
164 amrex::Real sm2 =
m_phi(i-2, j , k , qty_index);
165 amrex::Real sm3 =
m_phi(i-3, j , k , qty_index);
168 amrex::Real Fhi =
Evaluate(sm3,sm2,sm1,s ,sp1);
169 amrex::Real Flo =
Evaluate(sp2,sp1,s ,sm1,sm2);
172 val_lo = (amrex::Real(1) + upw_lo)/amrex::Real(2) * Fhi + (amrex::Real(1) - upw_lo)/amrex::Real(2) * Flo;
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:236
◆ 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 |
|
inline |
186 if (upw_lo != amrex::Real(0)) upw_lo = (upw_lo > 0) ? amrex::Real(1) : -amrex::Real(1);
189 amrex::Real sp2 =
m_phi(i , j+2, k , qty_index);
190 amrex::Real sp1 =
m_phi(i , j+1, k , qty_index);
191 amrex::Real s =
m_phi(i , j , k , qty_index);
192 amrex::Real sm1 =
m_phi(i , j-1, k , qty_index);
193 amrex::Real sm2 =
m_phi(i , j-2, k , qty_index);
194 amrex::Real sm3 =
m_phi(i , j-3, k , qty_index);
197 amrex::Real Fhi =
Evaluate(sm3,sm2,sm1,s ,sp1);
198 amrex::Real Flo =
Evaluate(sp2,sp1,s ,sm1,sm2);
201 val_lo = (amrex::Real(1) + upw_lo)/amrex::Real(2) * Fhi + (amrex::Real(1) - upw_lo)/amrex::Real(2) * Flo;
◆ 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 |
|
inline |
215 if (upw_lo != amrex::Real(0)) upw_lo = (upw_lo > 0) ? amrex::Real(1) : -amrex::Real(1);
218 amrex::Real sp2 =
m_phi(i , j , k+2, qty_index);
219 amrex::Real sp1 =
m_phi(i , j , k+1, qty_index);
220 amrex::Real s =
m_phi(i , j , k , qty_index);
221 amrex::Real sm1 =
m_phi(i , j , k-1, qty_index);
222 amrex::Real sm2 =
m_phi(i , j , k-2, qty_index);
223 amrex::Real sm3 =
m_phi(i , j , k-3, qty_index);
226 amrex::Real Fhi =
Evaluate(sm3,sm2,sm1,s ,sp1);
227 amrex::Real Flo =
Evaluate(sp2,sp1,s ,sm1,sm2);
230 val_lo = (amrex::Real(1) + upw_lo)/amrex::Real(2) * Fhi + (amrex::Real(1) - upw_lo)/amrex::Real(2) * Flo;
◆ c1
| constexpr amrex::Real WENO5::c1 =(amrex::Real(13.0)/amrex::Real(12.0)) |
|
staticconstexprprivate |
◆ eps
| const amrex::Real WENO5::eps =amrex::Real(1.0e-40) |
|
private |
◆ g1
| constexpr amrex::Real WENO5::g1 =(amrex::Real(1)/amrex::Real(10.0)) |
|
staticconstexprprivate |
◆ g2
| constexpr amrex::Real WENO5::g2 =(amrex::Real(3)/amrex::Real(5.0)) |
|
staticconstexprprivate |
◆ g3
| constexpr amrex::Real WENO5::g3 =(amrex::Real(3)/amrex::Real(10.0)) |
|
staticconstexprprivate |
◆ m_phi
| amrex::Array4<const amrex::Real> WENO5::m_phi |
|
private |
The documentation for this struct was generated from the following file: