Dune Core Modules (2.11.0)
foamgrid.hh
Go to the documentation of this file.
165 return Dune::FoamGridLevelIterator<codim,All_Partition, const Dune::FoamGrid<dimgrid, dimworld, ctype> >(std::get<dimgrid-codim>(entityImps_[level]).begin());
175 return Dune::FoamGridLevelIterator<codim,All_Partition, const Dune::FoamGrid<dimgrid, dimworld, ctype> >(std::get<dimgrid-codim>(entityImps_[level]).end());
181 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lbegin (int level) const {
185 return Dune::FoamGridLevelIterator<codim,PiType, const Dune::FoamGrid<dimgrid, dimworld, ctype> >(std::get<dimgrid-codim>(entityImps_[level]).begin());
191 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lend (int level) const {
195 return Dune::FoamGridLevelIterator<codim,PiType, const Dune::FoamGrid<dimgrid, dimworld, ctype> >(std::get<dimgrid-codim>(entityImps_[level]).end());
215 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafbegin() const {
222 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafend() const {
336 const_cast<FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>*>(e.impl().target_)->markState_ = FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>::REFINE;
338 const_cast<FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>*>(e.impl().target_)->markState_ = FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>::COARSEN;
340 const_cast<FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>*>(e.impl().target_)->markState_ = FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>::DO_NOTHING;
398 verticesToInsert_.push_back(FoamGridEntityImp<0, dimgrid, dimworld, ctype>(0, pos, -verticesToInsert_.size()-1)); // initialize with some invalid id
403 newVertex.growthInsertionIndex_ = this->leafGridView().size(dimgrid) - 1 + verticesToInsert_.size();
421 elementsToInsert_.push_back(FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>(0, -elementsToInsert_.size()-1)); // initialize with some invalid id
429 // initialize with pointer to vertex in verticesToInsert_ vector, later overwrite with actual pointer
438 // the vertex already exists in the grid, initialize with leaf vertex, later overwrite with lowest level father
471 elementsToRemove_.push_back(const_cast<FoamGridEntityImp<dimgrid, dimgrid, dimworld, ctype>*> (e.impl().target_));
506 unsigned int growthInsertionIndex(const typename Traits::template Codim<dimgrid>::Entity & e) const
552 DUNE_THROW(Dune::NotImplemented, "Load balancing not implemented. Foamgrid does not run in parallel yet!");
575 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir, int level) const
604 indexToVertexMap_[index] = const_cast<FoamGridEntityImp<0, dimgrid ,dimworld, ctype>*>(vertex.impl().target_);
612 void erasePointersToEntities(std::list<FoamGridEntityImp<dimgrid, dimgrid ,dimworld, ctype> >& elements);
619 void eraseVanishedEntities(std::list<FoamGridEntityImp<i, dimgrid, dimworld, ctype> >& levelEntities);
683 for(auto eIt = std::get<dimgrid>(entityImps_[level]).begin(); eIt != std::get<dimgrid>(entityImps_[level]).end(); ++eIt)
694 { return std::vector<std::tuple<std::list<FoamGridEntityImp<dimEntity, dimgrid, dimworld, ctype>>...>>(numLevels); }
Collective communication interface and sequential default implementation.
Definition: communication.hh:100
Store a reference to an entity with a minimal memory footprint.
Definition: entityseed.hh:26
Implementation & impl()
access to the underlying implementation
Definition: entityseed.hh:59
static constexpr int codimension
codimension of underlying entity
Definition: entityseed.hh:30
Vertex specialization of FoamGridEntityImp.
Definition: foamgridvertex.hh:53
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
bool isNew_
If the vertex was newly inserted (at run-time)
Definition: foamgridvertex.hh:141
Element specialization of FoamGridEntityImp. Element is a grid entity of topological codimension 0 an...
Definition: foamgridelements.hh:18
The EntitySeed class provides the minmal information needed to restore an Entity using the grid.
Definition: foamgridentityseed.hh:21
Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
Definition: foamgridhierarchiciterator.hh:24
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: foamgridintersectioniterators.hh:28
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: foamgridintersections.hh:386
Iterator over all entities of a given codimension and level of a grid.
Definition: foamgridleafiterator.hh:15
Definition: foamgridindexsets.hh:26
Definition: foamgridintersectioniterators.hh:239
Iterator over all entities of a given codimension and level of a grid.
Definition: foamgridleveliterator.hh:18
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lend(int level) const
one past the end on this level
Definition: foamgrid.hh:191
void removeElement(const typename Traits::template Codim< 0 >::Entity &e)
Mark an element for removal from the grid.
Definition: foamgrid.hh:468
unsigned int overlapSize(int level, int codim) const
Size of the overlap on a given level.
Definition: foamgrid.hh:531
int size(int level, GeometryType type) const
number of entities per level, codim and geometry type in this process
Definition: foamgrid.hh:250
const Traits::LocalIdSet & localIdSet() const
Access to the LocalIdSet.
Definition: foamgrid.hh:274
size_t numBoundarySegments() const
The number of boundary edges on the coarsest level.
Definition: foamgrid.hh:262
void setPosition(const typename Traits::template Codim< dimgrid >::Entity &e, const FieldVector< ctype, dimworld > &pos)
Sets a (leaf) vertex to a new position.
Definition: foamgrid.cc:1422
void communicate(T &t, InterfaceType iftype, CommunicationDirection dir, int level) const
The communication interface.
Definition: foamgrid.hh:568
bool preGrow()
Book-keeping routine to be called before growth.
Definition: foamgrid.cc:1001
bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)
Mark entity for refinement.
Definition: foamgrid.hh:329
FoamGridFamily< dimgrid, dimworld, ct > GridFamily
FoamGrid is only implemented for 1 and 2 dimension.
Definition: foamgrid.hh:122
unsigned int insertVertex(const FieldVector< ctype, dimworld > &pos)
Add new vertex to be added the grid.
Definition: foamgrid.hh:393
unsigned int growthInsertionIndex(const typename Traits::template Codim< 0 >::Entity &e) const
The index of insertion if the element was created in the current growth step. If this is the first el...
Definition: foamgrid.hh:491
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
Return refinement mark for entity.
Definition: foamgrid.hh:349
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafend() const
one past the end of the sequence of leaf entities
Definition: foamgrid.hh:222
unsigned int insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
Add a new element to be added to the grid.
Definition: foamgrid.hh:413
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Definition: foamgrid.hh:575
const Traits::LevelIndexSet & levelIndexSet(int level) const
Access to the LevelIndexSets.
Definition: foamgrid.hh:280
const Traits::GlobalIdSet & globalIdSet() const
Access to the GlobalIdSet.
Definition: foamgrid.hh:268
bool loadBalance(DataHandle &data)
Distributes this grid over the available nodes in a distributed machine.
Definition: foamgrid.hh:544
bool preAdapt()
Book-keeping routine to be called before adaptation.
Definition: foamgrid.cc:152
FoamGridFamily< dimgrid, dimworld, ct >::Traits Traits
Exports various types belonging to this grid class.
Definition: foamgrid.hh:125
Traits::template Codim< codim >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: foamgrid.hh:161
int size(GeometryType type) const
number of leaf entities per codim and geometry type in this process
Definition: foamgrid.hh:256
Traits::template Codim< codim >::LeafIterator leafbegin() const
Iterator to first leaf entity of given codim.
Definition: foamgrid.hh:201
void globalRefine(int refCount=1)
Refine the grid uniformly.
Definition: foamgrid.cc:3
unsigned int insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices, std::function< FieldVector< ctype, dimworld >(FieldVector< ctype, dimgrid >)> elementParametrization)
Add a new element to be added to the grid.
Definition: foamgrid.hh:455
Traits::template Codim< codim >::LeafIterator leafend() const
one past the end of the sequence of leaf entities
Definition: foamgrid.hh:208
unsigned int overlapSize(int codim) const
Size of the overlap on the leaf level.
Definition: foamgrid.hh:519
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: foamgrid.hh:181
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafbegin() const
Iterator to first leaf entity of given codim.
Definition: foamgrid.hh:215
unsigned int ghostSize(int level, int codim) const
Size of the ghost cell layer on a given level.
Definition: foamgrid.hh:537
Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
Create an Entity from an EntitySeed.
Definition: foamgrid.hh:303
unsigned int ghostSize(int codim) const
Size of the ghost cell layer on the leaf level.
Definition: foamgrid.hh:525
Traits::template Codim< codim >::LevelIterator lend(int level) const
one past the end on this level
Definition: foamgrid.hh:171
const Traits::LeafIndexSet & leafIndexSet() const
Access to the LeafIndexSet.
Definition: foamgrid.hh:295
unsigned int growthInsertionIndex(const typename Traits::template Codim< dimgrid >::Entity &e) const
The index of insertion if the vertex was created in the current growth step. If this is the first ver...
Definition: foamgrid.hh:506
int size(int level, int codim) const
Number of grid entities per level and codim.
Definition: foamgrid.hh:229
int size(int codim) const
number of leaf entities per codim in this process
Definition: foamgrid.hh:244
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
constexpr bool isTriangle() const
Return true if entity is a triangle.
Definition: type.hh:289
constexpr bool isLine() const
Return true if entity is a line segment.
Definition: type.hh:284
Definition: grid.hh:848
Traits::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: grid.hh:868
Specialization of the generic GridFactory for FoamGrid<dimgrid, dimworld>
Definition: foamgridfactory.hh:29
Provide a generic factory class for unstructured grids.
Definition: gridfactory.hh:275
auto size(GeometryType type) const
Return total number of entities of given geometry type in entity set .
Definition: indexidset.hh:223
IndexType index(const typename Traits::template Codim< cc >::Entity &e) const
Map entity to index. The result of calling this method with an entity that is not in the index set is...
Definition: indexidset.hh:113
A set of traits classes to store static information about grid implementation.
Different resources needed by all grid implementations.
Implements an utility class that provides collective communication methods for sequential programs.
The FoamGridEntity class.
Implementation of EntitySeed for the FoamGrid grid manager.
The specialization of the generic GridFactory for FoamGrid.
The FoamGridGeometry class.
The FoamGridHierarchicIterator class.
The index and id sets for the FoamGrid class.
The FoamGridLeafIntersectionIterator and FoamGridLevelIntersectionIterator classes.
The FoamGridLeafIterator class.
The FoamGridLevelIterator class.
int size(int codim) const
obtain number of entities in a given codimension
Definition: gridview.hh:183
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:170
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:86
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:492
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition: subdomain.hh:487
Standard Dune debug streams.
Specialize with 'true' for all codims that a grid implements entities for. (default=false)
Definition: capabilities.hh:58
Specialize with 'true' if implementation guarantees a conforming leaf grid. (default=false)
Definition: capabilities.hh:115
Specialize with 'true' if implementation guarantees conforming level grids. (default=false)
Definition: capabilities.hh:106
Specialize with 'true' if the grid implementation is thread safe, while it is not modified....
Definition: capabilities.hh:169
A traits struct that collects all associated types of one grid model.
Definition: grid.hh:1013
CCType Communication
The type of the communication.
Definition: grid.hh:1089
|
Legal Statements / Impressum |
Hosted by TU Dresden & Uni Heidelberg |
generated with Hugo v0.111.3
(Feb 14, 23:39, 2026)