v0.14.0
Static Public Member Functions | List of all members
ApproxFunction Struct Reference

Static Public Member Functions

static double fun (double x, double y, double z)
 
static VectorDouble3 diff_fun (double x, double y, double z)
 
static double fun (double x, double y)
 
static VectorDouble3 diff_fun (double x, double y)
 

Detailed Description

Examples
prism_polynomial_approximation.cpp, and quad_polynomial_approximation.cpp.

Definition at line 16 of file prism_polynomial_approximation.cpp.

Member Function Documentation

◆ diff_fun() [1/2]

static VectorDouble3 ApproxFunction::diff_fun ( double  x,
double  y 
)
inlinestatic

Definition at line 33 of file quad_polynomial_approximation.cpp.

33  {
34  VectorDouble3 r(2);
35  r.clear();
36  for (int o = 1; o <= approx_order; ++o) {
37  for (int i = 0; i <= o; ++i) {
38  int j = o - i;
39  if (j >= 0) {
40  r[0] += i > 0 ? i * pow(x, i - 1) * pow(y, j) : 0;
41  r[1] += j > 0 ? j * pow(x, i) * pow(y, j - 1) : 0;
42  }
43  }
44  }
45  return r;
46  }

◆ diff_fun() [2/2]

static VectorDouble3 ApproxFunction::diff_fun ( double  x,
double  y,
double  z 
)
inlinestatic
Examples
prism_polynomial_approximation.cpp, and quad_polynomial_approximation.cpp.

Definition at line 32 of file prism_polynomial_approximation.cpp.

32  {
33  VectorDouble3 r(3);
34  r.clear();
35  for (int o = 1; o <= approx_order; ++o) {
36  for (int i = 0; i <= o; ++i) {
37  for (int j = 0; j <= (o - i); ++j) {
38  int k = o - i - j;
39  if (k >= 0) {
40  r[0] += i > 0 ? i * pow(x, i - 1) * pow(y, j) * pow(z, k) : 0;
41  r[1] += j > 0 ? j * pow(x, i) * pow(y, j - 1) * pow(z, k) : 0;
42  r[2] += k > 0 ? k * pow(x, i) * pow(y, j) * pow(z, k - 1) : 0;
43  }
44  }
45  }
46  }
47  return r;
48  }

◆ fun() [1/2]

static double ApproxFunction::fun ( double  x,
double  y 
)
inlinestatic

Definition at line 21 of file quad_polynomial_approximation.cpp.

21  {
22  double r = 1;
23  for (int o = 1; o <= approx_order; ++o) {
24  for (int i = 0; i <= o; ++i) {
25  int j = o - i;
26  if (j >= 0)
27  r += pow(x, i) * pow(y, j);
28  }
29  }
30  return r;
31  }

◆ fun() [2/2]

static double ApproxFunction::fun ( double  x,
double  y,
double  z 
)
inlinestatic
Examples
prism_polynomial_approximation.cpp, and quad_polynomial_approximation.cpp.

Definition at line 17 of file prism_polynomial_approximation.cpp.

17  {
18  double r = 1;
19  for (int o = 1; o <= approx_order; ++o) {
20  for (int i = 0; i <= o; ++i) {
21  for (int j = 0; j <= (o - i); ++j) {
22  int k = o - i - j;
23  if (k >= 0) {
24  r += pow(x, i) * pow(y, j) * pow(z, k);
25  }
26  }
27  }
28  }
29  return r;
30  }

The documentation for this struct was generated from the following files:
MoFEM::Types::VectorDouble3
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:92
approx_order
static constexpr int approx_order
Definition: quad_polynomial_approximation.cpp:19
sdf.r
int r
Definition: sdf.py:8
approx_order
static constexpr int approx_order
Definition: prism_polynomial_approximation.cpp:14
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