3 #ifndef DUNE_ALU2DGRID_INTERSECTION_HH
4 #define DUNE_ALU2DGRID_INTERSECTION_HH
21 template<
int cd,
int dim,
class Gr
idImp>
22 class ALU2dGridEntity;
23 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
24 class ALU2dGridLevelIterator;
25 template<
int cd,
class Gr
idImp >
26 class ALU2dGridEntityPointer;
27 template<
int mydim,
int coorddim,
class Gr
idImp>
28 class ALU2dGridGeometry;
29 template<
class Gr
idImp>
30 class ALU2dGridHierarchicIterator;
31 template<
class Gr
idImp>
32 class ALU2dGridIntersectionBase;
33 template<
class Gr
idImp>
34 class ALU2dGridLeafIntersectionIterator;
35 template<
class Gr
idImp>
36 class ALU2dGridLevelIntersectionIterator;
37 template<
int codim, PartitionIteratorType pitype,
class Gr
idImp>
38 class ALU2dGridLeafIterator;
39 template<
int dim,
int dimworld, ALU2DSPACE ElementType eltype >
47 template<
class Gr
idImp,
class LocalGeometryImpl >
53 LocalGeometryImpl geoms_[ 2 ][ 4 ][ 2 ];
55 #ifdef USE_SMP_PARALLEL
63 const LocalGeometryImpl &
localGeom (
const int aluFace,
const int twist,
const int corners )
const
65 assert( corners == 3 || corners == 4 );
66 assert( 0 <= aluFace && aluFace < corners );
67 assert( twist == 0 || twist == 1 );
68 return geoms_[ corners-3 ][ aluFace ][ twist ];
74 #ifdef USE_SMP_PARALLEL
76 static std::vector< ThisType > storage( GridObjectFactoryType :: maxThreads() );
77 return storage[ GridObjectFactoryType :: threadNumber () ];
100 template<
class Gr
idImp>
101 class ALU2dGridIntersectionBase
103 static const int dim = GridImp::dimension;
104 static const int dimworld = GridImp::dimensionworld;
107 typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
108 typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
120 typedef typename GridImp::template Codim<0>::Entity
Entity;
123 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
167 return inside()->neighbour(
index_ )->thinis( ThinelementType::bndel_like );
189 nFaces_ = (inside != 0 ? inside->numfaces() : 0);
224 return reinterpret_cast< const Intersection &
>( *this );
313 template<
class Gr
idImp >
320 static const int dim = GridImp::dimension;
321 static const int dimworld = GridImp::dimensionworld;
333 typedef std::pair< HElementType *, int > IntersectionInfo;
342 typedef typename GridImp::template Codim<0>::Entity
Entity;
344 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
386 void setFirstItem(
const HElementType & elem,
int wLevel);
389 template <
class EntityType>
390 void first(
const EntityType & en,
int wLevel);
392 void addNeighboursToStack();
394 static int getOppositeInFather (
int nrInChild,
int nrOfChild );
395 static int getOppositeInChild (
int nrInFather,
int nrOfChild );
397 void setupIntersection ();
406 mutable std::stack<IntersectionInfo> nbStack_;
418 template<
class Gr
idImp >
419 class ALU2dGridLeafIntersectionIterator
420 :
public ALU2dGridIntersectionBase< GridImp >
422 typedef ALU2dGridLeafIntersectionIterator< GridImp > ThisType;
423 typedef ALU2dGridIntersectionBase< GridImp > BaseType;
428 static const int dim = GridImp::dimension;
429 static const int dimworld = GridImp::dimensionworld;
445 typedef std::pair< HElementType *, int > IntersectionInfo;
448 typedef typename GridImp::template Codim<0>::Entity
Entity;
449 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
489 void setFirstItem(
const HElementType & elem,
int wLevel);
492 template <
class EntityType>
493 void first(
const EntityType & en,
int wLevel);
495 void setupIntersection ();
504 std::stack<IntersectionInfo> nbStack_;
511 #if COMPILE_ALU2DGRID_INLINE
512 #include "intersection.cc"
515 #endif // #ifndef DUNE_ALU2DGRID_INTERSECTION_HH
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: albertagrid/dgfparser.hh:26
Geometry geometry() const
Definition: intersection_imp.cc:291
void increment()
increment iterator
Definition: intersection_imp.cc:374
const LocalGeometryStorageType & localGeomStorage_
Definition: alugrid/2d/intersection.hh:299
#define ALU2DSPACE
Definition: alu2dinclude.hh:34
ALU2dImplTraits< dimworld, eltype >::ThinelementType ThinelementType
Definition: alugrid/2d/intersection.hh:131
HmeshType::hbndel_t HBndElType
Definition: alu2dinclude.hh:109
ALU2dGridIntersectionBase< GridImp > ImplementationType
Definition: alugrid/2d/intersection.hh:113
ALU2dImplTraits< dimworld, eltype >::HBndElType HBndElType
Definition: alugrid/2d/intersection.hh:133
FieldVector< alu2d_ctype, dim-1 > LocalCoordinate
Definition: alugrid/2d/intersection.hh:127
Different resources needed by all grid implementations.
struct Dune::ALU2dGridIntersectionBase::impl current
LocalGeometry geometryInOutside() const
Definition: intersection_imp.cc:268
void assign(const ALU2dGridLevelIntersectionIterator< GridImp > &org)
The copy constructor.
Definition: intersection_imp.cc:366
HElementType * inside() const
Definition: alugrid/2d/intersection.hh:154
ALU2dGridEntityPointer< 0, GridImp > EntityPointer
Definition: alugrid/2d/intersection.hh:350
bool isConform() const
Definition: alugrid/2d/intersection.hh:481
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: intersection_imp.cc:118
ALU2dGridGeometry< dim-1, dimworld, GridImp > GeometryImp
Definition: alugrid/2d/intersection.hh:347
int boundaryId() const
return boundary type
Definition: intersection_imp.cc:110
int walkLevel_
Definition: alugrid/2d/intersection.hh:301
void setInside(HElementType *inside)
Definition: alugrid/2d/intersection.hh:186
const FactoryType & factory_
Definition: alugrid/2d/intersection.hh:298
HmeshType::helement_t HElementType
Definition: alu2dinclude.hh:108
GridImp::template Codim< 0 >::Entity Entity
Definition: alugrid/2d/intersection.hh:342
Provides proxy classes for IntersectionsIterators.
GridImp::template Codim< 0 >::Entity Entity
Definition: alugrid/2d/intersection.hh:448
GeometryImpl intersectionGlobal_
Definition: alugrid/2d/intersection.hh:293
virtual bool conforming() const =0
Definition: objectfactory.hh:23
Definition: alugrid/2d/intersection.hh:145
ALU2dGridGeometry< dim-1, dimworld, GridImp > GeometryImp
Definition: alugrid/2d/intersection.hh:452
void unsetUp2Date()
Definition: intersection_imp.cc:317
void done(const HElementType *inside)
Definition: intersection_imp.cc:147
HElementType & getItem() const
Definition: alugrid/2d/entity.hh:488
Definition: alugrid/2d/entity.hh:30
Wrapper class for pointers to entities.
Definition: common/entitypointer.hh:112
Definition: alugrid/2d/intersection.hh:436
NormalType outerNormal(const LocalCoordinate &local) const
Definition: intersection_imp.cc:203
Definition: alugrid/2d/intersection.hh:340
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: alugrid/2d/intersection.hh:124
void assign(const ThisType &org)
The copy constructor.
Definition: intersection_imp.cc:50
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: alugrid/2d/intersection.hh:121
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:18
int opposite() const
Definition: alugrid/2d/intersection.hh:181
bool conforming() const
leaf is conforming, when conform grid version used
Definition: alugrid/2d/intersection.hh:475
virtual void setFirstItem(const HElementType &elem, int wLevel)=0
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:327
int indexInInside() const
local index of codim 1 entity in self where intersection is contained in
Definition: intersection_imp.cc:165
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:232
ALU2dGridEntity< 0, dim, GridImp > EntityImp
Definition: alugrid/2d/intersection.hh:346
FieldVector< alu2d_ctype, dimworld > NormalType
Definition: alugrid/2d/intersection.hh:349
ALU2dGridGeometry< dim-1, dim, GridImp > LocalGeometryImp
Definition: alugrid/2d/intersection.hh:453
bool isConform() const
Definition: alugrid/2d/intersection.hh:377
LocalGeometryImpl intersectionNeighborLocal_
Definition: alugrid/2d/intersection.hh:295
ALU2dGridEntity< 0, dim, GridImp > EntityImp
Definition: alugrid/2d/intersection.hh:451
FieldVector< alu2d_ctype, dimworld > NormalType
Definition: alugrid/2d/intersection.hh:126
int index_
Definition: alugrid/2d/intersection.hh:206
Definition: alugrid/2d/entity.hh:32
NormalType unitOuterNormal(const LocalCoordinate &local) const
Definition: intersection_imp.cc:235
ALU2dGridIntersectionBase(const FactoryType &factory, int wLevel)
The default Constructor , creating an empty ALU2dGridIntersectionIterator.
Definition: intersection_imp.cc:28
MakeableInterfaceObject< Geometry > GeometryObject
Definition: alugrid/2d/intersection.hh:457
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
int level() const
return level of inside(entity)
Definition: intersection_imp.cc:71
Definition: alugrid/2d/grid.hh:52
organize the memory management for entitys used by the NeighborIterator
Definition: alugrid/2d/grid.hh:68
const Intersection & dereference() const
Definition: alugrid/2d/intersection.hh:222
bool useOutside_
Definition: alugrid/2d/intersection.hh:207
ALU2dGridLeafIntersectionIterator(const FactoryType &factory, int wLevel)
The default Constructor , createing an empty ALU2dGridIntersectionIterator.
Definition: intersection_imp.cc:420
bool equals(const ThisType &i) const
check whether entities are the same or whether iterator is done
Definition: intersection_imp.cc:63
HBndElType * boundary() const
Definition: alugrid/2d/intersection.hh:170
Dune::Intersection< GridImp, Dune::ALU2dGridIntersectionBase< GridImp > > Intersection
type of the intersection
Definition: alugrid/2d/intersection.hh:115
void increment()
increment iterator
Definition: intersection_imp.cc:445
GridImp::template Codim< 1 >::Geometry Geometry
Definition: alugrid/2d/intersection.hh:123
Wrapper class for geometries.
Definition: common/geometry.hh:65
Definition: alugrid/2d/entity.hh:26
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/intersection.hh:111
bool boundary() const
return true if intersection is with boundary
Definition: intersection_imp.cc:104
int indexInOutside() const
local index of codim 1 entity in neighbor where intersection is contained in
Definition: intersection_imp.cc:176
MakeableInterfaceObject< Geometry > GeometryObject
Definition: alugrid/2d/intersection.hh:352
GridImp::template Codim< 0 >::Entity Entity
Definition: alugrid/2d/intersection.hh:120
void checkValid()
return true if intersection is with boundary
Definition: intersection_imp.cc:92
Definition: alugrid/2d/intersection.hh:48
virtual ~ALU2dGridIntersectionBase()
Definition: alugrid/2d/intersection.hh:217
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: alugrid/2d/intersection.hh:345
impl(HElementType *inside=0)
Definition: alugrid/2d/intersection.hh:147
double alu2d_ctype
Definition: alu2dinclude.hh:63
ALU2dGridLevelIntersectionIterator(const FactoryType &factory, int wLevel)
The default Constructor , creating an empty ALU2dGridIntersectionIterator.
Definition: intersection_imp.cc:349
HElementType * outside() const
Definition: alugrid/2d/intersection.hh:176
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/intersection.hh:336
void first(const EntityImp &en, int wLevel)
reset IntersectionIterator to first neighbour
Definition: intersection_imp.cc:81
bool conforming() const
Definition: alugrid/2d/intersection.hh:371
FieldVector< alu2d_ctype, dimworld > NormalType
Definition: alugrid/2d/intersection.hh:454
const GridImp & grid() const
Definition: alugrid/2d/intersection.hh:272
GridImp::GridObjectFactoryType FactoryType
Definition: alugrid/2d/intersection.hh:433
ALU2dGridEntityPointer< 0, GridImp > EntityPointerImp
Definition: alugrid/2d/intersection.hh:129
LocalGeometry geometryInInside() const
Definition: intersection_imp.cc:245
ALU2DIntersectionGeometryStorage< GridImp, LocalGeometryImpl > LocalGeometryStorageType
Definition: alugrid/2d/intersection.hh:136
Definition: alugrid/2d/intersection.hh:117
GridImp::template Codim< 1 >::Geometry Geometry
Definition: alugrid/2d/intersection.hh:449
static const ThisType & instance()
Definition: alugrid/2d/intersection.hh:72
int nFaces() const
Definition: alugrid/2d/intersection.hh:159
int twistInOutside() const
Definition: intersection_imp.cc:192
ElementType
Definition: alu2dinclude.hh:55
ALUMemoryProvider< ThisType > StorageType
Definition: alugrid/2d/intersection.hh:337
ALU2dGridGeometry< dim-1, dim, GridImp > LocalGeometryImp
Definition: alugrid/2d/intersection.hh:348
ALU2dGridEntity< 0, dim, GridImp > EntityImp
Definition: alugrid/2d/intersection.hh:125
LocalGeometryImpl intersectionSelfLocal_
Definition: alugrid/2d/intersection.hh:294
void done(const EntityImp &en)
Definition: alugrid/2d/intersection.hh:281
EntityPointer outside() const
return EntityPointer to the Entity on the outside of this intersection.
Definition: intersection_imp.cc:157
const LocalGeometryImpl & localGeom(const int aluFace, const int twist, const int corners) const
Definition: alugrid/2d/intersection.hh:63
bool neighbor() const
return true if intersection is with neighbor on this level
Definition: intersection_imp.cc:132
void setOutside(HElementType *outside, int opposite)
Definition: alugrid/2d/intersection.hh:192
Definition: alu2dinclude.hh:97
Definition: alugrid/2d/intersection.hh:118
GeometryType type() const
obtain the type of reference element for this intersection
Definition: intersection_imp.cc:309
Definition: alugrid/2d/intersection.hh:437
void assign(const ALU2dGridLeafIntersectionIterator< GridImp > &org)
The copy constructor.
Definition: intersection_imp.cc:437
NormalType integrationOuterNormal(const LocalCoordinate &local) const
Definition: intersection_imp.cc:228
Definition: objectfactory.hh:26
Definition: alugrid/2d/entity.hh:210
bool isBoundary() const
Definition: alugrid/2d/intersection.hh:164
ALU2dGridIntersectionBase< GridImp > ThisType
Definition: alugrid/2d/intersection.hh:138
Definition: alugrid/2d/intersection.hh:339
ALU2dImplTraits< dimworld, eltype >::HElementType HElementType
Definition: alugrid/2d/intersection.hh:132
GridImp::template Codim< 1 >::Geometry Geometry
Definition: alugrid/2d/intersection.hh:344
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: alugrid/2d/intersection.hh:450
ALU2dGridEntityPointer< 0, GridImp > EntityPointer
Definition: alugrid/2d/intersection.hh:455
EntityPointer inside() const
return EntityPointer to the Entity on the inside of this intersection.
Definition: intersection_imp.cc:140
int twistInInside() const
Definition: intersection_imp.cc:186
ALUMemoryProvider< ThisType > StorageType
Definition: alugrid/2d/intersection.hh:434