v0.14.0
Loading...
Searching...
No Matches
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 61 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 
)
inlinestatic

Definition at line 77 of file scalar_check_approximation.cpp.

78 {
80 for (int o = 1; o <= approx_order; ++o) {
81 for (int i = 0; i <= o; ++i) {
82 for (int j = 0; j <= o - i; j++) {
83 int k = o - i - j;
84 if (k >= 0) {
85 r(0) += i > 0 ? i * pow(x, i - 1) * pow(y, j) * pow(z, k) : 0;
86 r(1) += j > 0 ? j * pow(x, i) * pow(y, j - 1) * pow(z, k) : 0;
87 r(2) += k > 0 ? k * pow(x, i) * pow(y, j) * pow(z, k - 1) : 0;
88 }
89 }
90 }
91 }
92 return r;
93 }
static Index< 'o', 3 > o
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
int r
Definition: sdf.py:8
static int approx_order

◆ fUn()

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

Definition at line 62 of file scalar_check_approximation.cpp.

62 {
63 double r = 1;
64 for (int o = 1; o <= approx_order; ++o) {
65 for (int i = 0; i <= o; ++i) {
66 for (int j = 0; j <= o - i; j++) {
67 int k = o - i - j;
68 if (k >= 0) {
69 r += pow(x, i) * pow(y, j) * pow(z, k);
70 }
71 }
72 }
73 }
74 return r;
75 }

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