Entity.hpp
Go to the documentation of this file.
352 // Creates iterator with first child as target if there is one. Otherwise empty stack and target.
445 // If the grid has been distributed and - after that - LGRs have been added, then level_data_ptr_
449 // If the grid is not distributed and there LGRs have been added, level_data_ptr_ points at data_ which
452 // - leaf_to_level_cells_ is non-empty only on the leaf grid view of a grid that has been refined.
453 // - level_ is set equal to zero when instantiating a pgrid, and rewriten when it corresponds to a refined level grid.
454 return pgrid_->leaf_to_level_cells_.empty()? pgrid_->level_ : pgrid_->leaf_to_level_cells_[this-> index()][0];
458// - if distributed_data_ is empty: an element is a leaf <-> hbegin and hend return the same iterator. Then,
462// isLeaf() returns true <-> the element is a leaf entity of the global refinement hierarchy. Equivalently,
472 return (std::get<0>((pgrid_ -> parent_to_children_cells_)[this-> index()]) == -1); // Not involved in any LGR
489 return isLeaf() && (pgrid_->refinement_max_level_ == data_count - 2); // minus "level zero" and "leaf"
502 if ((pgrid_ -> child_to_parent_cells_.empty()) || (pgrid_ -> child_to_parent_cells_[this->index()][0] == -1)){
516 return Entity<0>( *((*(pgrid_ -> level_data_ptr_))[coarser_level].get()), parent_cell_index, true);
539 // 'static': The returned object Geometry<3,3> stores a pointer to in_father_reference_elem_corner_indices. Therefore,
540 // this variable is declared static to prolongate its lifetime beyond this function (static storage duration).
548 auto in_father_reference_elem_corners = std::make_shared<EntityVariable<cpgrid::Geometry<0, 3>, 3>>();
549 EntityVariableBase<cpgrid::Geometry<0, 3>>& mutable_in_father_reference_elem_corners = *in_father_reference_elem_corners;
562 double volume_in_father_reference_elem = double(1)/(cells_per_dim[0]*cells_per_dim[1]*cells_per_dim[2]);
563 // Construct (and return) the Geometry<3,3> of 'child-cell in the reference element of its father (unit cube)'.
564 return Dune::cpgrid::Geometry<3,3>(center_in_father_reference_elem, volume_in_father_reference_elem,
590 return Dune::cpgrid::Entity<0>( *((*(pgrid_ -> level_data_ptr_))[level].get()), levelElemIdx, true);
602 // leaf_to_level_cells_ [leaf idx] = {level where the entity was born, equivalent cell idx in that level}
606 return Dune::cpgrid::Entity<0>( *((*(pgrid_ -> level_data_ptr_))[this->level()].get()), entityLevelIdx, true);
void refinePatch_and_check(Dune::CpGrid &, const std::vector< std::array< int, 3 > > &, const std::vector< std::array< int, 3 > > &, const std::vector< std::array< int, 3 > > &, const std::vector< std::string > &) Struct that hods all the data needed to represent a Cpgrid. Definition: CpGridData.hpp:118 Definition: Entity.hpp:72 bool mightVanish() const Indicates whether the entity may be removed in the next call to adapt(). Definition: Entity.hpp:494 Entity< 0 > father() const ONLY FOR CELLS (Entity<0>). Get the father Entity (in the level-grid the father cell was born),... Definition: Entity.hpp:511 unsigned int subEntities(const unsigned int cc) const Return the number of all subentities of the entity of a given codimension cc. Definition: Entity.hpp:380 LeafIntersectionIterator ileafend() const End leaf-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:342 EntitySeed seed() const Return an entity seed (light-weight entity). EntitySeed objects are used to obtain an Entity back whe... Definition: Entity.hpp:159 int getLevelCartesianIdx() const Get Cartesian Index in the level grid view where the Entity was born. Definition: Entity.hpp:614 HierarchicIterator hend(int) const Iterator end over the children/beyond last child iterator. Definition: Entity.hpp:358 const Geometry & geometry() const Return the geometry of the entity (does not depend on its orientation). Definition: Entity.hpp:394 cpgrid::IntersectionIterator LeafIntersectionIterator Definition: Entity.hpp:105 Entity(const CpGridData &grid, int index_arg, bool orientation_arg) Constructor taking a grid, entity index, and orientation. Definition: Entity.hpp:133 bool hasFather() const ONLY FOR CELLS (Entity<0>) Check if the entity comes from an LGR, i.e., it has been created via refin... Definition: Entity.hpp:500 Entity< 0 > getOrigin() const Returns (1) oldest ancestor, i.e., oldest parent entity in the level-grid 0, if the entity was born i... Definition: Entity.hpp:573 cpgrid::HierarchicIterator HierarchicIterator Definition: Entity.hpp:107 bool operator==(const Entity &other) const Equality. Definition: Entity.hpp:145 bool isRegular() const Refinement is not defined for CpGrid. Definition: Entity.hpp:178 HierarchicIterator hbegin(int) const Iterator begin over the children. [If requested, also over descendants more than one generation away.... Definition: Entity.hpp:350 cpgrid::IntersectionIterator LevelIntersectionIterator Definition: Entity.hpp:106 const Entity & impl() const Access the actual implementation class behind Entity interface class. Definition: Entity.hpp:266 PartitionType partitionType() const In serial run, the only partitionType() is InteriorEntity. Only needed when distributed_data_ is not ... Definition: Entity.hpp:365 Dune::cpgrid::Geometry< 3, 3 > geometryInFather() const Return LocalGeometry representing the embedding of the entity into its father (when hasFather() is tr... Definition: Entity.hpp:531 Entity(int index_arg, bool orientation_arg) Constructor taking a entity index, and orientation. Definition: Entity.hpp:139 LeafIntersectionIterator ileafbegin() const Start leaf-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:335 Entity(const CpGridData &grid, EntityRep< codim > entityrep) Constructor taking a grid and an entity representation. Definition: Entity.hpp:127 LevelIntersectionIterator ilevelend() const End level-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:328 bool isNew() const Returns true, if the entity has been created during the last call to adapt(). Definition: Entity.hpp:477 Entity< 0 > getLevelElem() const Get equivalent element on the level grid where the entity was born, if grid = leaf-grid-view.... Definition: Entity.hpp:598 LevelIntersectionIterator ilevelbegin() const Start level-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:321 GeometryType type() const Return marker object (GeometryType object) representing the reference element of the entity.... Definition: Entity.hpp:192 int level() const Return the level of the entity in the grid hierarchy. Level = 0 represents the coarsest grid. Definition: Entity.hpp:442 bool isLeaf() const Check if the entity is in the leafview. Definition: Entity.hpp:466 bool operator!=(const Entity &other) const Inequality. Definition: Entity.hpp:151 bool hasBoundaryIntersections() const Definition: Entity.hpp:421 Codim< cc >::Entity subEntity(int i) const Obtain subentity. Example: If cc = 3 and i = 5, it returns the 5th corner/vertex of the entity. Represents an entity of a given codim, with positive or negative orientation. Definition: EntityRep.hpp:99 bool operator==(const EntityRep &other) const Equality operator. Definition: EntityRep.hpp:179 int index() const The (positive) index of an entity. Not a Dune interface method. Definition: EntityRep.hpp:126 Base class for EntityVariable and SignedEntityVariable. Forwards a restricted subset of the std::vect... Definition: EntityRep.hpp:219 Definition: Geometry.hpp:76 Only needs to provide interface for doing nothing. Definition: Iterators.hpp:118 Definition: Intersection.hpp:279 Definition: Indexsets.hpp:371 auto referenceElement(const Entity< codim > &) Definition: Entity.hpp:303 The namespace Dune is the main namespace for all Dune code. Definition: common/CartesianIndexMapper.hpp:10 |