1 #ifndef DUNE_FEM_LOCALMATRIXWRAPPER_HH 2 #define DUNE_FEM_LOCALMATRIXWRAPPER_HH 15 template<
class LocalMatrixStack >
23 template<
class LocalMatrixStack >
45 template<
class LocalMatrixStack >
74 typedef typename LocalMatrixStackType::PointerType WrappedLocalMatrixPtrType;
79 WrappedLocalMatrixPtrType localMatrixPtr_;
82 WrappedLocalMatrixType &localMatrix_;
87 : localMatrixPtr_( stack.getObject() ),
88 localMatrix_( *localMatrixPtr_ )
92 template<
class DomainEntityType,
class RangeEntityType >
94 const DomainEntityType &domainEntity,
95 const RangeEntityType &rangeEntity )
96 : localMatrixPtr_( stack.getObject() ),
97 localMatrix_( *localMatrixPtr_ )
100 localMatrix().init( domainEntity, rangeEntity );
108 : localMatrixPtr_( other.localMatrixPtr_ ),
109 localMatrix_( *localMatrixPtr_ )
117 localMatrix().finalize();
122 ThisType &operator= (
const ThisType & );
126 void init (
const DomainEntityType &domainEntity,
const RangeEntityType &rangeEntity )
128 localMatrix().init( domainEntity, rangeEntity );
132 void add (
int localRow,
int localCol,
const RangeFieldType &value )
134 localMatrix().add( localRow, localCol, value );
138 void set (
int localRow,
int localCol,
const RangeFieldType &value )
140 localMatrix().set( localRow, localCol, value );
146 localMatrix().clearRow( localRow );
152 localMatrix().clearCol( localCol );
156 const RangeFieldType
get (
const int localRow,
157 const int localCol )
const 159 return localMatrix().get( localRow, localCol );
163 void scale (
const RangeFieldType& scalar )
165 return localMatrix().scale( scalar );
171 return localMatrix().clear();
177 return localMatrix().resort();
183 return localMatrix().rows();
189 return localMatrix().columns();
193 template <
class DomainLocalFunctionImp,
194 class RangeLocalFunctionImp>
196 RangeLocalFunctionImp& rLf)
198 localMatrix().multiplyAdd( dLf, rLf);
204 return localMatrix().domainSpace();
210 return localMatrix().rangeSpace();
213 const DomainEntityType &
domainEntity ()
const {
return localMatrix().domainEntity(); }
214 const RangeEntityType &
rangeEntity ()
const {
return localMatrix().rangeEntity(); }
219 return localMatrix().domainBasisFunctionSet();
225 return localMatrix().rangeBasisFunctionSet();
229 const WrappedLocalMatrixType &
localMatrix ()
const {
return localMatrix_; }
237 #endif // #ifndef DUNE_FEM_LOCALMATRIXWRAPPER_HH Traits::DomainSpaceType DomainSpaceType
type of domain discrete function space
Definition: localmatrix.hh:51
WrappedLocalMatrixType::DomainSpaceType DomainSpaceType
Definition: localmatrixwrapper.hh:34
BaseType::DomainSpaceType DomainSpaceType
Definition: localmatrixwrapper.hh:64
Definition: localmatrixwrapper.hh:16
WrappedLocalMatrixType::RangeFieldType RangeFieldType
Definition: localmatrixwrapper.hh:32
RangeSpaceType::EntityType RangeEntityType
Definition: localmatrix.hh:65
LocalMatrixWrapper(LocalMatrixStackType &stack)
constructor creating an uninitialized local matrix
Definition: localmatrixwrapper.hh:86
LocalMatrixStack LocalMatrixStackType
Definition: localmatrixwrapper.hh:26
void scale(const RangeFieldType &scalar)
scale matrix with scalar value
Definition: localmatrixwrapper.hh:163
int columns() const
get number of columns within the matrix
Definition: localmatrixwrapper.hh:187
LocalMatrixWrapper(LocalMatrixStackType &stack, const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity)
constructor initializing the wrapped local matrix
Definition: localmatrixwrapper.hh:93
const DomainEntityType & domainEntity() const
Definition: localmatrixwrapper.hh:213
Traits::WrappedLocalMatrixType WrappedLocalMatrixType
type of the wrapped local matrix
Definition: localmatrixwrapper.hh:60
void clear()
set all entries of local matrix to zero
Definition: localmatrixwrapper.hh:169
BaseType::DomainBasisFunctionSetType DomainBasisFunctionSetType
Definition: localmatrixwrapper.hh:67
void multiplyAdd(const DomainLocalFunctionImp &dLf, RangeLocalFunctionImp &rLf)
multiply left hand side with local matrix and add to right hand side rhs += Matrix * lhs ...
Definition: localmatrixwrapper.hh:195
BaseType::RangeBasisFunctionSetType RangeBasisFunctionSetType
Definition: localmatrixwrapper.hh:68
DomainSpaceType::BasisFunctionSetType DomainBasisFunctionSetType
type of base function sets within domain function space
Definition: localmatrix.hh:58
~LocalMatrixWrapper()
destructor
Definition: localmatrixwrapper.hh:113
WrappedLocalMatrixType & localMatrix()
Definition: localmatrixwrapper.hh:230
void init(const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity)
initialize the local matrix to entities
Definition: localmatrixwrapper.hh:126
Interface for local matrix classes.
Definition: localmatrix.hh:28
BaseType::DomainEntityType DomainEntityType
Definition: localmatrixwrapper.hh:70
void resort()
resort ordering in global matrix (if possible)
Definition: localmatrixwrapper.hh:175
LocalMatrixWrapper(const ThisType &other)
copy constructor
Definition: localmatrixwrapper.hh:107
const RangeEntityType & rangeEntity() const
Definition: localmatrixwrapper.hh:214
RangeSpaceType::BasisFunctionSetType RangeBasisFunctionSetType
type of base function sets within range function space
Definition: localmatrix.hh:62
void add(int localRow, int localCol, const RangeFieldType &value)
add value to matrix entry (row,col) where row and col are local row and local column ...
Definition: localmatrixwrapper.hh:132
LocalMatrixStack::ObjectType WrappedLocalMatrixType
Definition: localmatrixwrapper.hh:28
Definition: coordinate.hh:4
WrappedLocalMatrixType::RangeSpaceType RangeSpaceType
Definition: localmatrixwrapper.hh:35
LocalMatrixWrapper< LocalMatrixStackType > LocalMatrixType
Definition: localmatrixwrapper.hh:30
LocalMatrixWrapperTraits< LocalMatrixStackType > Traits
type of the traits
Definition: localmatrixwrapper.hh:57
const WrappedLocalMatrixType & localMatrix() const
Definition: localmatrixwrapper.hh:229
const RangeSpaceType & rangeSpace() const
access to the range space
Definition: localmatrixwrapper.hh:208
Traits::RangeSpaceType RangeSpaceType
type of range discrete function space
Definition: localmatrix.hh:54
const DomainBasisFunctionSetType & domainBasisFunctionSet() const
access to the base function set within the domain space
Definition: localmatrixwrapper.hh:217
BaseType::RangeSpaceType RangeSpaceType
Definition: localmatrixwrapper.hh:65
WrappedLocalMatrixType::LittleBlockType LittleBlockType
Definition: localmatrixwrapper.hh:37
void clearRow(const int localRow)
set row to zero values
Definition: localmatrixwrapper.hh:144
int rows() const
get number of rows within the matrix
Definition: localmatrixwrapper.hh:181
const RangeBasisFunctionSetType & rangeBasisFunctionSet() const
access to the base function set within the range space
Definition: localmatrixwrapper.hh:223
Traits::RangeFieldType RangeFieldType
Definition: localmatrixwrapper.hh:62
Definition: localmatrixwrapper.hh:24
const DomainSpaceType & domainSpace() const
access to the domain space
Definition: localmatrixwrapper.hh:202
LocalMatrixStack LocalMatrixStackType
type of the local matrix stack
Definition: localmatrixwrapper.hh:54
void clearCol(const int localCol)
set row to zero values
Definition: localmatrixwrapper.hh:150
DomainSpaceType::EntityType DomainEntityType
Definition: localmatrix.hh:64
BaseType::RangeEntityType RangeEntityType
Definition: localmatrixwrapper.hh:71