1#ifndef DUNE_FEM_SUBOBJECTS_HH
2#define DUNE_FEM_SUBOBJECTS_HH
9#include <dune/fem/common/explicitfieldvector.hh>
22 struct RowType< const T>
24 typedef const typename RowType<T> :: Type Type;
28 template<
class K,
int SIZE >
29 struct RowType< FieldVector< K, SIZE > >
32 static const int size = SIZE;
35 template<
class K,
int SIZE >
36 struct RowType< ExplicitFieldVector< K, SIZE > >
39 static const int size = SIZE;
42 template<
class K,
int ROWS,
int COLS >
43 struct RowType< FieldMatrix< K, ROWS, COLS > >
45 typedef FieldVector<K, COLS> Type;
46 static const int size = ROWS;
51 template <
class DomainObject,
class RangeObject,
int offset >
54 typedef DomainObject DomainObjectType;
55 typedef RangeObject RangeObjectType;
57 typedef typename RowType< RangeObject > :: Type RowType;
60 SubObject( DomainObjectType &host )
64 const RowType &operator[] (
const int i )
const
66 assert( (i >=0 ) && (i <
size()) );
67 return host_[ i + offset ];
70 RowType& operator[] (
const int i )
72 assert( (i >=0 ) && (i <
size()) );
73 return host_[ i + offset ];
78 return Dune::Fem::RowType< RangeObject >
:: size;
81 operator typename std::remove_const< RangeObjectType >::type ()
const
83 typename std::remove_const< RangeObjectType >::type y;
84 for(
int i = 0; i <
size(); ++i )
85 y[ i ] = (*
this)[ i ];
90 DomainObjectType &host_;
97 template<
class DomianObj,
class RangeObj,
int offset >
98 struct DenseMatrixAssigner< typename
std::remove_const< RangeObj >::type, Fem::SubObject< DomianObj, RangeObj, offset > >
100 static void apply (
typename std::remove_const< RangeObj >::type &fm,
const Fem::SubObject< DomianObj, RangeObj, offset > &s )
102 for(
int i = 0; i < s.size(); ++i )
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
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75