4#ifndef DUNE_FOAMGRID_EDGE_HH
5#define DUNE_FOAMGRID_EDGE_HH
7#include <dune/geometry/type.hh>
8#include <dune/grid/common/gridenums.hh>
15 template <
int dimworld,
class ctype>
25 int level,
unsigned int id)
30 sons_[0] =sons_[1] =
nullptr;
36 int level,
unsigned int id,
42 sons_[0] =sons_[1] =
nullptr;
47 return sons_[0]==
nullptr;
52 return boundarySegmentIndex_;
60 GeometryType
type()
const {
61 return GeometryTypes::line;
66 return father_!=
nullptr;
74 FieldVector<ctype, dimworld>
corner(
int i)
const {
75 return vertex_[i]->pos_;
79 return InteriorEntity;
85 assert(1<=codim && codim<=2);
88 return this->levelIndex_;
90 return vertex_[i]->levelIndex_;
92 DUNE_THROW(GridError,
"Non-existing codimension requested!");
98 assert(1<=codim && codim<=2);
101 return this->leafIndex_;
103 return vertex_[i]->leafIndex_;
105 DUNE_THROW(GridError,
"Non-existing codimension requested!");
108 std::vector<const FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>*>
elements_;
110 std::array<const FoamGridEntityImp<0, dimgrid, dimworld, ctype>*, 2>
vertex_;
117 std::array<FoamGridEntityImp<1, dimgrid, dimworld, ctype>*,2>
sons_;
std::array< const FoamGridEntityImp< 0, dimgrid, dimworld, ctype > *, 2 > vertex_
Definition: foamgridedge.hh:110
FoamGridEntityImp(const FoamGridEntityImp< 0, dimgrid, dimworld, ctype > *v0, const FoamGridEntityImp< 0, dimgrid, dimworld, ctype > *v1, int level, unsigned int id, FoamGridEntityImp *father)
Definition: foamgridedge.hh:34
PartitionType partitionType() const
Definition: foamgridedge.hh:78
unsigned int boundarySegmentIndex() const
This has no function yet in Foamgrid.
Definition: foamgridedge.hh:51
unsigned int nSons_
The number of refined edges (0 or 2).
Definition: foamgridedge.hh:120
unsigned int boundarySegmentIndex_
The boundary id. Only used if this edge is a boundary edge.
Definition: foamgridedge.hh:113
FoamGridEntityImp< 1, dimgrid, dimworld, ctype > * father_
Pointer to father edge.
Definition: foamgridedge.hh:123
FoamGridEntityImp(const FoamGridEntityImp< 0, dimgrid, dimworld, ctype > *v0, const FoamGridEntityImp< 0, dimgrid, dimworld, ctype > *v1, int level, unsigned int id)
Definition: foamgridedge.hh:23
unsigned int boundaryId() const
This has no function yet in Foamgrid.
Definition: foamgridedge.hh:56
bool isLeaf() const
Definition: foamgridedge.hh:46
std::array< FoamGridEntityImp< 1, dimgrid, dimworld, ctype > *, 2 > sons_
links to refinements of this edge
Definition: foamgridedge.hh:117
bool hasFather() const
Definition: foamgridedge.hh:64
int corners() const
Number of corners (==2)
Definition: foamgridedge.hh:70
unsigned int boundaryId_
Definition: foamgridedge.hh:114
int subLevelIndex(int i, unsigned int codim) const
Return level index of sub entity with codim = cc and local number i.
Definition: foamgridedge.hh:84
int subLeafIndex(int i, unsigned int codim) const
Return leaf index of sub entity with codim = cc and local number i.
Definition: foamgridedge.hh:97
std::vector< const FoamGridEntityImp< dimgrid, dimgrid, dimworld, ctype > * > elements_
Definition: foamgridedge.hh:108
FieldVector< ctype, dimworld > corner(int i) const
Definition: foamgridedge.hh:74
GeometryType type() const
Definition: foamgridedge.hh:60
Base class for FoamGrid entity implementation classes.
Definition: foamgridvertex.hh:16
The actual entity implementation.
Definition: foamgridvertex.hh:47