1#ifndef DUNE_FEM_SPACE_BASISFUNCTIONSET_TRANSFORMATION_HH
2#define DUNE_FEM_SPACE_BASISFUNCTIONSET_TRANSFORMATION_HH
8#include <dune/fem/common/explicitfieldvector.hh>
9#include <dune/fem/common/fmatrixcol.hh>
20 template<
class GeometryJacobianInverseTransposed,
class K,
int ROWS >
21 void jacobianTransformation (
const GeometryJacobianInverseTransposed &gjit,
22 const FieldMatrix< K, ROWS, GeometryJacobianInverseTransposed::cols > &a,
23 FieldMatrix< K, ROWS, GeometryJacobianInverseTransposed::rows > &b )
25 for(
int r = 0; r < ROWS; ++r )
26 gjit.mv( a[ r ], b[ r ] );
34 template<
class Geometry >
35 struct JacobianTransformation
40 JacobianTransformation (
const Geometry &geometry,
const LocalCoordinate &x )
41 : gjit_( geometry.jacobianInverseTransposed( x ) )
44 template<
class A,
class B >
45 void operator() (
const A &a, B &b )
const
47 jacobianTransformation( gjit_, a, b );
51 GeometryJacobianInverseTransposed gjit_;
59 template<
class GeometryJacobianInverseTransposed,
class K,
int SIZE >
60 void hessianTransformation (
const GeometryJacobianInverseTransposed &gjit,
61 const ExplicitFieldVector< FieldMatrix< K, GeometryJacobianInverseTransposed::cols, GeometryJacobianInverseTransposed::cols >, SIZE > &a,
62 ExplicitFieldVector< FieldMatrix< K, GeometryJacobianInverseTransposed::rows, GeometryJacobianInverseTransposed::rows >, SIZE > &b )
64 const int dimLocal = GeometryJacobianInverseTransposed::cols;
65 const int dimGlobal = GeometryJacobianInverseTransposed::rows;
67 for(
int r = 0; r < SIZE; ++r )
70 FieldMatrix< K, dimLocal, dimGlobal > c;
71 for(
int i = 0; i < dimLocal; ++i )
72 gjit.mv( a[ r ][ i ], c[ i ] );
75 for(
int i = 0; i < dimGlobal; ++i )
77 FieldMatrixColumn< const FieldMatrix< K, dimLocal, dimGlobal > > ci( c, i );
78 FieldMatrixColumn< FieldMatrix< K, dimGlobal, dimGlobal > > bi( b[ r ], i );
90 template<
class Geometry >
91 struct HessianTransformation
96 HessianTransformation (
const Geometry &geometry,
const LocalCoordinate &x )
97 : gjit_( geometry.jacobianInverseTransposed( x ) )
99 if( !geometry.affine() )
100 DUNE_THROW( NotImplemented,
"HessianTransformation not implemented for non-affine geometries." );
103 template<
class A,
class B >
104 void operator() (
const A &a, B &b )
const
106 hessianTransformation( gjit_, a, b );
110 GeometryJacobianInverseTransposed gjit_;
Implementation::JacobianInverseTransposed JacobianInverseTransposed
type of jacobian inverse transposed
Definition: geometry.hh:120
FieldVector< ctype, mydim > LocalCoordinate
type of local coordinates
Definition: geometry.hh:103
A few common exception classes.
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.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13