Rheolef  7.2
an efficient C++ finite element environment
nu.h
Go to the documentation of this file.
1 template<class Function>
26 struct nu {
27  tensor operator() (const point& grad_u) const {
28  Float x2 = norm2 (grad_u);
29  Float a = f(x2);
30  Float b = 2*f.derivative(x2);
31  tensor value;
32  for (size_t i = 0; i < d; i++) {
33  value(i,i) = a + b*grad_u[i]*grad_u[i];
34  for (size_t j = 0; j < i; j++)
35  value(j,i) = value(i,j) = b*grad_u[i]*grad_u[j];
36  }
37  return value;
38  }
39  nu (const Function& f1, size_t d1) : f(f1), d(d1) {}
40  Function f;
41  size_t d;
42 };
see the Float page for the full documentation
see the point page for the full documentation
see the tensor page for the full documentation
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
Definition: vec.h:379
Definition: cavity_dg.h:29
Definition: nu.h:26
size_t d
Definition: nu.h:41
tensor operator()(const point &grad_u) const
Definition: nu.h:27
Function f
Definition: nu.h:40
nu(const Function &f1, size_t d1)
Definition: nu.h:39
Float derivative(const Float &x) const
Definition: phi.h:47