v0.14.0
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  {
79  FTensor::Tensor1<double, 3> r{0., 0., 0.};
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  }

◆ 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:
FTensor::Tensor1< double, 3 >
sdf.r
int r
Definition: sdf.py:8
approx_order
static int approx_order
Definition: scalar_check_approximation.cpp:15
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20