9#include <kernel/geometry/conformal_mesh.hpp>
10#include <kernel/lafem/dense_vector.hpp>
11#include <kernel/lafem/dense_vector_blocked.hpp>
12#include <kernel/trafo/standard/mapping.hpp>
35 template<
typename TrafoType_,
typename DataType_>
42 template<
typename TrafoType_,
typename DataType_>
171 template<
typename DataType_>
172 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<2>,2,DataType_>>,DataType_>
180 typedef typename TrafoType::ShapeType
ShapeType;
182 typedef typename TrafoType::MeshType
MeshType;
198 return (x(0,0) * x(1,1) - x(0,0) * x(2,1) - x(0,1) * x(1,0) + x(0,1) * x(2,0)
199 + x(1,0) * x(3,1) - x(1,1) * x(3,0) - x(2,0) * x(3,1) + x(2,1) * x(3,0)) /
DataType(2);
223 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
225 for(
Index cell(0); cell < h_.size(); ++cell)
238 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
241 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
244 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
247 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
249 x[j] = coords_(idx(cell,j));
267 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
269 Tx local_grad(DataType_(0));
273 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
276 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
278 x[j] = coords_(idx(cell,j));
283 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
285 Index i(idx(cell, j));
286 grad_(i, grad_(i) + local_grad[j]);
300 for(
int d(0); d < MeshType::world_dim; ++d)
302 mat_tensor(d,d) = scal;
319 template<
typename DataType_>
320 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>,3,DataType_>>,DataType_>
324 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>,3,DataType_>>
TrafoType;
328 typedef typename TrafoType::ShapeType
ShapeType;
330 typedef typename TrafoType::MeshType
MeshType;
332 typedef Tiny::Matrix<DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim>
Tx;
334 typedef Tiny::Matrix<DataType_, MeshType::world_dim, MeshType::world_dim>
MatTensorType;
338 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim>
VectorType;
346 return (-x(0,0) * x(1,1) * x(2,2) - x(0,0) * x(1,1) * x(3,2) + x(0,0) * x(1,1) * x(4,2) + x(0,0) * x(1,1) * x(5,2) + x(0,0) * x(1,2) * x(2,1) + x(0,0) * x(1,2) * x(3,1) - x(0,0) * x(1,2) * x(4,1) - x(0,0) * x(1,2) * x(5,1) + x(0,0) * x(2,1) * x(3,2) - x(0,0) * x(2,1) * x(4,2) - x(0,0) * x(2,1) * x(6,2) - x(0,0) * x(2,2) * x(3,1) + x(0,0) * x(2,2) * x(4,1) + x(0,0) * x(2,2) * x(6,1) - x(0,0) * x(4,1) * x(5,2) + x(0,0) * x(4,1) * x(6,2) + x(0,0) * x(4,2) * x(5,1) - x(0,0) * x(4,2) * x(6,1) + x(0,1) * x(1,0) * x(2,2) + x(0,1) * x(1,0) * x(3,2) - x(0,1) * x(1,0) * x(4,2) - x(0,1) * x(1,0) * x(5,2) - x(0,1) * x(1,2) * x(2,0) - x(0,1) * x(1,2) * x(3,0) + x(0,1) * x(1,2) * x(4,0) + x(0,1) * x(1,2) * x(5,0) - x(0,1) * x(2,0) * x(3,2) + x(0,1) * x(2,0) * x(4,2) + x(0,1) * x(2,0) * x(6,2) + x(0,1) * x(2,2) * x(3,0) - x(0,1) * x(2,2) * x(4,0) - x(0,1) * x(2,2) * x(6,0) + x(0,1) * x(4,0) * x(5,2) - x(0,1) * x(4,0) * x(6,2) - x(0,1) * x(4,2) * x(5,0) + x(0,1) * x(4,2) * x(6,0) - x(0,2) * x(1,0) * x(2,1) - x(0,2) * x(1,0) * x(3,1) + x(0,2) * x(1,0) * x(4,1) + x(0,2) * x(1,0) * x(5,1) + x(0,2) * x(1,1) * x(2,0) + x(0,2) * x(1,1) * x(3,0) - x(0,2) * x(1,1) * x(4,0) - x(0,2) * x(1,1) * x(5,0) + x(0,2) * x(2,0) * x(3,1) - x(0,2) * x(2,0) * x(4,1) - x(0,2) * x(2,0) * x(6,1) - x(0,2) * x(2,1) * x(3,0) + x(0,2) * x(2,1) * x(4,0) + x(0,2) * x(2,1) * x(6,0) - x(0,2) * x(4,0) * x(5,1) + x(0,2) * x(4,0) * x(6,1) + x(0,2) * x(4,1) * x(5,0) - x(0,2) * x(4,1) * x(6,0) + x(1,0) * x(2,1) * x(3,2) - x(1,0) * x(2,2) * x(3,1) + x(1,0) * x(3,1) * x(5,2) + x(1,0) * x(3,1) * x(7,2) - x(1,0) * x(3,2) * x(5,1) - x(1,0) * x(3,2) * x(7,1) - x(1,0) * x(4,1) * x(5,2) + x(1,0) * x(4,2) * x(5,1) - x(1,0) * x(5,1) * x(7,2) + x(1,0) * x(5,2) * x(7,1) - x(1,1) * x(2,0) * x(3,2) + x(1,1) * x(2,2) * x(3,0) - x(1,1) * x(3,0) * x(5,2) - x(1,1) * x(3,0) * x(7,2) + x(1,1) * x(3,2) * x(5,0) + x(1,1) * x(3,2) * x(7,0) + x(1,1) * x(4,0) * x(5,2) - x(1,1) * x(4,2) * x(5,0) + x(1,1) * x(5,0) * x(7,2) - x(1,1) * x(5,2) * x(7,0) + x(1,2) * x(2,0) * x(3,1) - x(1,2) * x(2,1) * x(3,0) + x(1,2) * x(3,0) * x(5,1) + x(1,2) * x(3,0) * x(7,1) - x(1,2) * x(3,1) * x(5,0) - x(1,2) * x(3,1) * x(7,0) - x(1,2) * x(4,0) * x(5,1) + x(1,2) * x(4,1) * x(5,0) - x(1,2) * x(5,0) * x(7,1) + x(1,2) * x(5,1) * x(7,0) - x(2,0) * x(3,1) * x(6,2) - x(2,0) * x(3,1) * x(7,2) + x(2,0) * x(3,2) * x(6,1) + x(2,0) * x(3,2) * x(7,1) + x(2,0) * x(4,1) * x(6,2) - x(2,0) * x(4,2) * x(6,1) + x(2,0) * x(6,1) * x(7,2) - x(2,0) * x(6,2) * x(7,1) + x(2,1) * x(3,0) * x(6,2) + x(2,1) * x(3,0) * x(7,2) - x(2,1) * x(3,2) * x(6,0) - x(2,1) * x(3,2) * x(7,0) - x(2,1) * x(4,0) * x(6,2) + x(2,1) * x(4,2) * x(6,0) - x(2,1) * x(6,0) * x(7,2) + x(2,1) * x(6,2) * x(7,0) - x(2,2) * x(3,0) * x(6,1) - x(2,2) * x(3,0) * x(7,1) + x(2,2) * x(3,1) * x(6,0) + x(2,2) * x(3,1) * x(7,0) + x(2,2) * x(4,0) * x(6,1) - x(2,2) * x(4,1) * x(6,0) + x(2,2) * x(6,0) * x(7,1) - x(2,2) * x(6,1) * x(7,0) - x(3,0) * x(5,1) * x(7,2) + x(3,0) * x(5,2) * x(7,1) + x(3,0) * x(6,1) * x(7,2) - x(3,0) * x(6,2) * x(7,1) + x(3,1) * x(5,0) * x(7,2) - x(3,1) * x(5,2) * x(7,0) - x(3,1) * x(6,0) * x(7,2) + x(3,1) * x(6,2) * x(7,0) - x(3,2) * x(5,0) * x(7,1) + x(3,2) * x(5,1) * x(7,0) + x(3,2) * x(6,0) * x(7,1) - x(3,2) * x(6,1) * x(7,0) + x(4,0) * x(5,1) * x(6,2) + x(4,0) * x(5,1) * x(7,2) - x(4,0) * x(5,2) * x(6,1) - x(4,0) * x(5,2) * x(7,1) - x(4,0) * x(6,1) * x(7,2) + x(4,0) * x(6,2) * x(7,1) - x(4,1) * x(5,0) * x(6,2) - x(4,1) * x(5,0) * x(7,2) + x(4,1) * x(5,2) * x(6,0) + x(4,1) * x(5,2) * x(7,0) + x(4,1) * x(6,0) * x(7,2) - x(4,1) * x(6,2) * x(7,0) + x(4,2) * x(5,0) * x(6,1) + x(4,2) * x(5,0) * x(7,1) - x(4,2) * x(5,1) * x(6,0) - x(4,2) * x(5,1) * x(7,0) - x(4,2) * x(6,0) * x(7,1) + x(4,2) * x(6,1) * x(7,0) - x(5,0) * x(6,1) * x(7,2) + x(5,0) * x(6,2) * x(7,1) + x(5,1) * x(6,0) * x(7,2) - x(5,1) * x(6,2) * x(7,0) - x(5,2) * x(6,0) * x(7,1) + x(5,2) * x(6,1) * x(7,0))/
DataType(12);
354 grad(0,0) = -x(1,1) * x(2,2) - x(1,1) * x(3,2) + x(1,1) * x(4,2) + x(1,1) * x(5,2) + x(1,2) * x(2,1) + x(1,2) * x(3,1) - x(1,2) * x(4,1) - x(1,2) * x(5,1) + x(2,1) * x(3,2) - x(2,1) * x(4,2) - x(2,1) * x(6,2) - x(2,2) * x(3,1) + x(2,2) * x(4,1) + x(2,2) * x(6,1) - x(4,1) * x(5,2) + x(4,1) * x(6,2) + x(4,2) * x(5,1) - x(4,2) * x(6,1);
355 grad(0,1) = x(1,0) * x(2,2) + x(1,0) * x(3,2) - x(1,0) * x(4,2) - x(1,0) * x(5,2) - x(1,2) * x(2,0) - x(1,2) * x(3,0) + x(1,2) * x(4,0) + x(1,2) * x(5,0) - x(2,0) * x(3,2) + x(2,0) * x(4,2) + x(2,0) * x(6,2) + x(2,2) * x(3,0) - x(2,2) * x(4,0) - x(2,2) * x(6,0) + x(4,0) * x(5,2) - x(4,0) * x(6,2) - x(4,2) * x(5,0) + x(4,2) * x(6,0);
356 grad(0,2) = -x(1,0) * x(2,1) - x(1,0) * x(3,1) + x(1,0) * x(4,1) + x(1,0) * x(5,1) + x(1,1) * x(2,0) + x(1,1) * x(3,0) - x(1,1) * x(4,0) - x(1,1) * x(5,0) + x(2,0) * x(3,1) - x(2,0) * x(4,1) - x(2,0) * x(6,1) - x(2,1) * x(3,0) + x(2,1) * x(4,0) + x(2,1) * x(6,0) - x(4,0) * x(5,1) + x(4,0) * x(6,1) + x(4,1) * x(5,0) - x(4,1) * x(6,0);
358 grad(1,0) = x(0,1) * x(2,2) + x(0,1) * x(3,2) - x(0,1) * x(4,2) - x(0,1) * x(5,2) - x(0,2) * x(2,1) - x(0,2) * x(3,1) + x(0,2) * x(4,1) + x(0,2) * x(5,1) + x(2,1) * x(3,2) - x(2,2) * x(3,1) + x(3,1) * x(5,2) + x(3,1) * x(7,2) - x(3,2) * x(5,1) - x(3,2) * x(7,1) - x(4,1) * x(5,2) + x(4,2) * x(5,1) - x(5,1) * x(7,2) + x(5,2) * x(7,1);
359 grad(1,1) = -x(0,0) * x(2,2) - x(0,0) * x(3,2) + x(0,0) * x(4,2) + x(0,0) * x(5,2) + x(0,2) * x(2,0) + x(0,2) * x(3,0) - x(0,2) * x(4,0) - x(0,2) * x(5,0) - x(2,0) * x(3,2) + x(2,2) * x(3,0) - x(3,0) * x(5,2) - x(3,0) * x(7,2) + x(3,2) * x(5,0) + x(3,2) * x(7,0) + x(4,0) * x(5,2) - x(4,2) * x(5,0) + x(5,0) * x(7,2) - x(5,2) * x(7,0);
360 grad(1,2) = x(0,0) * x(2,1) + x(0,0) * x(3,1) - x(0,0) * x(4,1) - x(0,0) * x(5,1) - x(0,1) * x(2,0) - x(0,1) * x(3,0) + x(0,1) * x(4,0) + x(0,1) * x(5,0) + x(2,0) * x(3,1) - x(2,1) * x(3,0) + x(3,0) * x(5,1) + x(3,0) * x(7,1) - x(3,1) * x(5,0) - x(3,1) * x(7,0) - x(4,0) * x(5,1) + x(4,1) * x(5,0) - x(5,0) * x(7,1) + x(5,1) * x(7,0);
362 grad(2,0) = -x(0,1) * x(1,2) - x(0,1) * x(3,2) + x(0,1) * x(4,2) + x(0,1) * x(6,2) + x(0,2) * x(1,1) + x(0,2) * x(3,1) - x(0,2) * x(4,1) - x(0,2) * x(6,1) - x(1,1) * x(3,2) + x(1,2) * x(3,1) - x(3,1) * x(6,2) - x(3,1) * x(7,2) + x(3,2) * x(6,1) + x(3,2) * x(7,1) + x(4,1) * x(6,2) - x(4,2) * x(6,1) + x(6,1) * x(7,2) - x(6,2) * x(7,1);
363 grad(2,1) = x(0,0) * x(1,2) + x(0,0) * x(3,2) - x(0,0) * x(4,2) - x(0,0) * x(6,2) - x(0,2) * x(1,0) - x(0,2) * x(3,0) + x(0,2) * x(4,0) + x(0,2) * x(6,0) + x(1,0) * x(3,2) - x(1,2) * x(3,0) + x(3,0) * x(6,2) + x(3,0) * x(7,2) - x(3,2) * x(6,0) - x(3,2) * x(7,0) - x(4,0) * x(6,2) + x(4,2) * x(6,0) - x(6,0) * x(7,2) + x(6,2) * x(7,0);
364 grad(2,2) = -x(0,0) * x(1,1) - x(0,0) * x(3,1) + x(0,0) * x(4,1) + x(0,0) * x(6,1) + x(0,1) * x(1,0) + x(0,1) * x(3,0) - x(0,1) * x(4,0) - x(0,1) * x(6,0) - x(1,0) * x(3,1) + x(1,1) * x(3,0) - x(3,0) * x(6,1) - x(3,0) * x(7,1) + x(3,1) * x(6,0) + x(3,1) * x(7,0) + x(4,0) * x(6,1) - x(4,1) * x(6,0) + x(6,0) * x(7,1) - x(6,1) * x(7,0);
366 grad(3,0) = -x(0,1) * x(1,2) + x(0,1) * x(2,2) + x(0,2) * x(1,1) - x(0,2) * x(2,1) + x(1,1) * x(2,2) - x(1,1) * x(5,2) - x(1,1) * x(7,2) - x(1,2) * x(2,1) + x(1,2) * x(5,1) + x(1,2) * x(7,1) + x(2,1) * x(6,2) + x(2,1) * x(7,2) - x(2,2) * x(6,1) - x(2,2) * x(7,1) - x(5,1) * x(7,2) + x(5,2) * x(7,1) + x(6,1) * x(7,2) - x(6,2) * x(7,1);
367 grad(3,1) = x(0,0) * x(1,2) - x(0,0) * x(2,2) - x(0,2) * x(1,0) + x(0,2) * x(2,0) - x(1,0) * x(2,2) + x(1,0) * x(5,2) + x(1,0) * x(7,2) + x(1,2) * x(2,0) - x(1,2) * x(5,0) - x(1,2) * x(7,0) - x(2,0) * x(6,2) - x(2,0) * x(7,2) + x(2,2) * x(6,0) + x(2,2) * x(7,0) + x(5,0) * x(7,2) - x(5,2) * x(7,0) - x(6,0) * x(7,2) + x(6,2) * x(7,0);
368 grad(3,2) = -x(0,0) * x(1,1) + x(0,0) * x(2,1) + x(0,1) * x(1,0) - x(0,1) * x(2,0) + x(1,0) * x(2,1) - x(1,0) * x(5,1) - x(1,0) * x(7,1) - x(1,1) * x(2,0) + x(1,1) * x(5,0) + x(1,1) * x(7,0) + x(2,0) * x(6,1) + x(2,0) * x(7,1) - x(2,1) * x(6,0) - x(2,1) * x(7,0) - x(5,0) * x(7,1) + x(5,1) * x(7,0) + x(6,0) * x(7,1) - x(6,1) * x(7,0);
370 grad(4,0) = x(0,1) * x(1,2) - x(0,1) * x(2,2) + x(0,1) * x(5,2) - x(0,1) * x(6,2) - x(0,2) * x(1,1) + x(0,2) * x(2,1) - x(0,2) * x(5,1) + x(0,2) * x(6,1) + x(1,1) * x(5,2) - x(1,2) * x(5,1) - x(2,1) * x(6,2) + x(2,2) * x(6,1) + x(5,1) * x(6,2) + x(5,1) * x(7,2) - x(5,2) * x(6,1) - x(5,2) * x(7,1) - x(6,1) * x(7,2) + x(6,2) * x(7,1);
371 grad(4,1) = -x(0,0) * x(1,2) + x(0,0) * x(2,2) - x(0,0) * x(5,2) + x(0,0) * x(6,2) + x(0,2) * x(1,0) - x(0,2) * x(2,0) + x(0,2) * x(5,0) - x(0,2) * x(6,0) - x(1,0) * x(5,2) + x(1,2) * x(5,0) + x(2,0) * x(6,2) - x(2,2) * x(6,0) - x(5,0) * x(6,2) - x(5,0) * x(7,2) + x(5,2) * x(6,0) + x(5,2) * x(7,0) + x(6,0) * x(7,2) - x(6,2) * x(7,0);
372 grad(4,2) = x(0,0) * x(1,1) - x(0,0) * x(2,1) + x(0,0) * x(5,1) - x(0,0) * x(6,1) - x(0,1) * x(1,0) + x(0,1) * x(2,0) - x(0,1) * x(5,0) + x(0,1) * x(6,0) + x(1,0) * x(5,1) - x(1,1) * x(5,0) - x(2,0) * x(6,1) + x(2,1) * x(6,0) + x(5,0) * x(6,1) + x(5,0) * x(7,1) - x(5,1) * x(6,0) - x(5,1) * x(7,0) - x(6,0) * x(7,1) + x(6,1) * x(7,0);
374 grad(5,0) = x(0,1) * x(1,2) - x(0,1) * x(4,2) - x(0,2) * x(1,1) + x(0,2) * x(4,1) + x(1,1) * x(3,2) - x(1,1) * x(4,2) + x(1,1) * x(7,2) - x(1,2) * x(3,1) + x(1,2) * x(4,1) - x(1,2) * x(7,1) + x(3,1) * x(7,2) - x(3,2) * x(7,1) - x(4,1) * x(6,2) - x(4,1) * x(7,2) + x(4,2) * x(6,1) + x(4,2) * x(7,1) - x(6,1) * x(7,2) + x(6,2) * x(7,1);
375 grad(5,1) = -x(0,0) * x(1,2) + x(0,0) * x(4,2) + x(0,2) * x(1,0) - x(0,2) * x(4,0) - x(1,0) * x(3,2) + x(1,0) * x(4,2) - x(1,0) * x(7,2) + x(1,2) * x(3,0) - x(1,2) * x(4,0) + x(1,2) * x(7,0) - x(3,0) * x(7,2) + x(3,2) * x(7,0) + x(4,0) * x(6,2) + x(4,0) * x(7,2) - x(4,2) * x(6,0) - x(4,2) * x(7,0) + x(6,0) * x(7,2) - x(6,2) * x(7,0);
376 grad(5,2) = x(0,0) * x(1,1) - x(0,0) * x(4,1) - x(0,1) * x(1,0) + x(0,1) * x(4,0) + x(1,0) * x(3,1) - x(1,0) * x(4,1) + x(1,0) * x(7,1) - x(1,1) * x(3,0) + x(1,1) * x(4,0) - x(1,1) * x(7,0) + x(3,0) * x(7,1) - x(3,1) * x(7,0) - x(4,0) * x(6,1) - x(4,0) * x(7,1) + x(4,1) * x(6,0) + x(4,1) * x(7,0) - x(6,0) * x(7,1) + x(6,1) * x(7,0);
378 grad(6,0) = -x(0,1) * x(2,2) + x(0,1) * x(4,2) + x(0,2) * x(2,1) - x(0,2) * x(4,1) - x(2,1) * x(3,2) + x(2,1) * x(4,2) - x(2,1) * x(7,2) + x(2,2) * x(3,1) - x(2,2) * x(4,1) + x(2,2) * x(7,1) - x(3,1) * x(7,2) + x(3,2) * x(7,1) + x(4,1) * x(5,2) + x(4,1) * x(7,2) - x(4,2) * x(5,1) - x(4,2) * x(7,1) + x(5,1) * x(7,2) - x(5,2) * x(7,1);
379 grad(6,1) = x(0,0) * x(2,2) - x(0,0) * x(4,2) - x(0,2) * x(2,0) + x(0,2) * x(4,0) + x(2,0) * x(3,2) - x(2,0) * x(4,2) + x(2,0) * x(7,2) - x(2,2) * x(3,0) + x(2,2) * x(4,0) - x(2,2) * x(7,0) + x(3,0) * x(7,2) - x(3,2) * x(7,0) - x(4,0) * x(5,2) - x(4,0) * x(7,2) + x(4,2) * x(5,0) + x(4,2) * x(7,0) - x(5,0) * x(7,2) + x(5,2) * x(7,0);
380 grad(6,2) = -x(0,0) * x(2,1) + x(0,0) * x(4,1) + x(0,1) * x(2,0) - x(0,1) * x(4,0) - x(2,0) * x(3,1) + x(2,0) * x(4,1) - x(2,0) * x(7,1) + x(2,1) * x(3,0) - x(2,1) * x(4,0) + x(2,1) * x(7,0) - x(3,0) * x(7,1) + x(3,1) * x(7,0) + x(4,0) * x(5,1) + x(4,0) * x(7,1) - x(4,1) * x(5,0) - x(4,1) * x(7,0) + x(5,0) * x(7,1) - x(5,1) * x(7,0);
382 grad(7,0) = x(1,1) * x(3,2) - x(1,1) * x(5,2) - x(1,2) * x(3,1) + x(1,2) * x(5,1) - x(2,1) * x(3,2) + x(2,1) * x(6,2) + x(2,2) * x(3,1) - x(2,2) * x(6,1) - x(3,1) * x(5,2) + x(3,1) * x(6,2) + x(3,2) * x(5,1) - x(3,2) * x(6,1) + x(4,1) * x(5,2) - x(4,1) * x(6,2) - x(4,2) * x(5,1) + x(4,2) * x(6,1) - x(5,1) * x(6,2) + x(5,2) * x(6,1);
383 grad(7,1) = -x(1,0) * x(3,2) + x(1,0) * x(5,2) + x(1,2) * x(3,0) - x(1,2) * x(5,0) + x(2,0) * x(3,2) - x(2,0) * x(6,2) - x(2,2) * x(3,0) + x(2,2) * x(6,0) + x(3,0) * x(5,2) - x(3,0) * x(6,2) - x(3,2) * x(5,0) + x(3,2) * x(6,0) - x(4,0) * x(5,2) + x(4,0) * x(6,2) + x(4,2) * x(5,0) - x(4,2) * x(6,0) + x(5,0) * x(6,2) - x(5,2) * x(6,0);
384 grad(7,2) = x(1,0) * x(3,1) - x(1,0) * x(5,1) - x(1,1) * x(3,0) + x(1,1) * x(5,0) - x(2,0) * x(3,1) + x(2,0) * x(6,1) + x(2,1) * x(3,0) - x(2,1) * x(6,0) - x(3,0) * x(5,1) + x(3,0) * x(6,1) + x(3,1) * x(5,0) - x(3,1) * x(6,0) + x(4,0) * x(5,1) - x(4,0) * x(6,1) - x(4,1) * x(5,0) + x(4,1) * x(6,0) - x(5,0) * x(6,1) + x(5,1) * x(6,0);
398 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
400 for(
Index cell(0); cell < h_.size(); ++cell)
413 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
416 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
419 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
422 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
424 x[j] = coords_(idx(cell,j));
442 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
444 Tx local_grad(DataType_(0));
448 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
451 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
453 x[j] = coords_(idx(cell,j));
458 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
460 Index i(idx(cell, j));
461 grad_(i, grad_(i) + local_grad[j]);
475 for(
int d(0); d < MeshType::world_dim; ++d)
477 mat_tensor(d,d) = scal;
494 template<
typename DataType_>
495 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>,2,DataType_>>,DataType_>
499 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>,2,DataType_>>
TrafoType;
503 typedef typename TrafoType::ShapeType
ShapeType;
505 typedef typename TrafoType::MeshType
MeshType;
507 typedef Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim>
Tx;
509 typedef Tiny::Matrix<DataType_, MeshType::world_dim, MeshType::world_dim>
MatTensorType;
513 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim>
VectorType;
522 (x(0,0) * x(1,1) - x(0,0) * x(2,1) - x(1,0) * x(0,1) + x(2,0) * x(0,1) + x(1,0) * x(2,1) - x(2,0) * x(1,1));
532 grad(0,0) = fac * ( x(1,1) - x(2,1));
533 grad(0,1) = fac * (-x(1,0) + x(2,0));
534 grad(1,0) = fac * (-x(0,1) + x(2,1));
535 grad(1,1) = fac * ( x(0,0) - x(2,0));
536 grad(2,0) = fac * ( x(0,1) - x(1,1));
537 grad(2,1) = fac * (-x(0,0) + x(1,0));
546 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
548 for(
Index cell(0); cell < h_.size(); ++cell)
550 h_(cell,
Math::pow(lambda_(cell)*sum_det_,exponent));
560 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
563 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
566 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
569 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
571 x[j] = coords_(idx(cell,j));
589 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
591 Tx local_grad(DataType_(0));
595 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
598 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
599 x[j] = coords_(idx(cell,j));
603 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
605 Index i(idx(cell, j));
606 grad_(i, grad_(i) + local_grad[j]);
625 mat_tensor(0,0) = scal;
644 template<
typename DataType_>
645 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>,3,DataType_>>,DataType_>
649 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>, 3,DataType_>>
TrafoType;
653 typedef typename TrafoType::ShapeType
ShapeType;
655 typedef typename TrafoType::MeshType
MeshType;
657 typedef Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim>
Tx;
659 typedef Tiny::Matrix<DataType_, MeshType::world_dim, MeshType::world_dim>
MatTensorType;
663 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim>
VectorType;
671 return -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(0,0) * x(1,1) * x(2,2) - x(0,0) * x(1,1) * x(3,2) - x(0,0) * x(1,2) * x(2,1) + x(0,0) * x(1,2) * x(3,1) + x(0,0) * x(2,1) * x(3,2) - x(0,0) * x(2,2) * x(3,1) - x(0,1) * x(1,0) * x(2,2) + x(0,1) * x(1,0) * x(3,2) + x(0,1) * x(1,2) * x(2,0) - x(0,1) * x(1,2) * x(3,0) - x(0,1) * x(2,0) * x(3,2) + x(0,1) * x(2,2) * x(3,0) + x(0,2) * x(1,0) * x(2,1) - x(0,2) * x(1,0) * x(3,1) - x(0,2) * x(1,1) * x(2,0) + x(0,2) * x(1,1) * x(3,0) + x(0,2) * x(2,0) * x(3,1) - x(0,2) * x(2,1) * x(3,0) - x(1,0) * x(2,1) * x(3,2) + x(1,0) * x(2,2) * x(3,1) + x(1,1) * x(2,0) * x(3,2) - x(1,1) * x(2,2) * x(3,0) - x(1,2) * x(2,0) * x(3,1) + x(1,2) * x(2,1) * x(3,0)) /
DataType(3);
679 grad(0,0) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(1,1) * x(2,2) - x(1,1) * x(3,2) - x(2,1) * x(1,2) + x(3,1) * x(1,2) + x(2,1) * x(3,2) - x(3,1) * x(2,2)) /
DataType(3);
680 grad(0,1) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (-x(1,0) * x(2,2) + x(1,0) * x(3,2) + x(2,0) * x(1,2) - x(3,0) * x(1,2) - x(2,0) * x(3,2) + x(3,0) * x(2,2)) /
DataType(3);
681 grad(0,2) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(1,0) * x(2,1) - x(1,0) * x(3,1) - x(2,0) * x(1,1) + x(3,0) * x(1,1) + x(2,0) * x(3,1) - x(3,0) * x(2,1)) /
DataType(3);
683 grad(1,0) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (-x(0,1) * x(2,2) + x(0,1) * x(3,2) + x(2,1) * x(0,2) - x(3,1) * x(0,2) - x(2,1) * x(3,2) + x(3,1) * x(2,2)) /
DataType(3);
684 grad(1,1) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(0,0) * x(2,2) - x(0,0) * x(3,2) - x(2,0) * x(0,2) + x(3,0) * x(0,2) + x(2,0) * x(3,2) - x(3,0) * x(2,2)) /
DataType(3);
685 grad(1,2) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (-x(0,0) * x(2,1) + x(0,0) * x(3,1) + x(2,0) * x(0,1) - x(3,0) * x(0,1) - x(2,0) * x(3,1) + x(3,0) * x(2,1)) /
DataType(3);
687 grad(2,0) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(0,1) * x(1,2) - x(0,1) * x(3,2) - x(1,1) * x(0,2) + x(3,1) * x(0,2) + x(1,1) * x(3,2) - x(3,1) * x(1,2)) /
DataType(3);
688 grad(2,1) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (-x(0,0) * x(1,2) + x(0,0) * x(3,2) + x(1,0) * x(0,2) - x(3,0) * x(0,2) - x(1,0) * x(3,2) + x(3,0) * x(1,2)) /
DataType(3);
689 grad(2,2) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(0,0) * x(1,1) - x(0,0) * x(3,1) - x(1,0) * x(0,1) + x(3,0) * x(0,1) + x(1,0) * x(3,1) - x(3,0) * x(1,1)) /
DataType(3);
691 grad(3,0) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (-x(0,1) * x(1,2) + x(0,1) * x(2,2) + x(1,1) * x(0,2) - x(2,1) * x(0,2) - x(1,1) * x(2,2) + x(2,1) * x(1,2)) /
DataType(3);
692 grad(3,1) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (x(0,0) * x(1,2) - x(0,0) * x(2,2) - x(1,0) * x(0,2) + x(2,0) * x(0,2) + x(1,0) * x(2,2) - x(2,0) * x(1,2)) /
DataType(3);
693 grad(3,2) = -
Math::sqrt(
DataType(3)) *
Math::sqrt(
DataType(6)) * (-x(0,0) * x(1,1) + x(0,0) * x(2,1) + x(1,0) * x(0,1) - x(2,0) * x(0,1) - x(1,0) * x(2,1) + x(2,0) * x(1,1)) /
DataType(3);
704 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
706 for(
Index cell(0); cell < h_.size(); ++cell)
708 h_(cell,
Math::pow(lambda_(cell)*sum_det_,exponent));
718 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
721 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
724 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
727 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
729 x[j] = coords_(idx(cell,j));
747 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
749 Tx local_grad(DataType_(0));
753 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
756 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
758 x[j] = coords_(idx(cell,j));
763 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
765 Index i(idx(cell, j));
766 grad_(i, grad_(i) + local_grad[j]);
780 mat_tensor(0,0) = scal;
795 extern template struct RumpfTrafo<
796 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<2>, 2,
double>>,
double >;
797 extern template struct RumpfTrafo<
798 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>, 3,
double>>,
double >;
799 extern template struct RumpfTrafo<
800 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>, 2,
double>>,
double >;
801 extern template struct RumpfTrafo<
802 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>, 3,
double>>,
double >;
Blocked Dense data vector class template.
Dense data vector class template.
Tiny Matrix class template.
Standard transformation mapping class template.
T_ sqrt(T_ x)
Returns the square-root of a value.
T_ pow(T_ x, T_ y)
Returns x raised to the power of y.
@ grad
specifies whether the space should supply basis function gradients
std::uint64_t Index
Index data type.
Computes quantities associated with the transformation to Rumpf reference cells.
static void compute_grad_sum_det(VectorType &grad_, const VectorType &coords_, const MeshType &mesh_)
Computes the gradient of sum of all cell's local transformation determinants.
TrafoType::MeshType MeshType
Type of the transformation's underlying mesh.
static void compute_h(ScalarVectorType &h_, const ScalarVectorType &lambda_, const DataType &sum_det_)
Computes the optimal local mesh size.
TrafoType::ShapeType ShapeType
Our shape type, as the Rumpf smoother needs to know what we are working with.
static DataType_ compute_sum_det(const VectorType &coords_, const MeshType &mesh_)
Computes the sum of the local transformation's determinants.
Tiny::Matrix< DataType_, Shape::FaceTraits< ShapeType, 0 >::count, MeshType::world_dim > Tx
Type for a pack of local vertex coordinates.
DataType_ DataType
Our data type.
static MatTensorType compute_mat_tensor(const Tx &x, const DataType_ &h)
Computes the local matrix describing the material behavior.
static DataType compute_det(Tx &x)
Compute the transformation's determinant on a cell.
Tiny::Matrix< DataType_, MeshType::world_dim, MeshType::world_dim > MatTensorType
Type for the material tensor.
TrafoType_ TrafoType
Our transformation type.
static void compute_grad_det(Tx &grad, const Tx &x)
Computes the transformation's determinant's gradient on a cell.
LAFEM::DenseVectorBlocked< DataType, Index, MeshType::world_dim > VectorType
Vector type for coordinate vectors etc.
LAFEM::DenseVector< DataType, Index > ScalarVectorType
Vector type for element sizes etc.