1 #ifndef DUNE_FEM_BLOCKVECTORFUNCTION_HH 2 #define DUNE_FEM_BLOCKVECTORFUNCTION_HH 9 #include <dune/common/exceptions.hh> 43 template <
class DiscreteFunctionSpace,
class Block >
57 using BaseType::assign;
60 const DiscreteFunctionSpaceType &space )
61 : BaseType( name, space ),
63 dofVector_( allocateDofStorage( space ) )
68 const DiscreteFunctionSpaceType &space,
69 const DofContainerType& dofContainer )
70 : BaseType( name, space ),
72 dofVector_( const_cast< DofContainerType& > (dofContainer) )
77 : BaseType(
"copy of " + other.name(), other.space() ),
79 dofVector_( allocateDofStorage( other.space() ) )
87 memObject_->enableDofCompression();
91 DofContainerType&
blockVector() {
return dofVector().array(); }
93 const DofContainerType&
blockVector()
const {
return dofVector().array(); }
96 const DofVectorType&
dofVector()
const {
return dofVector_; }
102 std::string name(
"deprecated");
104 std::pair< DofStorageInterface*, DofContainerType* > memPair
106 name, (DofContainerType *) 0 );
109 memObject_.reset( memPair.first );
110 return *(memPair.second);
124 #endif // #ifndef DUNE_FEM_BLOCKVECTORFUNCTION_HH
Traits class for a DiscreteFunction.
Definition: discretefunction.hh:60
const DofVectorType & dofVector() const
Definition: blockvectorfunction/blockvectorfunction.hh:96
static std::pair< DofStorageInterface *, DofStorageType * > allocateManagedDofStorage(const GridType &grid, const MapperType &mapper, const std::string &name, const DofStorageType *=0)
default implementation for creating a managed dof storage
Definition: dofmanager.hh:610
Definition: discretefunction.hh:63
std::unique_ptr< DofStorageInterface > memObject_
Definition: blockvectorfunction/blockvectorfunction.hh:114
This file implements a dense vector with a dynamic size.
DofContainerType & blockVector()
convenience method for usage with ISTL solvers
Definition: blockvectorfunction/blockvectorfunction.hh:91
DofVectorType::DofContainerType DofContainerType
Definition: blockvectorfunction/blockvectorfunction.hh:54
DofVectorType & dofVector()
Definition: blockvectorfunction/blockvectorfunction.hh:95
ISTLBlockVectorDiscreteFunction(const std::string &name, const DiscreteFunctionSpaceType &space)
Definition: blockvectorfunction/blockvectorfunction.hh:59
Definition: coordinate.hh:4
DofContainerType & allocateDofStorage(const DiscreteFunctionSpaceType &space)
Definition: blockvectorfunction/blockvectorfunction.hh:100
ISTLBlockVectorDiscreteFunction(const ISTLBlockVectorDiscreteFunction &other)
Definition: blockvectorfunction/blockvectorfunction.hh:76
ISTLBlockVectorDiscreteFunction< DiscreteFunctionSpace, Block > DiscreteFunctionType
Definition: blockvectorfunction/blockvectorfunction.hh:38
BaseType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of discrete function space
Definition: discretefunction.hh:571
DofContainerType DofStorageType
Definition: blockvectorfunction/blockvectorfunction.hh:55
Definition: discretefunction.hh:1034
void enableDofCompression()
Definition: blockvectorfunction/blockvectorfunction.hh:84
Traits::DofVectorType DofVectorType
type of DofVector
Definition: discretefunction.hh:596
BaseType::DofType DofType
Definition: discretefunction.hh:613
MutableLocalFunction< DiscreteFunctionType > LocalFunctionType
Definition: blockvectorfunction/blockvectorfunction.hh:39
Definition: blockvectorfunction/blockvectorfunction.hh:44
ISTLBlockVectorDiscreteFunction(const std::string &name, const DiscreteFunctionSpaceType &space, const DofContainerType &dofContainer)
Definition: blockvectorfunction/blockvectorfunction.hh:67
const DofContainerType & blockVector() const
convenience method for usage with ISTL solvers
Definition: blockvectorfunction/blockvectorfunction.hh:93
DofVectorType dofVector_
Definition: blockvectorfunction/blockvectorfunction.hh:117
BaseType::DofVectorType DofVectorType
Definition: blockvectorfunction/blockvectorfunction.hh:52
BaseType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: blockvectorfunction/blockvectorfunction.hh:51
BaseType::DofType DofType
Definition: blockvectorfunction/blockvectorfunction.hh:53