v0.13.1
Static Public Member Functions | List of all members
ApproxFunctionsImpl< 3 > Struct Reference

Static Public Member Functions

static double fUn (const double x, const double y, double z)
 
static FTensor::Tensor1< double, 3 > diffFun (const double x, const double y, double z)
 

Detailed Description

Definition at line 81 of file scalar_check_approximation.cpp.

Member Function Documentation

◆ diffFun()

static FTensor::Tensor1< double, 3 > ApproxFunctionsImpl< 3 >::diffFun ( const double  x,
const double  y,
double  z 
)
static

Definition at line 97 of file scalar_check_approximation.cpp.

98 {
100 for (int o = 1; o <= approx_order; ++o) {
101 for (int i = 0; i <= o; ++i) {
102 for (int j = 0; j <= o - i; j++) {
103 int k = o - i - j;
104 if (k >= 0) {
105 r(0) += i > 0 ? i * pow(x, i - 1) * pow(y, j) * pow(z, k) : 0;
106 r(1) += j > 0 ? j * pow(x, i) * pow(y, j - 1) * pow(z, k) : 0;
107 r(2) += k > 0 ? k * pow(x, i) * pow(y, j) * pow(z, k - 1) : 0;
108 }
109 }
110 }
111 }
112 return r;
113 }
static Index< 'o', 3 > o
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const double r
rate factor
static int approx_order

◆ fUn()

static double ApproxFunctionsImpl< 3 >::fUn ( const double  x,
const double  y,
double  z 
)
static

Definition at line 82 of file scalar_check_approximation.cpp.

82 {
83 double r = 1;
84 for (int o = 1; o <= approx_order; ++o) {
85 for (int i = 0; i <= o; ++i) {
86 for (int j = 0; j <= o - i; j++) {
87 int k = o - i - j;
88 if (k >= 0) {
89 r += pow(x, i) * pow(y, j) * pow(z, k);
90 }
91 }
92 }
93 }
94 return r;
95 }

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