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 Memory::TypedView<DataType_> vh = h_.elements_view_w();
226 const Memory::TypedView<DataType_> vl = lambda_.elements_view_r();
227 for(
Index cell(0); cell < h_.size(); ++cell)
240 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
243 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
246 const auto vc = coords_.elements_view_r();
247 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
250 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
252 x[j] = vc(idx(cell,j));
270 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
272 Tx local_grad(DataType_(0));
275 auto vg = grad_.elements_view_rw();
276 const auto vc = coords_.elements_view_r();
278 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
281 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
283 x[j] = vc(idx(cell,j));
288 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
290 vg[idx(cell, j)] += local_grad[j];
304 for(
int d(0); d < MeshType::world_dim; ++d)
306 mat_tensor(d,d) = scal;
323 template<
typename DataType_>
324 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>,3,DataType_>>,DataType_>
328 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>,3,DataType_>>
TrafoType;
332 typedef typename TrafoType::ShapeType
ShapeType;
334 typedef typename TrafoType::MeshType
MeshType;
336 typedef Tiny::Matrix<DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim>
Tx;
338 typedef Tiny::Matrix<DataType_, MeshType::world_dim, MeshType::world_dim>
MatTensorType;
342 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim>
VectorType;
350 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);
358 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);
359 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);
360 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);
362 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);
363 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);
364 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);
366 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);
367 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);
368 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);
370 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);
371 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);
372 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);
374 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);
375 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);
376 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);
378 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);
379 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);
380 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);
382 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);
383 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);
384 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);
386 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);
387 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);
388 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);
402 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
404 Memory::TypedView<DataType> vh = h_.elements_view_w();
405 const Memory::TypedView<DataType> vl = lambda_.elements_view_r();
406 for(
Index cell(0); cell < h_.size(); ++cell)
419 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
422 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
425 const auto vc = coords_.elements_view_r();
426 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
429 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
431 x[j] = vc(idx(cell,j));
449 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
451 Tx local_grad(DataType_(0));
454 auto vg = grad_.elements_view_rw();
455 const auto vc = coords_.elements_view_r();
457 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
460 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
462 x[j] = vc(idx(cell,j));
467 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
469 vg[idx(cell, j)] += local_grad[j];
483 for(
int d(0); d < MeshType::world_dim; ++d)
485 mat_tensor(d,d) = scal;
502 template<
typename DataType_>
503 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>,2,DataType_>>,DataType_>
507 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>,2,DataType_>>
TrafoType;
511 typedef typename TrafoType::ShapeType
ShapeType;
513 typedef typename TrafoType::MeshType
MeshType;
515 typedef Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim>
Tx;
517 typedef Tiny::Matrix<DataType_, MeshType::world_dim, MeshType::world_dim>
MatTensorType;
521 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim>
VectorType;
530 (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));
540 grad(0,0) = fac * ( x(1,1) - x(2,1));
541 grad(0,1) = fac * (-x(1,0) + x(2,0));
542 grad(1,0) = fac * (-x(0,1) + x(2,1));
543 grad(1,1) = fac * ( x(0,0) - x(2,0));
544 grad(2,0) = fac * ( x(0,1) - x(1,1));
545 grad(2,1) = fac * (-x(0,0) + x(1,0));
554 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
556 Memory::TypedView<DataType_> vh = h_.elements_view_w();
557 const Memory::TypedView<DataType_> vl = lambda_.elements_view_r();
559 for(
Index cell(0); cell < h_.size(); ++cell)
561 vh[cell] =
Math::pow(vl(cell)*sum_det_,exponent);
571 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
574 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
577 const auto vc = coords_.elements_view_r();
578 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
581 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
583 x[j] = vc(idx(cell,j));
601 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
603 Tx local_grad(DataType_(0));
606 auto vg = grad_.elements_view_rw();
607 const auto vc = coords_.elements_view_r();
609 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
612 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
613 x[j] = vc(idx(cell,j));
617 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
619 vg[idx(cell, j)] += local_grad[j];
637 mat_tensor(0,0) = scal;
656 template<
typename DataType_>
657 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>,3,DataType_>>,DataType_>
661 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>, 3,DataType_>>
TrafoType;
665 typedef typename TrafoType::ShapeType
ShapeType;
667 typedef typename TrafoType::MeshType
MeshType;
669 typedef Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim>
Tx;
671 typedef Tiny::Matrix<DataType_, MeshType::world_dim, MeshType::world_dim>
MatTensorType;
675 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim>
VectorType;
683 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);
691 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);
692 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);
693 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);
695 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);
696 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);
697 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);
699 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);
700 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);
701 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);
703 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);
704 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);
705 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);
716 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
718 Memory::TypedView<DataType_> vh = h_.elements_view_w();
719 const Memory::TypedView<DataType_> vl = lambda_.elements_view_r();
720 for(
Index cell(0); cell < h_.size(); ++cell)
722 vh[cell] =
Math::pow(vl(cell)*sum_det_,exponent);
732 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
735 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
738 const auto vc = coords_.elements_view_r();
739 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
742 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
744 x[j] = vc(idx(cell,j));
762 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
764 Tx local_grad(DataType_(0));
768 auto vg = grad_.elements_view_rw();
769 const auto vc = coords_.elements_view_r();
771 for(
Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
774 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
776 x[j] = vc(idx(cell,j));
781 for(
int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
783 vg[idx(cell, j)] += local_grad[j];
797 mat_tensor(0,0) = scal;
812 extern template struct RumpfTrafo<
813 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<2>, 2,
double>>,
double >;
814 extern template struct RumpfTrafo<
815 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>, 3,
double>>,
double >;
816 extern template struct RumpfTrafo<
817 Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>, 2,
double>>,
double >;
818 extern template struct RumpfTrafo<
819 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.