Dune Core Modules (2.9.0)

transformation.hh
1#ifndef DUNE_ALUGRID_TRANSFORMATION_HH
2#define DUNE_ALUGRID_TRANSFORMATION_HH
3
6
7namespace Dune
8{
9
10 template< class ctype, int dimw >
11 struct ALUGridTransformation
12 {
13 static const int dimension = dimw;
14
15 typedef FieldVector< ctype, dimension > WorldVector;
17
18 ALUGridTransformation ( const WorldMatrix &matrix, const WorldVector &shift )
19 : matrix_( matrix ),
20 shift_( shift )
21 {}
22
23 WorldVector evaluate ( const WorldVector &x ) const
24 {
25 WorldVector y = shift_;
26 matrix_.umv( x, y );
27 return y;
28 }
29
30 WorldVector evaluateInverse ( const WorldVector &y ) const
31 {
32 // Note: We assume the matrix to be orthogonal, here
33 WorldVector ys = y - shift_;
34 WorldVector x;
35 matrix_.mtv( ys, x );
36 return x;
37 }
38
39 private:
40 WorldMatrix matrix_;
41 WorldVector shift_;
42 };
43
44}
45
46#endif // #ifndef DUNE_ALUGRID_TRANSFORMATION_HH
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)