Loading [MathJax]/extensions/tex2jax.js

dune-mmesh (unstable)

entity.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_MMESH_GRID_ENTITY_HH
4#define DUNE_MMESH_GRID_ENTITY_HH
5
10// Dune includes
11#include <dune/grid/common/grid.hh>
13
14namespace Dune {
15// Forward declarations
16template <int codim, int dim, class GridImp>
17class MMeshEntity;
18} // namespace Dune
19
20// MMesh includes
22#include <dune/mmesh/grid/polygoncutting.hh>
23#include <dune/mmesh/misc/partitionhelper.hh>
24
25namespace Dune {
26template <class GridImp>
27class MMeshLeafIntersectionIterator;
28
29template <class GridImp>
30class MMeshHierarchicIterator;
31
32// External forward declarations
33template <class Grid>
34struct HostGridAccess;
35
36//**********************************************************************
37//
38// --MMeshEntity
39// --Entity
40//
45template <int codim, int dim, class GridImp>
47#ifndef DOXYGEN_SHOULD_SKIP_THIS
48 : public EntityDefaultImplementation<codim, dim, GridImp, MMeshEntity>
49#endif /* DOXYGEN_SHOULD_SKIP_THIS */
50{
51 template <class GridImp_>
52 friend class MMeshLeafIndexSet;
53
54 template <class GridImp_>
55 friend class MMeshLocalIdSet;
56
57 template <class GridImp_>
58 friend class MMeshGlobalIdSet;
59
60 friend struct HostGridAccess<typename std::remove_const<GridImp>::type>;
61
63 using IdType = MMeshImpl::MultiId;
64
65 private:
66 typedef typename GridImp::ctype ctype;
67
68 // The equivalent entity in the host grid
69 typedef typename GridImp::template HostGridEntity<codim> HostGridEntity;
70
72 typedef typename GridImp::template Codim<codim>::Entity Entity;
73
74 public:
76 typedef typename GridImp::template Codim<codim>::Geometry Geometry;
77
79 typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;
80
81 MMeshEntity() : mMesh_(nullptr) {}
82
83 MMeshEntity(const GridImp* mMesh, const HostGridEntity& hostEntity)
84 : hostEntity_(hostEntity), mMesh_(mMesh) {}
85
86 MMeshEntity(const GridImp* mMesh, HostGridEntity&& hostEntity)
87 : hostEntity_(std::move(hostEntity)), mMesh_(mMesh) {}
88
89 MMeshEntity(const MMeshEntity& original)
90 : hostEntity_(original.hostEntity_), mMesh_(original.mMesh_) {}
91
92 MMeshEntity(MMeshEntity&& original)
93 : hostEntity_(std::move(original.hostEntity_)), mMesh_(original.mMesh_) {}
94
95 MMeshEntity& operator=(const MMeshEntity& original) {
96 if (this != &original) {
97 mMesh_ = original.mMesh_;
98 hostEntity_ = original.hostEntity_;
99 }
100 return *this;
101 }
102
103 MMeshEntity& operator=(MMeshEntity&& original) {
104 if (this != &original) {
105 mMesh_ = original.mMesh_;
106 hostEntity_ = std::move(original.hostEntity_);
107 }
108 return *this;
109 }
110
111 // Comparator for vertices
112 template <int cc = codim>
113 std::enable_if_t<cc == dim, bool> equals(const MMeshEntity& other) const {
114 return hostEntity_ == other.hostEntity_;
115 }
116
117 // Comparator for edges
118 template <int cc = codim>
119 std::enable_if_t<cc == 1 && dim == 2, bool> equals(
120 const MMeshEntity& other) const {
121 return (hostEntity_ == other.hostEntity_) ||
122 (mMesh_->getHostGrid().mirror_edge(hostEntity_) ==
123 other.hostEntity_);
124 }
125
126 // Comparator for facets
127 template <int cc = codim>
128 std::enable_if_t<cc == 1 && dim == 3, bool> equals(
129 const MMeshEntity& other) const {
130 return (hostEntity_ == other.hostEntity_) ||
131 (hostEntity_ ==
132 mMesh_->getHostGrid().mirror_facet(other.hostEntity_));
133 }
134
135 // Comparator for edges in 3d
136 template <int cc = codim>
137 std::enable_if_t<cc == 2 && dim == 3, bool> equals(
138 const MMeshEntity& other) const {
139 const auto& v0 = hostEntity_.first->vertex(hostEntity_.second);
140 const auto& v1 = hostEntity_.first->vertex(hostEntity_.third);
141 const auto& w0 = other.hostEntity_.first->vertex(other.hostEntity_.second);
142 const auto& w1 = other.hostEntity_.first->vertex(other.hostEntity_.third);
143 return (v0 == w0 && v1 == w1) || (v0 == w1 && v1 == w0);
144 }
145
147 bool hasFather() const { return false; }
148
150 EntitySeed seed() const { return EntitySeed(hostEntity_); }
151
153 int level() const {
154 // we only have one level
155 return 0;
156 }
157
159 PartitionType partitionType() const {
160 const auto& ph = mMesh_->partitionHelper();
161 if constexpr (codim == 0 || codim == dim)
162 return ph.partitionType(hostEntity_->info().partition);
163 else
164 return ph.partitionType(grid().entity(hostEntity_));
165 }
166
168 unsigned int subEntities(unsigned int cc) const {
169 // we have a simplex grid
170 int n = dim - codim + 1;
171 int k = dim - cc + 1;
172
173 // binomial: n over k
174 int binomial = 1;
175 for (int i = n - k + 1; i <= n; i++) binomial *= i;
176 for (long i = 2; i <= k; i++) binomial /= i;
177
178 return binomial;
179 }
180
182 template <int cc>
183 std::enable_if_t<codim == 1 && cc == dim,
184 typename GridImp::template Codim<dim>::Entity>
185 subEntity(unsigned int i) const {
186 assert(i < subEntities(cc));
187 const auto& cell = hostEntity_.first;
188 auto facetIdx =
189 MMeshImpl::cgalFacetToDuneFacet<dim, HostGridEntity>(hostEntity_);
190 const auto i0 =
191 cgalIndex(MMeshImpl::ref<dim>().subEntity(facetIdx, 1, i, dim));
192
194 mMesh_,
195 typename GridImp::template HostGridEntity<dim>(cell->vertex(i0)));
196 }
197
199 template <int cc>
200 std::enable_if_t<codim == 2 && cc == 3,
201 typename GridImp::template Codim<3>::Entity>
202 subEntity(unsigned int i) const {
203 assert(i < subEntities(cc));
204 const auto& cell = hostEntity_.first;
205
206 auto edgeIdx =
207 MMeshImpl::cgalEdgeToDuneEdge<3, HostGridEntity>(hostEntity_);
208
209 const auto i0 =
210 cgalIndex(MMeshImpl::ref<dim>().subEntity(edgeIdx, 2, i, 3));
211
213 mMesh_,
214 typename GridImp::template HostGridEntity<dim>(cell->vertex(i0)));
215 }
216
218 template <int cc>
219 std::enable_if_t<codim == dim && cc == dim,
220 typename GridImp::template Codim<dim>::Entity>
221 subEntity(unsigned int i) const {
222 assert(i < subEntities(cc));
223 return MMeshEntity<cc, dim, GridImp>(mMesh_, hostEntity_);
224 }
225
227 template <bool enable = true>
228 std::enable_if_t<codim == dim && enable, MMeshIncidentIterator<GridImp>>
231 return MMeshIncidentIterator<GridImp>(Impl(mMesh_, hostEntity_));
232 }
233
235 template <bool enable = true>
236 std::enable_if_t<codim == dim && enable, MMeshIncidentIterator<GridImp>>
237 incidentEnd() const {
239 return MMeshIncidentIterator<GridImp>(Impl(mMesh_, hostEntity_, true));
240 }
241
243 template <bool enable = true>
244 std::enable_if_t<codim == dim - 1 && enable,
248 return MMeshEdgeIncidentIterator<GridImp>(Impl(mMesh_, hostEntity_));
249 }
250
252 template <bool enable = true>
253 std::enable_if_t<codim == dim - 1 && enable,
255 incidentEnd() const {
257 return MMeshEdgeIncidentIterator<GridImp>(Impl(mMesh_, hostEntity_, true));
258 }
259
261 template <bool enable = true>
262 std::enable_if_t<codim == dim && enable, MMeshIncidentFacetsIterator<GridImp>>
265 return MMeshIncidentFacetsIterator<GridImp>(Impl(mMesh_, hostEntity_));
266 }
267
269 template <bool enable = true>
270 std::enable_if_t<codim == dim && enable, MMeshIncidentFacetsIterator<GridImp>>
274 Impl(mMesh_, hostEntity_, true));
275 }
276
278 template <bool enable = true>
279 std::enable_if_t<codim == dim && enable,
281 incidentVerticesBegin(bool includeInfinite) const {
282 using Impl =
285 Impl(mMesh_, hostEntity_, includeInfinite));
286 }
287
289 template <bool enable = true>
290 std::enable_if_t<codim == dim && enable,
292 incidentVerticesEnd(bool includeInfinite) const {
293 using Impl =
296 Impl(mMesh_, hostEntity_, includeInfinite, true));
297 }
298
300 template <int cd = codim>
301 std::enable_if_t<cd == dim, std::size_t> insertionLevel() const {
302 if (codim == dim) return hostEntity_->info().insertionLevel;
303 }
304
307 template <int cd = codim>
308 std::enable_if_t<cd != dim, std::size_t> insertionLevel() const {
309 std::size_t insertionLevel = 0;
310 for (std::size_t i = 0; i < subEntities(dim); ++i)
312 std::max(insertionLevel,
313 this->template subEntity<dim>(i).impl().insertionLevel());
314 return insertionLevel;
315 }
316
318 bool isInterface() const {
319 if constexpr (codim == dim)
320 return hostEntity_->info().isInterface;
321 else
322 DUNE_THROW(NotImplemented, "isInterface for codim != dim");
323 }
324
327 int boundaryFlag() const {
328 if constexpr (codim == dim)
329 return hostEntity_->info().boundaryFlag;
330 else
331 DUNE_THROW(NotImplemented, "boudnaryFlag for codim != dim");
332 }
333
335 Geometry geometry() const { return Geometry(hostEntity_); }
336
338 GeometryType type() const { return GeometryTypes::simplex(dim - codim); }
339
341 const HostGridEntity& hostEntity() const { return hostEntity_; }
342
344 HostGridEntity& hostEntity() { return hostEntity_; }
345
347 const GridImp& grid() const { return *mMesh_; }
348
350 IdType id() const {
351 // cache id
352 if (id_ == IdType()) {
353 typename IdType::VT idlist(dim + 1 - codim);
354 for (std::size_t i = 0; i < this->subEntities(dim); ++i)
355 idlist[i] =
356 this->template subEntity<dim>(i).impl().hostEntity()->info().id;
357 std::sort(idlist.begin(), idlist.end());
358 id_ = IdType(idlist);
359 }
360
361 return id_;
362 }
363
364 private:
366 const auto cgalIndex(const std::size_t& i) const {
367 if constexpr (codim != dim)
368 return hostEntity_.first->info().cgalIndex[i];
369 else {
370 DUNE_THROW(NotImplemented, "cgalIndex(i) for codim != dim");
371 return 0;
372 }
373 }
374
376 mutable IdType id_;
377
379 HostGridEntity hostEntity_;
380
382 const GridImp* mMesh_;
383};
384
385//***********************
386//
387// --MMeshEntity
388//
389//***********************
394template <int dim, class GridImp>
395class MMeshEntity<0, dim, GridImp>
396#ifndef DOXYGEN_SHOULD_SKIP_THIS
397 : public EntityDefaultImplementation<0, dim, GridImp, MMeshEntity>
398#endif /* DOXYGEN_SHOULD_SKIP_THIS */
399{
400 friend struct HostGridAccess<typename std::remove_const<GridImp>::type>;
401
402 typedef Entity<0, dim, GridImp, MMeshEntity> EntityType;
403
404 public:
405 // equivalent entity in the host grid
406 typedef typename GridImp::template HostGridEntity<0> HostGridEntity;
407
408 typedef typename GridImp::template Codim<0>::Geometry Geometry;
409
410 typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;
411
412 // type of global coordinate
413 typedef typename Geometry::GlobalCoordinate GlobalCoordinate;
414
415 // ctype
416 typedef typename GridImp::ctype ctype;
417
418 // Grid
419 typedef GridImp Grid;
420
423
426
428 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
429
432
434 using IdType = MMeshImpl::MultiId;
435
437 using VertexStorage = std::array<GlobalCoordinate, dim + 1>;
438
439 MMeshEntity() : isLeaf_(true), mMesh_(nullptr) {}
440
441 MMeshEntity(const GridImp* mMesh, const HostGridEntity& hostEntity)
442 : hostEntity_(hostEntity), isLeaf_(true), mMesh_(mMesh) {}
443
444 MMeshEntity(const GridImp* mMesh, HostGridEntity&& hostEntity)
445 : hostEntity_(std::move(hostEntity)), isLeaf_(true), mMesh_(mMesh) {}
446
447 MMeshEntity(const GridImp* mMesh, const HostGridEntity& hostEntity,
448 const IdType& id)
449 : hostEntity_(hostEntity), id_(id), isLeaf_(false), mMesh_(mMesh) {}
450
451 MMeshEntity(const GridImp* mMesh, const VertexStorage& vertex)
452 : id_(/*caching id*/ IdType(
453 {std::size_t(-4), std::size_t(-3), std::size_t(-2)})),
454 isLeaf_(false),
455 mMesh_(mMesh),
456 vertex_(vertex) {}
457
458 MMeshEntity(const MMeshEntity& original)
459 : hostEntity_(original.hostEntity_),
460 id_(original.id_),
461 isLeaf_(original.isLeaf_),
462 mMesh_(original.mMesh_),
463 vertex_(original.vertex_) {}
464
465 MMeshEntity(MMeshEntity&& original)
466 : hostEntity_(std::move(original.hostEntity_)),
467 id_(original.id_),
468 isLeaf_(original.isLeaf_),
469 mMesh_(original.mMesh_),
470 vertex_(original.vertex_) {}
471
472 MMeshEntity& operator=(const MMeshEntity& original) {
473 if (this != &original) {
474 mMesh_ = original.mMesh_;
475 hostEntity_ = original.hostEntity_;
476 isLeaf_ = original.isLeaf_;
477 id_ = original.id_;
478 vertex_ = original.vertex_;
479 }
480 return *this;
481 }
482
483 MMeshEntity& operator=(MMeshEntity&& original) {
484 if (this != &original) {
485 mMesh_ = original.mMesh_;
486 hostEntity_ = std::move(original.hostEntity_);
487 isLeaf_ = original.isLeaf_;
488 id_ = original.id_;
489 vertex_ = original.vertex_;
490 }
491 return *this;
492 }
493
495 bool equals(const MMeshEntity& other) const {
496 return hostEntity_ == other.hostEntity_;
497 }
498
500 bool operator==(const MMeshEntity& other) const {
501 return this->equals(other);
502 }
503
505 bool operator<(const MMeshEntity& other) const {
506 return hostEntity_ < other.hostEntity_;
507 }
508
511 DUNE_THROW(InvalidStateException,
512 "MMesh entities do no have a father, but a connectedComponent "
513 "instead!");
514 return *this;
515 }
516
518 bool hasFather() const { return false; }
519
520 /* \brief Returns the connected component
521 */
522 const ConnectedComponent& connectedComponent() const {
523 assert(isNew() == true);
524 return mMesh_->getConnectedComponent(*this);
525 }
526
528 const bool isNew() const { return hostEntity_->info().isNew; }
529
531 void setIsNew(bool isNew) const { hostEntity_->info().isNew = isNew; }
532
534 const bool mightVanish() const { return hostEntity_->info().mightVanish; }
535
537 void setWillVanish(bool mightVanish) const {
538 hostEntity_->info().mightVanish = mightVanish;
539 }
540
542 void mark(int refCount) const { hostEntity_->info().mark = refCount; }
543
545 int getMark() const { return hostEntity_->info().mark; }
546
548 EntitySeed seed() const { return EntitySeed(hostEntity_); }
549
551 int level() const {
552 // we only have one level
553 return 0;
554 }
555
557 PartitionType partitionType() const {
558 // for caching entities
559 if (hostEntity_ == decltype(hostEntity_)()) return InteriorEntity;
560
561 const auto& ph = mMesh_->partitionHelper();
562 return ph.partitionType(hostEntity_->info().partition);
563 }
564
566 Geometry geometry() const {
567 if (isLeaf_)
568 return Geometry(hostEntity_);
569 else
570 return Geometry(this->vertex_);
571 }
572
573 void bindFather(const EntityType& father) { father_ = &father; }
574
577 LocalGeometry geometryInFather() const {
578 if constexpr (dim != 2)
579 DUNE_THROW(NotImplemented, "geometryInFather() for dim != 2");
580 else {
581 assert(father_ != nullptr);
582
583 auto thisPoints = this->vertex_;
584
585 if (isLeaf_)
586 for (int i = 0; i < 3; ++i) thisPoints[i] = geometry().corner(i);
587
588 std::array<GlobalCoordinate, 3> local;
589 for (int i = 0; i < 3; ++i)
590 local[i] = father_->impl().geometry().local(thisPoints[i]);
591
592 return LocalGeometry(local);
593 }
594 }
595
597 unsigned int subEntities(unsigned int cc) const {
598 return MMeshImpl::ref<dim>().size(cc);
599 }
600
604 template <int cc>
605 std::enable_if_t<cc == 0, typename GridImp::template Codim<cc>::Entity>
606 subEntity(unsigned int i) const {
607 assert(i < subEntities(cc));
608 return *this;
609 }
610
611 template <int cc>
612 std::enable_if_t<cc == dim, typename GridImp::template Codim<cc>::Entity>
613 subEntity(unsigned int i) const {
614 assert(i < subEntities(cc));
615 if (hostEntity_ != HostGridEntity()) {
616 const auto i0 = cgalIndex(i);
617 return MMeshEntity<cc, dim, GridImp>(mMesh_, hostEntity_->vertex(i0));
618 } else {
619 auto vh = mMesh_->getHostGrid().infinite_vertex();
620 // TODO should distinguish for different i
621 return MMeshEntity<cc, dim, GridImp>(mMesh_, vh);
622 }
623 }
624
625 template <int cc>
626 std::enable_if_t<cc == 1, typename GridImp::template Codim<cc>::Entity>
627 subEntity(unsigned int i) const {
628 assert(i < subEntities(cc));
629 auto second = MMeshImpl::duneFacetToCgalSecond<dim>(i, cgalIndex());
630 return MMeshEntity<cc, dim, GridImp>(
631 mMesh_,
632 typename GridImp::template HostGridEntity<1>(hostEntity_, second));
633 }
634
635 template <int cc>
636 std::enable_if_t<cc == 2 && dim == 3,
637 typename GridImp::template Codim<cc>::Entity>
638 subEntity(unsigned int i) const {
639 assert(i < subEntities(cc));
640
641 const auto i0 = cgalIndex(MMeshImpl::ref<dim>().subEntity(i, 2, 0, 3));
642 const auto i1 = cgalIndex(MMeshImpl::ref<dim>().subEntity(i, 2, 1, 3));
643
644 return MMeshEntity<cc, dim, GridImp>(
645 mMesh_,
646 typename GridImp::template HostGridEntity<2>(hostEntity_, i0, i1));
647 }
648
651 return MMeshLeafIntersectionIterator<GridImp>(mMesh_, hostEntity_);
652 }
653
656 return MMeshLeafIntersectionIterator<GridImp>(mMesh_, hostEntity_, true);
657 }
658
661 return ileafbegin();
662 }
663
665 return ileafend();
666 }
667
670 return MMeshHierarchicIterator<GridImp>(mMesh_, *this, maxlevel);
671 }
672
675 return MMeshHierarchicIterator<GridImp>(mMesh_, *this, maxlevel, true);
676 }
677
679 bool isLeaf() const { return isLeaf_ && !isNew(); }
680
682 bool wasRefined() const { return false; }
683
685 bool mightBeCoarsened() const { return false; }
686
688 GeometryType type() const { return GeometryTypes::simplex(dim); }
689
691 std::size_t domainMarker() const { return hostEntity_->info().domainMarker; }
692
694 const HostGridEntity& hostEntity() const { return hostEntity_; }
695
697 HostGridEntity& hostEntity() { return hostEntity_; }
698
700 const GridImp& grid() const { return *mMesh_; }
701
703 IdType id() const {
704 // cache id
705 if (id_ == IdType()) {
706 typename IdType::VT idlist(dim + 1);
707 for (std::size_t i = 0; i < this->subEntities(dim); ++i)
708 idlist[i] = hostEntity_->vertex(i)->info().id;
709 std::sort(idlist.begin(), idlist.end());
710 id_ = IdType(idlist);
711 }
712
713 return id_;
714 }
715
716 private:
718 const auto& cgalIndex(const std::size_t& i) const {
719 return hostEntity_->info().cgalIndex[i];
720 }
721
723 const auto& cgalIndex() const { return hostEntity_->info().cgalIndex; }
724
726 HostGridEntity hostEntity_;
727
729 mutable IdType id_;
730
732 bool isLeaf_;
733
735 const GridImp* mMesh_;
736
737 protected:
740
741 const EntityType* father_;
742
743}; // end of MMeshEntity codim = 0
744
745} // namespace Dune
746
748
749#endif
The implementation of a connected component of entities in MMeshThe connected component stores a list...
Definition: connectedcomponent.hh:33
void mark(int refCount) const
mark entity for refine or coarse
Definition: entity.hh:542
GridImp::template Codim< 0 >::EntitySeed EntitySeed
The type of the EntitySeed interface class.
Definition: entity.hh:428
void setWillVanish(bool mightVanish) const
set if this entity will vanish after adaptation
Definition: entity.hh:537
MMeshLeafIntersectionIterator< GridImp > ileafbegin() const
First leaf intersection.
Definition: entity.hh:650
PartitionType partitionType() const
The partition type for parallel computing.
Definition: entity.hh:557
bool operator<(const MMeshEntity &other) const
returns true if host entities are equal
Definition: entity.hh:505
bool isLeaf() const
returns true if Entity has no children
Definition: entity.hh:679
const GridImp & grid() const
Return the host grid.
Definition: entity.hh:700
LocalGeometry geometryInFather() const
Definition: entity.hh:577
int getMark() const
get mark of entity
Definition: entity.hh:545
MMeshLeafIntersectionIterator< GridImp > ileafend() const
Reference to one past the last leaf intersection.
Definition: entity.hh:655
MMeshImpl::MultiId IdType
define the type used for persistent indices
Definition: entity.hh:434
const bool isNew() const
returns true if this entity is new after adaptation
Definition: entity.hh:528
const bool mightVanish() const
returns true if this entity will vanish after adaptation
Definition: entity.hh:534
int level() const
Level of this element.
Definition: entity.hh:551
std::size_t domainMarker() const
Return domain marker of entity.
Definition: entity.hh:691
IdType id() const
Return id computed by vertex ids.
Definition: entity.hh:703
bool equals(const MMeshEntity &other) const
returns true if host entities are equal
Definition: entity.hh:495
VertexStorage vertex_
the vertices of the host entity object of this entity (for caching entity)
Definition: entity.hh:739
bool wasRefined() const
returns if grid was refined
Definition: entity.hh:682
Geometry geometry() const
Geometry of this entity.
Definition: entity.hh:566
unsigned int subEntities(unsigned int cc) const
Return the number of subEntities of codimension cc.
Definition: entity.hh:597
std::array< GlobalCoordinate, dim+1 > VertexStorage
define the type used for storage the vertices of a caching entity
Definition: entity.hh:437
bool operator==(const MMeshEntity &other) const
returns true if host entities are equal
Definition: entity.hh:500
MMeshLeafIntersectionIterator< GridImp > ilevelbegin() const
We only have one level.
Definition: entity.hh:660
GeometryType type() const
returns the geometry type
Definition: entity.hh:688
bool mightBeCoarsened() const
returns if grid might be coarsened
Definition: entity.hh:685
MMeshHierarchicIterator< GridImp > hbegin(int maxlevel) const
First hierarchic entity, i.e. this entity, because we only have one level.
Definition: entity.hh:669
EntitySeed seed() const
Create EntitySeed.
Definition: entity.hh:548
MMeshEntity father() const
returns the father entity
Definition: entity.hh:510
const HostGridEntity & hostEntity() const
Return the host entity.
Definition: entity.hh:694
HostGridEntity & hostEntity()
Return the host entity.
Definition: entity.hh:697
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:518
void setIsNew(bool isNew) const
set if this entity is new after adaptation
Definition: entity.hh:531
MMeshHierarchicIterator< GridImp > hend(int maxlevel) const
Reference to one past the last hierarchic entity.
Definition: entity.hh:674
std::enable_if_t< cc==0, typename GridImp::template Codim< cc >::Entity > subEntity(unsigned int i) const
Provide access to sub entity i of given codimension. Entities are numbered 0 ... subEntities(cc)-1.
Definition: entity.hh:606
The implementation of entities in a MMesh.
Definition: entity.hh:50
GridImp::template Codim< codim >::Geometry Geometry
The type of the Geometry interface class.
Definition: entity.hh:76
std::enable_if_t< cd !=dim, std::size_t > insertionLevel() const
Definition: entity.hh:308
std::enable_if_t< codim==dim &&cc==dim, typename GridImp::template Codim< dim >::Entity > subEntity(unsigned int i) const
Obtain a cc dim subEntity of a codim dim entity.
Definition: entity.hh:221
std::enable_if_t< codim==2 &&cc==3, typename GridImp::template Codim< 3 >::Entity > subEntity(unsigned int i) const
Obtain a cc 3 subEntity of a codim 2 entity (only for 3d)
Definition: entity.hh:202
Geometry geometry() const
geometry of this entity
Definition: entity.hh:335
std::enable_if_t< codim==1 &&cc==dim, typename GridImp::template Codim< dim >::Entity > subEntity(unsigned int i) const
Obtain a cc dim subEntity of a codim 1 entity.
Definition: entity.hh:185
GridImp::template Codim< codim >::EntitySeed EntitySeed
The type of the EntitySeed interface class.
Definition: entity.hh:79
const GridImp & grid() const
returns the grid
Definition: entity.hh:347
const HostGridEntity & hostEntity() const
returns the host entity
Definition: entity.hh:341
std::enable_if_t< codim==dim &&enable, MMeshIncidentVerticesIterator< GridImp > > incidentVerticesBegin(bool includeInfinite) const
First incident vertex.
Definition: entity.hh:281
unsigned int subEntities(unsigned int cc) const
Return the number of subEntities of codimension codim.
Definition: entity.hh:168
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:147
bool isInterface() const
Return if vertex is part of the interface.
Definition: entity.hh:318
std::enable_if_t< cd==dim, std::size_t > insertionLevel() const
Return insertion level of vertex.
Definition: entity.hh:301
int boundaryFlag() const
Definition: entity.hh:327
EntitySeed seed() const
Return entity seed.
Definition: entity.hh:150
std::enable_if_t< codim==dim &&enable, MMeshIncidentVerticesIterator< GridImp > > incidentVerticesEnd(bool includeInfinite) const
Last incident vertex.
Definition: entity.hh:292
std::enable_if_t< codim==dim &&enable, MMeshIncidentIterator< GridImp > > incidentBegin() const
First incident element.
Definition: entity.hh:229
std::enable_if_t< codim==dim &&enable, MMeshIncidentFacetsIterator< GridImp > > incidentFacetsEnd() const
Last incident facet.
Definition: entity.hh:271
IdType id() const
returns id computed by vertex ids
Definition: entity.hh:350
std::enable_if_t< codim==dim &&enable, MMeshIncidentFacetsIterator< GridImp > > incidentFacetsBegin() const
First incident facet.
Definition: entity.hh:263
std::enable_if_t< codim==dim - 1 &&enable, MMeshEdgeIncidentIterator< GridImp > > incidentEnd() const
Last incident element.
Definition: entity.hh:255
HostGridEntity & hostEntity()
returns the host entity
Definition: entity.hh:344
std::enable_if_t< codim==dim - 1 &&enable, MMeshEdgeIncidentIterator< GridImp > > incidentBegin() const
First incident element.
Definition: entity.hh:246
GeometryType type() const
returns the geometry type
Definition: entity.hh:338
std::enable_if_t< codim==dim &&enable, MMeshIncidentIterator< GridImp > > incidentEnd() const
Last incident element.
Definition: entity.hh:237
PartitionType partitionType() const
The partition type for parallel computing.
Definition: entity.hh:159
int level() const
level of this element
Definition: entity.hh:153
Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
Definition: hierarchiciterator.hh:22
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: intersectioniterator.hh:28
The MMeshCachingEntity class.
The MMeshConnectedComponent class.
The MMeshIncidentIterator class.
EntityIterator< Grid::dimension, Grid, MMeshIncidentVerticesIteratorImp< Grid, Grid::dimensionworld > > MMeshIncidentVerticesIterator
The Incident Facets Iterator alias.
Definition: incidentiterator.hh:51
EntityIterator< 0, Grid, MMeshEdgeIncidentIteratorImp< Grid, Grid::dimension > > MMeshEdgeIncidentIterator
The Incident Entity Iterator alias for edges.
Definition: incidentiterator.hh:31
EntityIterator< 0, Grid, MMeshIncidentIteratorImp< Grid, Grid::dimension > > MMeshIncidentIterator
The Incident Entity Iterator alias.
Definition: incidentiterator.hh:21
EntityIterator< 1, Grid, MMeshIncidentFacetsIteratorImp< Grid, Grid::dimension > > MMeshIncidentFacetsIterator
The Incident Facets Iterator alias.
Definition: incidentiterator.hh:41
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Mar 16, 23:47, 2025)