3 #ifndef DUNE_FOAMGRID_VERTEX_HH
4 #define DUNE_FOAMGRID_VERTEX_HH
6 #include <dune/common/fvector.hh>
7 #include <dune/geometry/type.hh>
8 #include <dune/grid/common/gridenums.hh>
9 #include <dune/grid/common/exceptions.hh>
46 template <
int dimentity,
int dimgr
id,
int dimworld,
class ctype>
50 template <
int dimgr
id,
int dimworld,
class ctype>
58 , elements_(), vertex_{{
this}}, father_(
nullptr), isNew_(
false)
59 , growthInsertionIndex_(-1)
65 return sons_[0]==
nullptr;
68 GeometryType
type()
const {
69 return GeometryTypes::vertex;
74 return father_!=
nullptr;
79 return boundarySegmentIndex_;
92 FieldVector<ctype, dimworld>
corner(
int i)
const {
93 assert(i<this->corners());
98 return InteriorEntity;
104 assert(codim==dimgrid);
105 return this->levelIndex_;
106 DUNE_THROW(GridError,
"Non-existing codimension requested!");
112 assert(codim==dimgrid);
113 return this->leafIndex_;
114 DUNE_THROW(GridError,
"Non-existing codimension requested!");
118 FieldVector<ctype, dimworld>
pos_;
124 std::vector<const FoamGridEntityImp<dimgrid, dimgrid ,dimworld, ctype>*>
elements_;
127 std::array<const FoamGridEntityImp<0, dimgrid ,dimworld, ctype>*, 1>
vertex_;
138 std::array<FoamGridEntityImp<0, dimgrid, dimworld, ctype>*, 1>
sons_;
Base class for FoamGrid entity implementation classes.
Definition: foamgridvertex.hh:16
FoamGridEntityBase(int level, unsigned int id)
Definition: foamgridvertex.hh:18
int level_
level
Definition: foamgridvertex.hh:27
unsigned int levelIndex_
entity number
Definition: foamgridvertex.hh:30
int level() const
Definition: foamgridvertex.hh:22
unsigned int id_
Definition: foamgridvertex.hh:34
bool willVanish_
Whether this entity will vanish due to coarsening.
Definition: foamgridvertex.hh:36
unsigned int leafIndex_
Definition: foamgridvertex.hh:32
The actual entity implementation.
Definition: foamgridvertex.hh:47
Vertex specialization of FoamGridEntityImp.
Definition: foamgridvertex.hh:53
unsigned int nSons_
The number of refined vertices */.
Definition: foamgridvertex.hh:121
int subLeafIndex(int i, unsigned int codim) const
Return leaf index of sub entity with codim = cc and local number i.
Definition: foamgridvertex.hh:111
std::array< FoamGridEntityImp< 0, dimgrid, dimworld, ctype > *, 1 > sons_
Son vertex on the next finer grid.
Definition: foamgridvertex.hh:138
bool hasFather() const
Definition: foamgridvertex.hh:72
PartitionType partitionType() const
Definition: foamgridvertex.hh:97
FoamGridEntityImp< 0, dimgrid, dimworld, ctype > * father_
Pointer to father vertex on next coarser grid */.
Definition: foamgridvertex.hh:135
FieldVector< ctype, dimworld > pos_
Position vector of this vertex.
Definition: foamgridvertex.hh:118
GeometryType type() const
Definition: foamgridvertex.hh:68
unsigned int boundaryId_
Definition: foamgridvertex.hh:132
int growthInsertionIndex_
If this vertex was created in a growth step this will be the index of insertion So if this is the fir...
Definition: foamgridvertex.hh:148
FoamGridEntityImp(int level, const FieldVector< ctype, dimworld > &pos, unsigned int id)
Definition: foamgridvertex.hh:56
std::array< const FoamGridEntityImp< 0, dimgrid,dimworld, ctype > *, 1 > vertex_
A vertex array for compatibility reasons with edges. Initialized with the this pointer.
Definition: foamgridvertex.hh:127
unsigned int boundarySegmentIndex() const
This has no function yet in Foamgrid.
Definition: foamgridvertex.hh:78
FieldVector< ctype, dimworld > corner(int i) const
Definition: foamgridvertex.hh:92
bool isLeaf() const
Definition: foamgridvertex.hh:64
int corners() const
Number of corners (==1)
Definition: foamgridvertex.hh:88
std::vector< const FoamGridEntityImp< dimgrid, dimgrid,dimworld, ctype > * > elements_
Elements the vertex is related to.
Definition: foamgridvertex.hh:124
unsigned int boundarySegmentIndex_
Boundary index if vertex is on boundary.
Definition: foamgridvertex.hh:131
int subLevelIndex(int i, unsigned int codim) const
Return level index of sub entity with codim = cc and local number i.
Definition: foamgridvertex.hh:103
unsigned int boundaryId() const
This has no function yet in Foamgrid.
Definition: foamgridvertex.hh:83
bool isNew_
If the vertex was newly inserted (at run-time)
Definition: foamgridvertex.hh:141