1#ifndef DUNE_FEM_FUNCTIONSPACE_HH
2#define DUNE_FEM_FUNCTIONSPACE_HH
4#include <dune/common/fmatrix.hh>
5#include <dune/common/fvector.hh>
7#include <dune/geometry/dimension.hh>
19 template<
class DomainField,
class RangeField,
int dimD,
int dimR>
23 template<
class DomainField,
class RangeField,
int dimD,
int dimR>
37 typedef FieldVector< DomainFieldType, dimDomain >
DomainType;
40 typedef FieldVector< RangeFieldType, dimRange>
RangeType;
56 template<
class DomainField,
class RangeField,
int dimD,
int dimR>
59 < VectorSpaceTraits< DomainField, RangeField, dimD, dimR> >
70 template <
typename DomainFieldImp,
typename RangeFieldImp,
int n,
int m1,
int m2>
76 template <
typename K,
int n,
int m>
80 typedef typename BaseType::row_type
RowType;
104 return static_cast<BaseType&
>(*this)[r][c];
112 return static_cast<const BaseType&
>(*this)[r][c];
119 return static_cast<BaseType&
>(*this)[r];
126 return static_cast<BaseType&
>(*this)[r];
155 for (
int i=0; i<n; i++)
156 ret +=
static_cast<BaseType&
>(*
this)[i] * y[i];
167 for (
int i=0; i<n; i++)
175 template <
typename DomainFieldImp,
typename RangeFieldImp,
int n,
int m1,
int m2>
177 public FieldMatrix<RangeFieldImp,m1*m2,n> {
188 typedef FieldMatrix<RangeFieldImp,m1*m2,n>
BaseType;
202 return static_cast<BaseType&
>(*this)[i];
208 const FieldVector<DomainFieldImp,n>&
operator[](
int i)
const {
209 return static_cast<const BaseType&
>(*this)[i];
214 template <
typename DomainFieldImp,
typename RangeFieldImp,
int n,
int m1,
int m2>
237 template <
typename DomainFieldImp,
typename RangeFieldImp,
int n,
int m1,
int m2>
245 template <
class FunctionSpaceImp,
int newDimDomain >
249 template <
class FunctionSpaceImp,
int newDimRange >
253 template<
class DomainFieldImp,
class RangeFieldImp,
int dimDomain,
int dimRange,
int newDimDomain >
260 template<
class DomainFieldImp,
class RangeFieldImp,
int n,
int m1,
int m2,
int newDimDomain >
267 template<
class DomainFieldImp,
class RangeFieldImp,
int dimDomain,
int dimRange,
int newDimRange >
281 template<
class Gr
idPart,
class >
284 template<
class Gr
idPart,
class K,
int dimRange >
290 template<
class Gr
idPart,
class K,
int rows,
int cols >
291 struct GridFunctionSpace< GridPart, MatrixFunctionSpace< typename GridPart::ctype, K, GridPart::dimensionworld, rows, cols > >
293 typedef MatrixFunctionSpace< typename GridPart::ctype, K, GridPart::dimensionworld, rows, cols > Type;
296 template<
class Gr
idPart,
class K,
int dimRange >
297 struct GridFunctionSpace< GridPart,
Dune::FieldVector< K, dimRange > >
299 typedef FunctionSpace< typename GridPart::ctype, K, GridPart::dimensionworld, dimRange > Type;
302 template<
class Gr
idPart,
class K,
int rows,
int cols >
305 typedef MatrixFunctionSpace< typename GridPart::ctype, K, GridPart::dimensionworld, rows, cols > Type;
308 template<
class Gr
idPart,
int dimRange >
311 typedef typename GridFunctionSpace< GridPart, Dune::FieldVector< typename GridPart::ctype, dimRange > >::Type Type;
316 template<
class Gr
idPart,
class T >
Definition: bindguard.hh:11
typename Impl::GridFunctionSpace< GridPart, T >::Type GridFunctionSpace
Definition: functionspace.hh:317
A vector valued function space.
Definition: functionspace.hh:60
ThisType FunctionSpaceType
Definition: functionspace.hh:64
Traits class for vector function spaces.
Definition: functionspace.hh:25
@ dimDomain
Definition: functionspace.hh:32
FunctionSpace< DomainFieldType, RangeFieldType, dimDomain, 1 > ScalarFunctionSpaceType
scalar function space type
Definition: functionspace.hh:47
FieldVector< RangeFieldType, dimRange > RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspace.hh:40
RangeField RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspace.hh:29
FieldMatrix< RangeFieldType, dimRange, dimDomain > LinearMappingType
linear mapping type
Definition: functionspace.hh:43
@ dimRange
Definition: functionspace.hh:34
FieldVector< DomainFieldType, dimDomain > DomainType
Type of domain vector (using type of domain field) has a Dune::FieldVector type interface.
Definition: functionspace.hh:37
DomainField DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspace.hh:27
A matrix valued function space.
Definition: functionspace.hh:239
RangeType class for matrix valued functions - derived from FieldMatrix but has representation as vect...
Definition: functionspace.hh:77
RangeMatrix & axpy(const K &a, const BaseType &y)
vector space axpy operation
Definition: functionspace.hh:165
FieldMatrix< K, n, m > BaseType
Definition: functionspace.hh:79
const K operator[](int i) const
access i element where row = i/col and column = icol
Definition: functionspace.hh:142
RangeMatrix(const K &k)
Constructor initializing the whole matrix with a scalar.
Definition: functionspace.hh:96
K operator*(const BaseType &y)
scalar product
Definition: functionspace.hh:152
K & operator()(int r, int c)
access element in row r and column c
Definition: functionspace.hh:103
@ dimension
The total dimension of the matrix space.
Definition: functionspace.hh:87
@ cols
The number of columns.
Definition: functionspace.hh:85
@ rows
The number of rows.
Definition: functionspace.hh:83
RangeMatrix()
Default constructor.
Definition: functionspace.hh:92
RowType & row(int r)
access to row r
Definition: functionspace.hh:125
const RowType & row(int r) const
access to row r
Definition: functionspace.hh:118
BaseType::row_type RowType
Definition: functionspace.hh:80
const K operator()(int r, int c) const
access element in row r and column c
Definition: functionspace.hh:111
K & operator[](int i)
access i element where row = i/col and column = icol
Definition: functionspace.hh:133
JacobianRangeType class for matrix valued functions - derived from FieldMatrix.
Definition: functionspace.hh:177
FieldVector< DomainFieldImp, n > & operator[](int i)
returning reference to row
Definition: functionspace.hh:201
MatrixMapping(const RangeFieldImp &k)
Constructor initializing the whole matrix with a scalar.
Definition: functionspace.hh:195
MatrixMapping()
Default constructor.
Definition: functionspace.hh:192
RangeFieldImp RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspace.hh:184
FieldMatrix< RangeFieldImp, m1 *m2, n > BaseType
type of base class
Definition: functionspace.hh:188
RangeMatrix< RangeFieldImp, m1, m2 > RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspace.hh:186
const FieldVector< DomainFieldImp, n > & operator[](int i) const
returning reference to row
Definition: functionspace.hh:208
DomainFieldImp DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspace.hh:182
Traits class for matrix valued spaces.
Definition: functionspace.hh:215
MatrixFunctionSpace< DomainFieldImp, RangeFieldImp, n, 1, 1 > ScalarFunctionSpaceType
scalar function space type
Definition: functionspace.hh:227
DomainFieldImp DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspace.hh:217
RangeMatrix< RangeFieldImp, m1, m2 > RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspace.hh:223
@ dimRange
Definition: functionspace.hh:229
FieldVector< DomainFieldImp, n > DomainType
Type of domain vector (using type of domain field) has a Dune::FieldVector type interface.
Definition: functionspace.hh:221
@ dimDomain
Definition: functionspace.hh:231
MatrixMapping< DomainFieldImp, RangeFieldImp, n, m1, m2 > LinearMappingType
linear mapping type
Definition: functionspace.hh:225
RangeFieldImp RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspace.hh:219
convert functions space to space with new dim domain
Definition: functionspace.hh:246
convert functions space to space with new dim range
Definition: functionspace.hh:250
FunctionSpace< DomainFieldImp, RangeFieldImp, newDimDomain, dimRange > Type
Definition: functionspace.hh:256
MatrixFunctionSpace< DomainFieldImp, RangeFieldImp, newDimDomain, m1, m2 > Type
Definition: functionspace.hh:263
FunctionSpace< DomainFieldImp, RangeFieldImp, dimDomain, newDimRange > Type
Definition: functionspace.hh:270
interface for an arbitrary function space
Definition: functionspaceinterface.hh:40