Dune Core Modules (2.3.1)

transformation.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_ALUGRID_TRANSFORMATION_HH
4#define DUNE_ALUGRID_TRANSFORMATION_HH
5
8
9#if HAVE_ALUGRID
10
11namespace Dune
12{
13
14 template< class ctype, int dimw >
15 struct ALUGridTransformation
16 {
17 static const int dimension = dimw;
18
19 typedef FieldVector< ctype, dimension > WorldVector;
20 typedef FieldMatrix< ctype, dimension, dimension > WorldMatrix;
21
22 ALUGridTransformation ( const WorldMatrix &matrix, const WorldVector &shift )
23 : matrix_( matrix ),
24 shift_( shift )
25 {}
26
27 WorldVector evaluate ( const WorldVector &x ) const
28 {
29 WorldVector y = shift_;
30 matrix_.umv( x, y );
31 return y;
32 }
33
34 WorldVector evaluateInverse ( const WorldVector &y ) const
35 {
36 // Note: We assume the matrix to be orthogonal, here
37 WorldVector ys = y - shift_;
38 WorldVector x;
39 matrix_.mtv( ys, x );
40 return x;
41 }
42
43 private:
44 WorldMatrix matrix_;
45 WorldVector shift_;
46 };
47
48}
49
50#endif // #if HAVE_ALUGRID
51
52#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: alignment.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)