27 template<
class Equation>
32 typename Equation::ConstViews& in,
33 size_t x,
size_t y,
size_t z,
34 typename Equation::Views& leftView,
35 typename Equation::Views& rightView,
36 bool xDir,
bool yDir,
bool zDir) {
37 const size_t indexOut = leftView.index(x, y, z);
38 const size_t indexRight = leftView.index(x + xDir, y + yDir, z + zDir);
39 const size_t indexLeft = leftView.index(x - xDir, y - yDir, z - zDir);
40 const real i0 = eq.getWeight(in, indexOut);
41 const real b0 =
square(eq.getWeight(in, indexRight) - i0);
42 const real b1 =
square(i0 - eq.getWeight(in, indexLeft));
48 const real w0Left = a0Left / (a0Left + a1Left);
49 const real w1Left = a1Left / (a0Left + a1Left);
55 const real w0Right = a0Right / (a0Right + a1Right);
56 const real w1Right = a1Right / (a0Right + a1Right);
62 for (
size_t var = 0; var < Equation::getNumberOfConservedVariables(); ++var) {
63 leftView.get(var).at(indexOut) = 0.5 * (w1Left * in.get(var).at(indexLeft) +
64 (3 * w0Left + w1Left) * in.get(var).at(indexOut) -
65 w0Left * in.get(var).at(indexRight));
67 rightView.get(var).at(indexOut) = 0.5 * (w0Right * in.get(var).at(indexRight) +
68 (3 * w1Right + w0Right) * in.get(var).at(indexOut) -
69 w1Right * in.get(var).at(indexLeft));
74 typename Equation::ConservedVariables inLeft = eq.fetchConservedVariables(in,
76 typename Equation::ConservedVariables inMiddle = eq.fetchConservedVariables(in,
78 typename Equation::ConservedVariables inRight = eq.fetchConservedVariables(in,
81 typename Equation::ConservedVariables left = 0.5 * (w1Left * inLeft +
82 (3 * w0Left + w1Left) * inMiddle -
85 typename Equation::ConservedVariables right = 0.5 * (w0Right * inRight +
86 (3 * w1Right + w0Right) * inMiddle -
88 eq.setViewAt(leftView, indexOut, left);
89 eq.setViewAt(rightView, indexOut, right);
alsfvm::shared_ptr< reconstruction::Reconstruction > & reconstruction
Definition: NumericalFluxFactory.cpp:101
#define ALSFVM_WENO_EPSILON
Definition: WENOCoefficients.hpp:21
__device__ static __host__ void reconstruct(Equation eq, typename Equation::ConstViews &in, size_t x, size_t y, size_t z, typename Equation::Views &leftView, typename Equation::Views &rightView, bool xDir, bool yDir, bool zDir)
Definition: WENO2.hpp:31
#define __host__
Definition: types.hpp:46
double real
Definition: types.hpp:65
#define __device__
Definition: types.hpp:45
__device__ static __host__ int getNumberOfGhostCells()
Definition: WENO2.hpp:93
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
__host__ __device__ real square(const real &x)
Definition: types.hpp:159