FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
rumpf_trafo.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
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>
13
14namespace FEAT
15{
16 namespace Meshopt
17 {
34#ifndef DOXYGEN
35 template<typename TrafoType_, typename DataType_>
36 struct RumpfTrafo;
37 // Note:
38 // The following block serves as an element interface documentation and is therefore only
39 // visible to doxygen. The actual functionality has to be supplied by the implementation
40 // of specializations in TrafoType_.
41#else
42 template<typename TrafoType_, typename DataType_>
44 {
46 typedef DataType_ DataType;
48 typedef TrafoType_ TrafoType;
50 typedef typename TrafoType::ShapeType ShapeType;
52 typedef typename TrafoType::MeshType MeshType;
61
89 static DataType_ compute_sum_det(const VectorType& coords_, const MeshType& mesh_);
90
108 static void compute_h(ScalarVectorType& h_, const ScalarVectorType& lambda_, const DataType& sum_det_);
109
125 static void compute_grad_det(Tx& grad, const Tx& x);
126
143 static void compute_grad_sum_det(VectorType& grad_, const VectorType& coords_, const MeshType& mesh_);
144
157 static MatTensorType compute_mat_tensor(const Tx& x, const DataType_& h);
158 }; // struct RumpfTrafo;
159#endif
160
162
171 template<typename DataType_>
172 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<2>,2,DataType_>>,DataType_>
173 {
174 public:
178 typedef DataType_ DataType;
180 typedef typename TrafoType::ShapeType ShapeType;
182 typedef typename TrafoType::MeshType MeshType;
191
192 private:
196 static DataType compute_det(Tx& x)
197 {
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);
200 }
201
205 static void compute_grad_det(Tx& grad, const Tx& x)
206 {
207 grad(0,0) = ( x(1,1) - x(2,1)) / DataType(2);
208 grad(0,1) = (-x(1,0) + x(2,0)) / DataType(2);
209 grad(1,0) = (-x(0,1) + x(3,1)) / DataType(2);
210 grad(1,1) = ( x(0,0) - x(3,0)) / DataType(2);
211 grad(2,0) = ( x(0,1) - x(3,1)) / DataType(2);
212 grad(2,1) = (-x(0,0) + x(3,0)) / DataType(2);
213 grad(3,0) = (-x(1,1) + x(2,1)) / DataType(2);
214 grad(3,1) = ( x(1,0) - x(2,0)) / DataType(2);
215 }
216
217 public:
221 static void compute_h(ScalarVectorType& h_, const ScalarVectorType& lambda_, const DataType& sum_det_)
222 {
223 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
224
225 for(Index cell(0); cell < h_.size(); ++cell)
226 {
227 // For hypercubes, h is half the refence cell's edge length
228 h_(cell, DataType(0.5)*Math::pow(lambda_(cell)*sum_det_,exponent));
229 }
230 }
231
235 static DataType_ compute_sum_det(const VectorType& coords_, const MeshType& mesh_)
236 {
237 // This will hold the coordinates for one element for passing to other routines
238 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
239
240 // Index set for local/global numbering
241 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
242
243 DataType sum_det(0);
244 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
245 {
246 // Get local coordinates
247 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
248 {
249 x[j] = coords_(idx(cell,j));
250 }
251
252 sum_det += compute_det(x);
253 }
254
255 return sum_det;
256 }
257
261 static void compute_grad_sum_det(VectorType& grad_, const VectorType& coords_, const MeshType& mesh_)
262 {
263 // This will hold the coordinates for one element for passing to other routines
264 Tx x(DataType_(0));
265
266 // Index set for local/global numbering
267 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
268
269 Tx local_grad(DataType_(0));
270
271 grad_.format();
272
273 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
274 {
275 // Get local coordinates
276 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
277 {
278 x[j] = coords_(idx(cell,j));
279 }
280
281 compute_grad_det(local_grad, x);
282
283 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
284 {
285 Index i(idx(cell, j));
286 grad_(i, grad_(i) + local_grad[j]);
287 }
288
289 }
290 } // compute_grad_sum_det
291
295 static MatTensorType compute_mat_tensor(const Tx& DOXY(x), const DataType_& h)
296 {
297 MatTensorType mat_tensor(DataType_(0));
298 DataType scal(DataType(1)/h);
299
300 for(int d(0); d < MeshType::world_dim; ++d)
301 {
302 mat_tensor(d,d) = scal;
303 }
304
305 return mat_tensor;
306 }
307
308 }; // RumpfTrafo<Hypercube<2>>
309
319 template<typename DataType_>
320 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>,3,DataType_>>,DataType_>
321 {
322 public:
324 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Hypercube<3>,3,DataType_>> TrafoType;
326 typedef DataType_ DataType;
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;
336 typedef LAFEM::DenseVector<DataType, Index> ScalarVectorType;
338 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim> VectorType;
339
340 private:
344 static DataType compute_det(Tx& x)
345 {
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);
347 }
348
352 static void compute_grad_det(Tx& grad, const Tx& x)
353 {
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);
357
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);
361
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);
365
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);
369
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);
373
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);
377
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);
381
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);
385
386 // Important: Scale the matrix with the missing factor 1/96
387
388 grad *= (DataType(1)/DataType(96));
389
390 }
391
392 public:
396 static void compute_h(ScalarVectorType& h_, const ScalarVectorType& lambda_, const DataType& sum_det_)
397 {
398 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
399
400 for(Index cell(0); cell < h_.size(); ++cell)
401 {
402 // For hypercubes, h is half the refence cell's edge length
403 h_(cell, DataType(0.5)*Math::pow(lambda_(cell)*sum_det_,exponent));
404 }
405 }
406
410 static DataType_ compute_sum_det(const VectorType& coords_, const MeshType& mesh_)
411 {
412 // This will hold the coordinates for one element for passing to other routines
413 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
414
415 // Index set for local/global numbering
416 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
417
418 DataType sum_det(0);
419 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
420 {
421 // Get local coordinates
422 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
423 {
424 x[j] = coords_(idx(cell,j));
425 }
426
427 sum_det += compute_det(x);
428 }
429
430 return sum_det;
431 }
432
436 static void compute_grad_sum_det(VectorType& grad_, const VectorType& coords_, const MeshType& mesh_)
437 {
438 // This will hold the coordinates for one element for passing to other routines
439 Tx x(DataType_(0));
440
441 // Index set for local/global numbering
442 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
443
444 Tx local_grad(DataType_(0));
445
446 grad_.format();
447
448 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
449 {
450 // Get local coordinates
451 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
452 {
453 x[j] = coords_(idx(cell,j));
454 }
455
456 compute_grad_det(local_grad, x);
457
458 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
459 {
460 Index i(idx(cell, j));
461 grad_(i, grad_(i) + local_grad[j]);
462 }
463
464 }
465 } // compute_grad_sum_det
466
470 static MatTensorType compute_mat_tensor(const Tx& DOXY(x), const DataType_& h)
471 {
472 MatTensorType mat_tensor(DataType_(0));
473 DataType scal(DataType(1)/h);
474
475 for(int d(0); d < MeshType::world_dim; ++d)
476 {
477 mat_tensor(d,d) = scal;
478 }
479
480 return mat_tensor;
481 }
482
483 }; // RumpfTrafo<Hypercube<3>>
484
494 template<typename DataType_>
495 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>,2,DataType_>>,DataType_>
496 {
497 public:
499 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<2>,2,DataType_>> TrafoType;
501 typedef DataType_ DataType;
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;
511 typedef LAFEM::DenseVector<DataType, Index> ScalarVectorType;
513 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim> VectorType;
514
515 private:
519 static DataType compute_det(Tx& x)
520 {
521 return DataType(2) / Math::sqrt(DataType(3)) *
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));
523 }
524
528 static inline void compute_grad_det(Tx& grad, const Tx& x)
529 {
530 const DataType fac(DataType(2) / Math::sqrt(DataType(3)));
531
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));
538 }
539
540 public:
544 static void compute_h(ScalarVectorType& h_, const ScalarVectorType& lambda_, const DataType& sum_det_)
545 {
546 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
547
548 for(Index cell(0); cell < h_.size(); ++cell)
549 {
550 h_(cell, Math::pow(lambda_(cell)*sum_det_,exponent));
551 }
552 }
553
557 static DataType_ compute_sum_det(const VectorType& coords_, const MeshType& mesh_)
558 {
559 // This will hold the coordinates for one element for passing to other routines
560 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
561
562 // Index set for local/global numbering
563 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
564
565 DataType sum_det(0);
566 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
567 {
568 // Get local coordinates
569 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
570 {
571 x[j] = coords_(idx(cell,j));
572 }
573
574 sum_det += compute_det(x);
575 }
576
577 return sum_det;
578 }
579
583 static void compute_grad_sum_det(VectorType& grad_, const VectorType& coords_, const MeshType& mesh_)
584 {
585 // This will hold the coordinates for one element for passing to other routines
586 Tx x(DataType_(0));
587
588 // Index set for local/global numbering
589 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
590
591 Tx local_grad(DataType_(0));
592
593 grad_.format();
594
595 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
596 {
597 // Get local coordinates
598 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
599 x[j] = coords_(idx(cell,j));
600
601 compute_grad_det(local_grad, x);
602
603 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
604 {
605 Index i(idx(cell, j));
606 grad_(i, grad_(i) + local_grad[j]);
607 }
608
609 }
610 } // compute_grad_sum_det
611
615 static MatTensorType compute_mat_tensor(const Tx& DOXY(x), const DataType_& h)
616 {
617 MatTensorType mat_tensor(DataType_(0));
618 DataType scal(DataType(1)/h);
619
620 //mat_tensor(0,0) = scal;
621
622 //mat_tensor(1,0) = -scal/Math::sqrt(DataType(3));
623 //mat_tensor(1,1) = scal*DataType_(2)/Math::sqrt(DataType(3));
624
625 mat_tensor(0,0) = scal;
626 mat_tensor(0,1) = -scal/Math::sqrt(DataType(3));
627
628 mat_tensor(1,1) = scal*DataType_(2)/Math::sqrt(DataType(3));
629
630 return mat_tensor;
631 }
632
633 }; // RumpfTrafo<Simplex<2>>
634
644 template<typename DataType_>
645 struct RumpfTrafo<Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>,3,DataType_>>,DataType_>
646 {
647 public:
649 typedef Trafo::Standard::Mapping<Geometry::ConformalMesh<Shape::Simplex<3>, 3,DataType_>> TrafoType;
651 typedef DataType_ DataType;
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;
661 typedef LAFEM::DenseVector<DataType, Index> ScalarVectorType;
663 typedef LAFEM::DenseVectorBlocked<DataType, Index, MeshType::world_dim> VectorType;
664
665 private:
669 static DataType compute_det(Tx& x)
670 {
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);
672 }
673
677 static inline void compute_grad_det(Tx& grad, const Tx& x)
678 {
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);
682
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);
686
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);
690
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);
694
695
696 }
697
698 public:
702 static void compute_h(ScalarVectorType& h_, const ScalarVectorType& lambda_, const DataType& sum_det_)
703 {
704 DataType_ exponent = DataType_(1)/DataType_(MeshType::world_dim);
705
706 for(Index cell(0); cell < h_.size(); ++cell)
707 {
708 h_(cell, Math::pow(lambda_(cell)*sum_det_,exponent));
709 }
710 }
711
715 static DataType_ compute_sum_det(const VectorType& coords_, const MeshType& mesh_)
716 {
717 // This will hold the coordinates for one element for passing to other routines
718 Tiny::Matrix <DataType_, Shape::FaceTraits<ShapeType,0>::count, MeshType::world_dim> x;
719
720 // Index set for local/global numbering
721 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
722
723 DataType sum_det(0);
724 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
725 {
726 // Get local coordinates
727 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
728 {
729 x[j] = coords_(idx(cell,j));
730 }
731
732 sum_det += compute_det(x);
733 }
734
735 return sum_det;
736 }
737
741 static void compute_grad_sum_det(VectorType& grad_, const VectorType& coords_, const MeshType& mesh_)
742 {
743 // This will hold the coordinates for one element for passing to other routines
744 Tx x(DataType_(0));
745
746 // Index set for local/global numbering
747 const auto& idx = mesh_.template get_index_set<ShapeType::dimension,0>();
748
749 Tx local_grad(DataType_(0));
750
751 grad_.format();
752
753 for(Index cell(0); cell < mesh_.get_num_entities(ShapeType::dimension); ++cell)
754 {
755 // Get local coordinates
756 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
757 {
758 x[j] = coords_(idx(cell,j));
759 }
760
761 compute_grad_det(local_grad, x);
762
763 for(int j(0); j < Shape::FaceTraits<ShapeType,0>::count; ++j)
764 {
765 Index i(idx(cell, j));
766 grad_(i, grad_(i) + local_grad[j]);
767 }
768
769 }
770 } // compute_grad_sum_det
771
775 static MatTensorType compute_mat_tensor(const Tx& DOXY(x), const DataType_& h)
776 {
777 MatTensorType mat_tensor(DataType_(0));
778 DataType scal(DataType(1)/h);
779
780 mat_tensor(0,0) = scal;
781 mat_tensor(0,1) = -scal/Math::sqrt(DataType(3));
782 mat_tensor(0,2) = -scal/Math::sqrt(DataType(6));
783
784 mat_tensor(1,1) = scal*DataType_(2)/Math::sqrt(DataType(3));
785 mat_tensor(1,2) = -scal/Math::sqrt(DataType(6));
786
787 mat_tensor(2,2) = scal*DataType(0.5)*Math::sqrt(DataType(6));
788
789 return mat_tensor;
790 }
791
792
793 }; // RumpfTrafo<Simplex<3>>
794#ifdef FEAT_EICKT
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 >;
803#endif // FEAT_EICKT
804
806 } // namespace Meshopt
807} // namespace FEAT
FEAT Kernel base header.
Blocked Dense data vector class template.
Dense data vector class template.
Tiny Matrix class template.
Standard transformation mapping class template.
Definition: mapping.hpp:39
T_ sqrt(T_ x)
Returns the square-root of a value.
Definition: math.hpp:300
T_ pow(T_ x, T_ y)
Returns x raised to the power of y.
Definition: math.hpp:643
FEAT namespace.
Definition: adjactor.hpp:12
@ 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.
Definition: rumpf_trafo.hpp:44
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.
Definition: rumpf_trafo.hpp:52
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.
Definition: rumpf_trafo.hpp:50
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.
Definition: rumpf_trafo.hpp:54
DataType_ DataType
Our data type.
Definition: rumpf_trafo.hpp:46
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.
Definition: rumpf_trafo.hpp:56
TrafoType_ TrafoType
Our transformation type.
Definition: rumpf_trafo.hpp:48
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.
Definition: rumpf_trafo.hpp:60
LAFEM::DenseVector< DataType, Index > ScalarVectorType
Vector type for element sizes etc.
Definition: rumpf_trafo.hpp:58