Entity.hpp
Go to the documentation of this file.
281 static constexpr std::array<int,8> in_father_reference_elem_corner_indices_ = {0,1,2,3,4,5,6,7};
327 // Creates iterator with first child as target if there is one. Otherwise empty stack and target.
422 if (pgrid_ == (*(pgrid_->level_data_ptr_)).back().get()) { // entity on the leafview -> get the level where it was born:
423 return pgrid_ -> leaf_to_level_cells_[this-> index()][0]; // leaf_to_level_cells_ leafIdx -> {level/LGR, cell index in LGR}
432// - if distributed_data_ is empty: an element is a leaf <-> hbegin and hend return the same iterator. Then,
436// isLeaf() returns true <-> the element is a leaf entity of the global refinement hierarchy. Equivalently,
446 return (std::get<0>((pgrid_ -> parent_to_children_cells_)[this-> index()]) == -1); // Cells from GLOBAL, not involved in any LGR
453 if ((pgrid_ -> child_to_parent_cells_.empty()) || (pgrid_ -> child_to_parent_cells_[this->index()][0] == -1)){
465 const int& coarse_level = pgrid_ -> child_to_parent_cells_[this->index()][0]; // currently, always 0
484 // Get the amount of children cell in each direction of the parent cell of the entity (same for all parents of each LGR)
489 const auto& child0_Idx = std::get<1>((*level0_grid).parent_to_children_cells_[this->father().index()])[0];
490 // If pgrid_ is the leafview, go to the LGR where the entity was born to get its IJK index in the LGR and the LGR dimension.
496 const auto& entity_lgrIdx = pgrid_ -> leaf_to_level_cells_[this->index()][1]; // leaf_to_level_cells_[cell] = {level, index}
507 // reference element of each parent cell is the unit cube. Here, (eIJK[*]-"shift")/cells_per_dim[*]
511 { double(eIJK[0]-child0_IJK[0])/cells_per_dim[0], double(eIJK[1]-child0_IJK[1])/cells_per_dim[1],
514 { double(eIJK[0]-child0_IJK[0]+1)/cells_per_dim[0], double(eIJK[1]-child0_IJK[1])/cells_per_dim[1],
517 { double(eIJK[0]-child0_IJK[0])/cells_per_dim[0], double(eIJK[1]-child0_IJK[1]+1)/cells_per_dim[1],
520 { double(eIJK[0]-child0_IJK[0]+1)/cells_per_dim[0], double(eIJK[1]-child0_IJK[1]+1)/cells_per_dim[1],
523 { double(eIJK[0]-child0_IJK[0])/cells_per_dim[0], double(eIJK[1]-child0_IJK[1])/cells_per_dim[1],
526 { double(eIJK[0]-child0_IJK[0]+1)/cells_per_dim[0], double(eIJK[1]-child0_IJK[1])/cells_per_dim[1],
529 { double(eIJK[0]-child0_IJK[0])/cells_per_dim[0], double(eIJK[1]-child0_IJK[1]+1)/cells_per_dim[1],
532 { double(eIJK[0]-child0_IJK[0]+1)/cells_per_dim[0], double(eIJK[1]-child0_IJK[1]+1)/cells_per_dim[1],
534 auto in_father_reference_elem_corners = std::make_shared<EntityVariable<cpgrid::Geometry<0, 3>, 3>>();
535 EntityVariableBase<cpgrid::Geometry<0, 3>>& mutable_in_father_reference_elem_corners = *in_father_reference_elem_corners;
548 double volume_in_father_reference_elem = double(1)/(cells_per_dim[0]*cells_per_dim[1]*cells_per_dim[2]);
549 // Construct (and return) the Geometry<3,3> of 'child-cell in the reference element of its father (unit cube)'.
550 return Dune::cpgrid::Geometry<3,3>(center_in_father_reference_elem, volume_in_father_reference_elem,
565 const int& entityIdxInLevel0 = pgrid_->leaf_to_level_cells_[this->index()][1]; // leaf_to_level_cells_ [leaf idx] = {0, cell idx}
600 const auto& elemInLevel = this->getLevelElem(); // throws when the entity does not belong to the leaf grid view.
Struct that hods all the data needed to represent a Cpgrid. Definition: CpGridData.hpp:131 Definition: Entity.hpp:65 bool mightVanish() const Returns true, if entity might disappear during the next call to adapt(). Dummy. Definition: Entity.hpp:218 Entity< 0 > father() const ONLY FOR CELLS (Entity<0>). Get the father Entity, in case entity.hasFather() is true. Definition: Entity.hpp:462 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:354 LeafIntersectionIterator ileafend() const End leaf-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:317 EntitySeed seed() const Return an entity seed (light-weight entity). EntitySeed objects are used to obtain an Entity back whe... Definition: Entity.hpp:149 int getLevelCartesianIdx() const Get Cartesian Index in the level grid view where the Entity was born. Definition: Entity.hpp:596 HierarchicIterator hend(int) const Iterator end over the children/beyond last child iterator. Definition: Entity.hpp:333 const Geometry & geometry() const Return the geometry of the entity (does not depend on its orientation). Definition: Entity.hpp:368 cpgrid::IntersectionIterator LeafIntersectionIterator Definition: Entity.hpp:95 Entity(const CpGridData &grid, int index_arg, bool orientation_arg) Constructor taking a grid, entity index, and orientation. Definition: Entity.hpp:123 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:451 cpgrid::HierarchicIterator HierarchicIterator Definition: Entity.hpp:97 bool operator==(const Entity &other) const Equality. Definition: Entity.hpp:135 bool isRegular() const Refinement is not defined for CpGrid. Definition: Entity.hpp:168 HierarchicIterator hbegin(int) const Iterator begin over the children. [If requested, also over descendants more than one generation away.... Definition: Entity.hpp:325 cpgrid::IntersectionIterator LevelIntersectionIterator Definition: Entity.hpp:96 const Entity & impl() const Access the actual implementation class behind Entity interface class. Definition: Entity.hpp:250 PartitionType partitionType() const For now, the grid is serial and the only partitionType() is InteriorEntity. Only needed when distribu... Definition: Entity.hpp:340 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:476 Entity(int index_arg, bool orientation_arg) Constructor taking a entity index, and orientation. Definition: Entity.hpp:129 LeafIntersectionIterator ileafbegin() const Start leaf-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:310 Entity(const CpGridData &grid, EntityRep< codim > entityrep) Constructor taking a grid and an entity representation. Definition: Entity.hpp:117 LevelIntersectionIterator ilevelend() const End level-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:303 bool isNew() const Returns true, if the entity has been created during the last call to adapt(). Dummy. Definition: Entity.hpp:212 Entity< 0 > getLevelElem() const Get equivalent element on the level grid view for an element on the leaf grid view. Definition: Entity.hpp:576 LevelIntersectionIterator ilevelbegin() const Start level-iterator for the cell-cell intersections of this entity. Definition: Entity.hpp:296 GeometryType type() const Return marker object (GeometryType object) representing the reference element of the entity.... Definition: Entity.hpp:179 int level() const Return the level of the entity in the grid hierarchy. Level = 0 represents the coarsest grid. Definition: Entity.hpp:416 bool isLeaf() const Check if the entity is in the leafview. Definition: Entity.hpp:440 bool operator!=(const Entity &other) const Inequality. Definition: Entity.hpp:141 bool hasBoundaryIntersections() const Definition: Entity.hpp:395 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:75 Only needs to provide interface for doing nothing. Definition: Iterators.hpp:108 Definition: Intersection.hpp:278 Definition: Indexsets.hpp:248 The namespace Dune is the main namespace for all Dune code. Definition: common/CartesianIndexMapper.hpp:10 Definition: Entity.hpp:87 |