5#ifndef DUNE_ALBERTA_LEVEL_HH
6#define DUNE_ALBERTA_LEVEL_HH
28 typedef unsigned char Level;
35 static const Level isNewFlag = (1 << 7);
36 static const Level levelMask = (1 << 7) - 1;
41 template< Level flags >
53 const Level *array = (Level *)level_;
54 return array[ dofAccess_( element, 0 ) ] & levelMask;
59 return (*
this)( elementInfo.
el() );
64 const Level *array = (Level *)level_;
65 return ((array[ dofAccess_( element, 0 ) ] & isNewFlag) != 0);
70 return isNew( elementInfo.
el() );
76 level_.
forEach( calcFromCache );
92 ClearFlags< isNewFlag > clearIsNew;
101 level_.
create( dofSpace,
"Element level" );
103 level_.template setupInterpolation< Interpolation >();
116 DofVectorPointer level_;
117 DofAccess dofAccess_;
134 dofAccess_( level.dofSpace() )
139 Level *
const array = (Level *)level_;
140 array[ dofAccess_( elementInfo, 0 ) ] = elementInfo.
level();
161 maxLevel_ =
std::max( maxLevel_, Level( dof & levelMask ) );
166 maxLevel_ =
std::max( maxLevel_, Level( elementInfo.
level() ) );
181 template< typename AlbertaGridLevelProvider< dim >::Level flags >
198 static const int dimension = dim;
206 Level *array = (Level *)dofVector;
208 for(
int i = 0; i < patch.
count(); ++i )
211 assert( (array[ dofAccess( father, 0 ) ] & levelMask) < levelMask );
212 const Level childLevel = (array[ dofAccess( father, 0 ) ] + 1) | isNewFlag;
213 for(
int i = 0; i < 2; ++i )
216 array[ dofAccess( child, 0 ) ] = childLevel;
provides a wrapper for ALBERTA's mesh structure
Include standard header files.
Definition: agrid.hh:60
ALBERTA EL Element
Definition: misc.hh:54
ALBERTA FE_SPACE DofSpace
Definition: misc.hh:65
int max(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:337
Definition: meshpointer.hh:40
void leafTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
Definition: meshpointer.hh:385
void hierarchicTraverse(Functor &functor, typename FillFlags::Flags fillFlags=FillFlags::standard) const
Definition: meshpointer.hh:370
Definition: dofadmin.hh:93
const DofSpace * dofSpace(int codim) const
Definition: dofadmin.hh:145
void create(const DofSpace *dofSpace, const std::string &name="")
Definition: dofvector.hh:236
void release()
Definition: dofvector.hh:254
const DofSpace * dofSpace() const
Definition: dofvector.hh:223
void forEach(Functor &functor) const
Definition: dofvector.hh:264
Definition: elementinfo.hh:43
int level() const
Definition: elementinfo.hh:533
Element * el() const
Definition: elementinfo.hh:737
bool isNew(const Alberta::Element *element) const
Definition: level.hh:62
bool isNew(const ElementInfo &elementInfo) const
Definition: level.hh:68
Alberta::MeshPointer< dim > MeshPointer
Definition: level.hh:48
MeshPointer mesh() const
Definition: level.hh:85
void create(const DofNumbering &dofNumbering)
Definition: level.hh:96
Level maxLevel() const
Definition: level.hh:73
Alberta::HierarchyDofNumbering< dim > DofNumbering
Definition: level.hh:49
void release()
Definition: level.hh:109
Level operator()(const Alberta::Element *element) const
Definition: level.hh:51
void markAllOld()
Definition: level.hh:90
Alberta::ElementInfo< dim > ElementInfo
Definition: level.hh:47
SetLocal(const DofVectorPointer &level)
Definition: level.hh:132
CalcMaxLevel()
Definition: level.hh:155
Level maxLevel() const
Definition: level.hh:169
Alberta::Patch< dimension > Patch
Definition: level.hh:200
static void interpolateVector(const DofVectorPointer &dofVector, const Patch &patch)
Definition: level.hh:202
static const Flags nothing
Definition: misc.hh:234
Definition: refinement.hh:40
int count() const
Definition: refinement.hh:67