11 template <
typename Field>
13 constexpr unsigned Dim = Field::dim;
19 using mesh_type =
typename Field::Mesh_t;
20 using vector_type =
typename mesh_type::vector_type;
22 mesh_type& mesh = u.get_mesh();
23 vector_type vectors[Dim];
24 for (
unsigned d = 0; d < Dim; d++) {
26 vectors[d][d] = 0.5 / mesh.getMeshSpacing(d);
28 return detail::meta_grad<Field>(u, vectors);
35 template <
typename Field>
37 constexpr unsigned Dim = Field::dim;
43 using mesh_type =
typename Field::Mesh_t;
44 using vector_type =
typename mesh_type::vector_type;
46 mesh_type& mesh = u.get_mesh();
47 vector_type vectors[Dim];
48 for (
unsigned d = 0; d < Dim; d++) {
50 vectors[d][d] = 0.5 / mesh.getMeshSpacing(d);
52 return detail::meta_div<Field>(u, vectors);
59 template <
typename Field>
61 constexpr unsigned Dim = Field::dim;
67 using mesh_type =
typename Field::Mesh_t;
68 mesh_type& mesh = u.get_mesh();
69 typename mesh_type::vector_type hvector(0);
70 for (
unsigned d = 0; d < Dim; d++) {
71 hvector[d] = 1.0 / std::pow(mesh.getMeshSpacing(d), 2);
73 return detail::meta_laplace<Field>(u, hvector);
80 template <
typename Field>
82 constexpr unsigned Dim = Field::dim;
88 using mesh_type =
typename Field::Mesh_t;
89 mesh_type& mesh = u.get_mesh();
90 typename mesh_type::vector_type xvector(0);
92 typename mesh_type::vector_type yvector(0);
94 typename mesh_type::vector_type zvector(0);
96 typename mesh_type::vector_type hvector(0);
97 hvector = mesh.getMeshSpacing();
98 return detail::meta_curl<Field>(u, xvector, yvector, zvector, hvector);
105 template <
typename Field>
107 constexpr unsigned Dim = Field::dim;
113 using mesh_type =
typename Field::Mesh_t;
114 using vector_type =
typename mesh_type::vector_type;
116 mesh_type& mesh = u.get_mesh();
117 vector_type vectors[Dim];
118 for (
unsigned d = 0; d < Dim; d++) {
122 auto hvector = mesh.getMeshSpacing();
124 return detail::meta_hess<Field>(u, vectors, hvector);
detail::meta_div< Field > div(Field &u)
Definition FieldOperations.hpp:36
detail::meta_hess< Field > hess(Field &u)
Definition FieldOperations.hpp:106
detail::meta_grad< Field > grad(Field &u)
Definition FieldOperations.hpp:12
detail::meta_curl< Field > curl(Field &u)
Definition FieldOperations.hpp:81
detail::meta_laplace< Field > laplace(Field &u)
Definition FieldOperations.hpp:60