47 const Realf val_to_sqrt = b1 * b1 - (
Realf)(4.0) * b0 * b2;
48 const Realf sqrt_val = (val_to_sqrt < (
Realf)(0.0)) ?
49 b1 + (
Realf)(200.0) * b2 :
52 const Realf root1 = (b2 != (
Realf)(0.0)) ? (-b1 + sqrt_val) / ((
Realf)(2.0) * b2) : (
Realf)(0.0);
53 const Realf root2 = (b2 != (
Realf)(0.0)) ? (-b1 - sqrt_val) / ((
Realf)(2.0) * b2) : (
Realf)(0.0);
58 const Realf slope_sign = plm_slope_l + plm_slope_r;
60 const Realf c0 = fd_l;
68 const Realf root1_slope = (root1 >= (
Realf)(0.0) && root1 <= (
Realf)(1.0)) ?
69 c0 + root1 * ( c1 + root1 * (c2 + root1 * c3 ) ) :
71 const Realf root2_slope = (root2 >= (
Realf)(0.0) && root2 <= (
Realf)(1.0)) ?
72 c0 + root2 * ( c1 + root2 * (c2 + root2 * c3 ) ) :
74 const bool fixInflexion = root1_slope * slope_sign < (
Realf)(0.0) || root2_slope * slope_sign < (
Realf)(0.0);
82 const Realf slope_signa = slope_sign;
85 if(fabs(plm_slope_l) <= fabs(plm_slope_r))
88 fda_l = (
Realf)(1.0 / 3.0) * ( (
Realf)(10.0) * valuesa - (
Realf)(2.0) * fva_r - (
Realf)(8.0) * fva_l);
89 fda_r = (
Realf)(-10.0) * valuesa + (
Realf)(6.0) * fva_r + (
Realf)(4.0) * fva_l;
91 if (slope_signa * fda_l < (
Realf)(0.0))
94 fva_r = (
Realf)(5.0) * valuesa - (
Realf)(4.0) * fva_l;
95 fda_r = (
Realf)(20.0) * (valuesa - fva_l);
97 else if (slope_signa * fda_r < (
Realf)(0.0))
100 fva_l = (
Realf)(0.5) * ((
Realf)(5.0) * valuesa - (
Realf)(3.0) * fva_r);
101 fda_l = (
Realf)(10.0 / 3.0) * (-valuesa + fva_r);
107 fda_l = (
Realf)(10.0) * valuesa - (
Realf)(6.0) * fva_l - (
Realf)(4.0) * fva_r;
108 fda_r = (
Realf)(1.0 / 3.0) * ( (
Realf)(- 10.0) * valuesa + (
Realf)(2.0) * fva_l + (
Realf)(8.0) * fva_r);
110 if (slope_signa * fda_l < (
Realf)(0.0))
112 fda_l = (
Realf)(0.0);
113 fva_r = (
Realf)(0.5) * ( (
Realf)(5.0) * valuesa - (
Realf)(3.0) * fva_l);
114 fda_r = (
Realf)(10.0 / 3.0) * (valuesa - fva_l);
116 else if (slope_signa * fda_r < (
Realf)(0.0))
118 fda_r = (
Realf)(0.0);
119 fva_l = (
Realf)(5.0) * valuesa - (
Realf)(4.0) * fva_r;
120 fda_l = (
Realf)(20.0) * ( - valuesa + fva_r);
void compute_filtered_face_values_derivatives(const Vec *const values, const uint k, const face_estimate_order order, Vec &fv_l, Vec &fv_r, Vec &fd_l, Vec &fd_r, const Realf threshold)
static ARCH_DEV void compute_pqm_coeff(const Realf *__restrict__ values, face_estimate_order order, int k, Realf a[5], const Realf threshold, const int index, const int stride)
static ARCH_DEV void filter_pqm_monotonicity(const Realf *__restrict__ values, int k, Realf &fv_l, Realf &fv_r, Realf &fd_l, Realf &fd_r, const int index, const int stride)