2 #ifndef DUNE_FEM_BLOCKVECTORDISCRETEFUNCTION_HH 3 #define DUNE_FEM_BLOCKVECTORDISCRETEFUNCTION_HH 7 #include <dune/common/exceptions.hh> 8 #include <dune/common/fvector.hh> 10 #include <dune/geometry/referenceelements.hh> 30 template<
typename DiscreteFunctionSpace,
typename BlockVector >
52 template<
typename DiscreteFunctionSpace,
typename BlockVector >
66 template<
typename DiscreteFunctionSpace,
typename BlockVector >
92 using BaseType::assign;
101 const DiscreteFunctionSpaceType &dfSpace,
102 DofVectorType &dofVector )
103 : BaseType( name, dfSpace ),
105 dofVector_( dofVector )
114 const DiscreteFunctionSpaceType &dfSpace )
115 : BaseType( name, dfSpace ),
117 dofVector_( allocateDofStorage( dfSpace ) )
124 : BaseType(
"copy of "+other.name(), other.space() ),
126 dofVector_( allocateDofStorage( other.space() ) )
137 ThisType &operator= (
const ThisType &other );
163 memObject_->enableDofCompression();
169 std::string name(
"deprecated");
170 std::pair< DofStorageInterface*, DofVectorType* > memPair(
171 allocateManagedDofStorage< DofVectorType >( space.gridPart().grid(), space.blockMapper(), name ) );
173 memObject_.reset( memPair.first );
174 return *memPair.second;
188 #endif // #ifndef DUNE_FEM_BLOCKVECTORDISCRETEFUNCTION_HH const DofVectorType & dofVector() const
Obtain constant reference to the dof vector.
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:144
Traits class for a DiscreteFunction.
Definition: discretefunction.hh:60
BlockVectorDiscreteFunction(const std::string &name, const DiscreteFunctionSpaceType &dfSpace, DofVectorType &dofVector)
Constructor to use if the vector storing the dofs (which is a block vector) already exists...
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:100
MutableLocalFunction< DiscreteFunctionType > LocalFunctionType
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:57
BlockVectorDiscreteFunction(const std::string &name, const DiscreteFunctionSpaceType &dfSpace)
Constructor to use if the vector storing the dofs does not exist yet.
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:113
DofVectorType & dofVector()
Obtain reference to the dof vector.
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:153
void enableDofCompression()
Enable this discrete function for dof compression, i.e. during grdi changes a dof compression is done...
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:160
DofVectorType & allocateDofStorage(const DiscreteFunctionSpaceType &space)
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:167
BlockVectorDiscreteFunction(const ThisType &other)
Copy constructor.
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:123
Definition: discretefunction.hh:63
BlockVectorDiscreteFunction< DiscreteFunctionSpace, BlockVector > DiscreteFunctionType
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:56
This file implements a dense vector with a dynamic size.
Definition: scalarproducts.hh:483
Definition: coordinate.hh:4
DofVectorType & dofVector_
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:181
Definition: discretefunction.hh:1034
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:31
BlockVectorType DofVectorType
type for the class which implements the block vector (which is the dof vector)
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:89
DiscreteFunctionSpace DiscreteFunctionSpaceType
type for the discrete function space this function lives in
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:85
BlockVector BlockVectorType
type for the class which implements the block vector
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:87
Tag for discrete functions using block vectors.
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:43
std::unique_ptr< DofStorageInterface > memObject_
Definition: blockvectordiscretefunction/blockvectordiscretefunction.hh:180