1 #ifndef DUNE_FEM_SPACE_PADAPTIVE_GENERIC_HH 2 #define DUNE_FEM_SPACE_PADAPTIVE_GENERIC_HH 8 #include <dune/common/math.hh> 36 template<
class Traits >
91 virtual bool equals(
void * )
const = 0 ;
92 virtual void adaptFunction( IntermediateStorageFunctionType &tmp ) = 0;
98 template <
class DF,
class LocalInterpolation >
99 class PAdaptiveDiscreteFunctionEntry;
111 static const IdentifierType
id = 665;
123 const InterfaceType commInterface,
124 const CommunicationDirection commDirection )
125 : BaseType( gridPart, commInterface, commDirection ),
163 inline bool continuous ()
const {
return Traits::continuousSpace; }
223 template<
class EntityType >
255 template<
class Vector >
256 void adapt (
const Vector &polynomialOrders,
const int polOrderShift = 0 )
const 258 typedef typename IteratorType::Entity
EntityType ;
259 const IteratorType endit = this->
end();
262 DiscreteFunctionSpaceType oldSpace(
asImp() );
267 for( IteratorType it = this->
begin(); it != endit; ++it )
269 const EntityType &entity = *it;
270 const int polOrder = polynomialOrders[ this->
indexSet().index( entity ) ] + polOrderShift ;
282 IntermediateStorageFunctionType tmp(
"padapt-temp", oldSpace );
285 const DFListIteratorType endDF =
dfList_.end();
286 for( DFListIteratorType it =
dfList_.begin(); it != endDF; ++it )
288 (*it)->adaptFunction( tmp );
304 BlockMapperType *
initialize (
const BlockMapperType *otherMapper = 0 )
309 const std::vector< GeometryType > &geometryTypes
312 for(
unsigned int i = 0; i < geometryTypes.size(); ++i )
314 ForLoop< Initialize, 1, polynomialOrder >::
331 template<
class DiscreteFunction >
334 assert( &df.space() == this );
335 const DFListIteratorType endDF =
dfList_.end();
336 for( DFListIteratorType it =
dfList_.begin(); it != endDF; ++it )
338 if( (*it)->equals( (
void *) &df ) )
345 template<
class DiscreteFunction >
365 mutable PAdaptiveDiscreteFunctionListType
dfList_;
373 template<
class Traits >
389 static void apply ( std::vector< ScalarShapeFunctionSetStorageType > &scalarShapeFunctionSets,
390 std::vector< LocalKeyStorageType > &compiledLocalKeys,
391 const GeometryType &
type )
395 scalarShapeFunctionSets[ pOrd ].template insert< SingletonProviderType >(
type );
398 compiledLocalKeys[ pOrd ].template insert< CompiledLocalKeySingletonProviderType >(
type );
407 template<
class Traits >
408 template <
class DF,
class LocalInterpolation >
421 virtual bool equals (
void *ptr )
const {
return (((
void *) &df_) == ptr ); }
432 typedef typename DF::DofIteratorType DFIteratorType;
435 DFIteratorType dfit = df_.dbegin();
436 const TmpIteratorType endtmp = tmp.
dend();
437 for( TmpIteratorType it = tmp.
dbegin(); it != endtmp; ++it, ++dfit )
439 assert( dfit != df_.dend() );
442 assert( dfit == df_.dend() );
452 LocalInterpolation::apply( tmp, df_ );
460 #endif // #ifndef DUNE_FEM_SPACE_PADAPTIVE_GENERIC_HH const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition: discretefunctionspace.hh:720
BaseType::IteratorType IteratorType
Definition: padaptivespace/generic.hh:52
Definition: selectcaching.hh:28
PAdaptiveDiscreteFunctionListType::iterator DFListIteratorType
Definition: padaptivespace/generic.hh:102
BaseType::GridType GridType
Definition: discretefunctionspace.hh:610
BlockMapperType * blockMapper_
Definition: padaptivespace/generic.hh:363
BaseType::GridPartType GridPartType
Definition: padaptivespace/generic.hh:49
void removeFunction(const DiscreteFunction &df) const
Definition: padaptivespace/generic.hh:346
Definition: padaptivespace/lagrange.hh:43
BlockMapperType * initialize(const BlockMapperType *otherMapper=0)
Definition: padaptivespace/generic.hh:304
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: padaptivespace/generic.hh:178
const CommunicationDirection commDirection_
Definition: discretefunctionspace.hh:651
BaseType::EntityType EntityType
Definition: discretefunctionspace.hh:613
BaseType::FunctionSpaceType FunctionSpaceType
Definition: padaptivespace/generic.hh:47
BaseType::BlockMapperType BlockMapperType
Definition: padaptivespace/generic.hh:59
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: padaptivespace/generic.hh:157
Traits::template ScalarShapeFunctionSetFactory< pOrd >::Type Type
Definition: padaptivespace/generic.hh:72
GenericDiscreteFunctionSpace(GridPartType &gridPart, const InterfaceType commInterface, const CommunicationDirection commDirection)
constructor
Definition: padaptivespace/generic.hh:122
A vector valued function space.
Definition: functionspace.hh:16
Definition: padaptivespace/generic.hh:70
BaseType::IndexSetType IndexSetType
Definition: padaptivespace/generic.hh:51
AdaptiveDiscreteFunction< DiscreteFunctionSpaceType > IntermediateStorageFunctionType
Definition: padaptivespace/generic.hh:82
PAdaptiveDiscreteFunctionEntryInterface()
Definition: padaptivespace/generic.hh:95
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: padaptivespace/generic.hh:154
virtual ~PAdaptiveDiscreteFunctionEntryInterface()
Definition: padaptivespace/generic.hh:90
ShapeFunctionSetType shapeFunctionSet(const EntityType &entity) const
return shape function set for given entity
Definition: padaptivespace/generic.hh:196
ConstDofIteratorType dbegin() const
Obtain the constant iterator pointing to the first dof.
Definition: discretefunction.hh:746
Singleton list for key/object pairs.
Definition: singletonlist.hh:49
Definition: shapefunctionset/vectorial.hh:428
BaseType::IndexSetType IndexSetType
Definition: discretefunctionspace.hh:611
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:88
BaseType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: padaptivespace/generic.hh:45
BaseType::GridType GridType
Definition: padaptivespace/generic.hh:50
Definition: adaptivefunction/adaptivefunction.hh:34
void compress()
Compress all data that is hold by this dofmanager.
Definition: dofmanager.hh:1106
Please doc me.
Definition: padaptivespace/generic.hh:37
Definition: datacollector.hh:45
Traits::DofIteratorType DofIteratorType
type of the dof iterator
Definition: discretefunction.hh:591
Traits::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discretefunctionspace.hh:179
DFListIteratorType searchFunction(const DiscreteFunction &df) const
Definition: padaptivespace/generic.hh:332
DofManager< GridType > DofManagerType
Definition: padaptivespace/generic.hh:105
static void apply(std::vector< ScalarShapeFunctionSetStorageType > &scalarShapeFunctionSets, std::vector< LocalKeyStorageType > &compiledLocalKeys, const GeometryType &type)
Definition: padaptivespace/generic.hh:389
IteratorType::Entity EntityType
Definition: padaptivespace/generic.hh:53
Traits::BlockMapperType BlockMapperType
type of block mapper of this space
Definition: discretefunctionspace.hh:181
ShapeFunctionSetType shapeFunctionSet(const GeometryType &type, const int order=polynomialOrder) const
return shape unique function set for geometry type
Definition: padaptivespace/generic.hh:209
BaseSetLocalKeyStorage< CompiledLocalKeyType > LocalKeyStorageType
Definition: padaptivespace/generic.hh:78
bool multipleBaseFunctionSets() const
this space has more than one base function set
Definition: padaptivespace/generic.hh:175
GridPartType & gridPart_
Definition: discretefunctionspace.hh:631
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: padaptivespace/generic.hh:163
const DiscreteFunctionSpaceType & asImp() const
Definition: discretefunctionspace.hh:546
BaseSetLocalKeyStorage< ScalarShapeFunctionSetType > ScalarShapeFunctionSetStorageType
Definition: padaptivespace/generic.hh:67
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition: discretefunctionspace.hh:736
const CompiledLocalKeyType & compiledLocalKey(const GeometryType type, const int order=polynomialOrder) const
provide access to the compiled local keys for a geometry type and polynomial order ...
Definition: padaptivespace/generic.hh:239
Definition: padaptivespace/generic.hh:99
Traits::ScalarShapeFunctionSetType ScalarShapeFunctionSetType
Definition: padaptivespace/generic.hh:65
BaseType::IntersectionType IntersectionType
Definition: padaptivespace/generic.hh:54
Definition: coordinate.hh:4
static CompiledLocalKeyType * createObject(const GeometryType &type)
Definition: padaptivespace/generic.hh:379
BaseType::IteratorType IteratorType
Definition: discretefunctionspace.hh:612
PAdaptiveDiscreteFunctionListType dfList_
Definition: padaptivespace/generic.hh:365
Definition: padaptivespace/generic.hh:377
int IdentifierType
type of identifier for this discrete function space
Definition: padaptivespace/generic.hh:109
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition: discretefunctionspace.hh:746
void resize()
Resize index sets and memory due to what the mapper has as new size.
Definition: dofmanager.hh:1053
PAdaptiveDiscreteFunctionEntry(DF &df)
Definition: padaptivespace/generic.hh:416
BaseType::GridPartType GridPartType
Definition: discretefunctionspace.hh:609
interface for list of p-adaptive functions
Definition: padaptivespace/generic.hh:88
ThisType GenericDiscreteFunctionSpaceType
Definition: padaptivespace/generic.hh:44
GenericDiscreteFunctionSpace(const GenericDiscreteFunctionSpace &other)
Definition: padaptivespace/generic.hh:133
void adapt(const Vector &polynomialOrders, const int polOrderShift=0) const
p adaptation
Definition: padaptivespace/generic.hh:256
Provides a proxy class for pointers to a shape function set.
Traits::CompiledLocalKeyType CompiledLocalKeyType
Definition: padaptivespace/generic.hh:77
default implementation uses method geomTypes of given index set. Used in DiscreteFunctionSpaces.
Definition: allgeomtypes.hh:89
const InterfaceType commInterface_
Definition: discretefunctionspace.hh:650
const CompiledLocalKeyType & compiledLocalKey(const EntityType &entity) const
provide access to the compiled local keys for an entity
Definition: padaptivespace/generic.hh:224
std::list< PAdaptiveDiscreteFunctionEntryInterface * > PAdaptiveDiscreteFunctionListType
Definition: padaptivespace/generic.hh:99
int order(const typename BaseType::EntityType &entity) const
get global order of space
Definition: padaptivespace/generic.hh:169
~GenericDiscreteFunctionSpace()
Definition: padaptivespace/generic.hh:142
This is the class with default implementations for discrete function. The methods not marked with hav...
Definition: discretefunctionspace.hh:595
virtual void adaptFunction(IntermediateStorageFunctionType &tmp)
Definition: padaptivespace/generic.hh:423
GridPartType::IntersectionType IntersectionType
type of the intersections
Definition: discretefunctionspace.hh:202
std::vector< LocalKeyStorageType > compiledLocalKeys_
Definition: padaptivespace/generic.hh:360
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:714
const std::vector< GeometryType > & geomTypes(unsigned int codim) const
returns vector with geometry tpyes this index set has indices for
Definition: allgeomtypes.hh:145
static const int polynomialOrder
Definition: padaptivespace/generic.hh:61
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: discretefunctionspace.hh:607
int order() const
get global order of space
Definition: padaptivespace/generic.hh:166
static void deleteObject(CompiledLocalKeyType *obj)
Definition: padaptivespace/generic.hh:383
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition: discretefunctionspace.hh:702
ConstDofIteratorType dend() const
Obtain the constant iterator pointing to the last dof.
Definition: discretefunction.hh:758
Definition: lagrangepoints.hh:461
std::vector< ScalarShapeFunctionSetStorageType > scalarShapeFunctionSets_
Definition: padaptivespace/generic.hh:358
static ThisType & instance(const GridType &grid)
obtain a reference to the DofManager for a given grid
Definition: dofmanager.hh:1319
virtual bool equals(void *ptr) const
Definition: padaptivespace/generic.hh:421
id for Generic Space
Definition: discretefunctionspace.hh:94
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: padaptivespace/generic.hh:57
Traits::ShapeFunctionSetType ShapeFunctionSetType
Definition: padaptivespace/generic.hh:56