v0.9.2
Public Member Functions | List of all members
ExactFunctionGrad Struct Reference

Exact gradient. More...

Public Member Functions

FTensor::Tensor1< double, 3 > operator() (const double x, const double y, const double z) const
 
FTensor::Tensor1< double, 3 > operator() (const double x, const double y, const double z) const
 
FTensor::Tensor1< double, 3 > operator() (const double x, const double y, const double z) const
 
FTensor::Tensor1< double, 3 > operator() (const double x, const double y, const double t) const
 
FTensor::Tensor1< double, 3 > operator() (const double x, const double y, const double t) const
 

Detailed Description

Exact gradient.

Examples
analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, and analytical_poisson_field_split.cpp.

Definition at line 55 of file analytical_nonlinear_poisson.cpp.

Member Function Documentation

◆ operator()() [1/5]

FTensor::Tensor1<double, 3> ExactFunctionGrad::operator() ( const double  x,
const double  y,
const double  z 
) const

Definition at line 54 of file analytical_poisson.cpp.

55  {
57  grad(0) = 2 * x;
58  grad(1) = 2 * y;
59  grad(2) = 3 * z * z;
60  return grad;
61  }

◆ operator()() [2/5]

FTensor::Tensor1<double, 3> ExactFunctionGrad::operator() ( const double  x,
const double  y,
const double  z 
) const
Examples
analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, and analytical_poisson_field_split.cpp.

Definition at line 56 of file analytical_nonlinear_poisson.cpp.

57  {
59  grad(0) = 1;
60  grad(1) = 1;
61  grad(2) = 3 * z * z;
62  return grad;
63  }

◆ operator()() [3/5]

FTensor::Tensor1<double, 3> ExactFunctionGrad::operator() ( const double  x,
const double  y,
const double  z 
) const

Definition at line 57 of file analytical_poisson_field_split.cpp.

58  {
60  grad(0) = 2 * x;
61  grad(1) = 2 * y;
62  grad(2) = 3 * z * z;
63  return grad;
64  }

◆ operator()() [4/5]

FTensor::Tensor1<double, 3> ExactFunctionGrad::operator() ( const double  x,
const double  y,
const double  t 
) const

Definition at line 172 of file std_reac_diff.cpp.

173  {
175  double mx = -T * cos(T * x) * sin(T * y);
176  double my = -T * sin(T * x) * cos(T * y);
177  double hx, hy;
178  if (x > -sml) {
179  hx = 1.0 * mx;
180  hy = 1.0 * my;
181  } else {
182  hx = mx;
183  hy = my;
184  }
185  if (t <= ramp_t) {
186  grad(0) = hx * t;
187  grad(1) = hy * t;
188  } else {
189  grad(0) = hx * ramp_t;
190  grad(1) = hy * ramp_t;
191  }
192  grad(2) = 0.0;
193  return grad;
194  }
const double ramp_t
const double sml

◆ operator()() [5/5]

FTensor::Tensor1<double, 3> ExactFunctionGrad::operator() ( const double  x,
const double  y,
const double  t 
) const

Definition at line 187 of file mixed_reac_diff.cpp.

188  {
190  double mx = - T * sin(T * x) * cos(T * y);
191  double my = - T * cos(T * x) * sin(T * y);
192 
193 
194  if (t <= ramp_t) {
195  grad(0) = mx * t;
196  grad(1) = my * t;
197  } else {
198  grad(0) = mx * ramp_t;
199  grad(1) = my * ramp_t;
200  }
201  grad(2) = 0.0;
202  return grad;
203  }
const double ramp_t

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