Loading [MathJax]/extensions/MathMenu.js

dune-mmesh (1.4)

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>
12
13namespace Dune
14{
15 // Forward declarations
16 template<int codim, int dim, class GridImp>
17 class MMeshEntity;
18}
19
20
21// MMesh includes
23#include <dune/mmesh/grid/polygoncutting.hh>
24#include <dune/mmesh/misc/partitionhelper.hh>
25
26namespace Dune
27{
28 template<class GridImp>
29 class MMeshLeafIntersectionIterator;
30
31 template<class GridImp>
32 class MMeshHierarchicIterator;
33
34 // External forward declarations
35 template< class Grid >
36 struct HostGridAccess;
37
38
39 //**********************************************************************
40 //
41 // --MMeshEntity
42 // --Entity
43 //
48 template<int codim, int dim, class GridImp>
50#ifndef DOXYGEN_SHOULD_SKIP_THIS
51 : public EntityDefaultImplementation <codim,dim,GridImp,MMeshEntity>
52#endif /* DOXYGEN_SHOULD_SKIP_THIS */
53 {
54 template <class GridImp_>
55 friend class MMeshLeafIndexSet;
56
57 template <class GridImp_>
58 friend class MMeshLocalIdSet;
59
60 template <class GridImp_>
61 friend class MMeshGlobalIdSet;
62
63 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
64
66 using IdType = MMeshImpl::MultiId;
67
68 private:
69 typedef typename GridImp::ctype ctype;
70
71 // The equivalent entity in the host grid
72 typedef typename GridImp::template HostGridEntity<codim> HostGridEntity;
73
75 typedef typename GridImp::template Codim<codim>::Entity Entity;
76
77 public:
79 typedef typename GridImp::template Codim<codim>::Geometry Geometry;
80
82 typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;
83
85 : mMesh_(nullptr)
86 {}
87
88 MMeshEntity(const GridImp* mMesh, const HostGridEntity& hostEntity)
89 : hostEntity_(hostEntity)
90 , mMesh_(mMesh)
91 {}
92
93 MMeshEntity(const GridImp* mMesh, HostGridEntity&& hostEntity)
94 : hostEntity_(std::move(hostEntity))
95 , mMesh_(mMesh)
96 {}
97
98 MMeshEntity(const MMeshEntity& original)
99 : hostEntity_(original.hostEntity_)
100 , mMesh_(original.mMesh_)
101 {}
102
103 MMeshEntity(MMeshEntity&& original)
104 : hostEntity_(std::move(original.hostEntity_))
105 , mMesh_(original.mMesh_)
106 {}
107
108 MMeshEntity& operator=(const MMeshEntity& original)
109 {
110 if (this != &original)
111 {
112 mMesh_ = original.mMesh_;
113 hostEntity_ = original.hostEntity_;
114 }
115 return *this;
116 }
117
118 MMeshEntity& operator=(MMeshEntity&& original)
119 {
120 if (this != &original)
121 {
122 mMesh_ = original.mMesh_;
123 hostEntity_ = std::move(original.hostEntity_);
124 }
125 return *this;
126 }
127
128 // Comparator for vertices
129 template <int cc = codim>
130 std::enable_if_t< cc == dim, bool >
131 equals(const MMeshEntity& other) const
132 {
133 return hostEntity_ == other.hostEntity_;
134 }
135
136 // Comparator for edges
137 template <int cc = codim>
138 std::enable_if_t< cc == 1 && dim == 2, bool >
139 equals(const MMeshEntity& other) const
140 {
141 return (hostEntity_ == other.hostEntity_)
142 || ( mMesh_->getHostGrid().mirror_edge( hostEntity_ ) == other.hostEntity_ );
143 }
144
145 // Comparator for facets
146 template <int cc = codim>
147 std::enable_if_t< cc == 1 && dim == 3, bool >
148 equals(const MMeshEntity& other) const
149 {
150 return (hostEntity_ == other.hostEntity_)
151 || ( hostEntity_ == mMesh_->getHostGrid().mirror_facet( other.hostEntity_ ) );
152 }
153
154 // Comparator for edges in 3d
155 template <int cc = codim>
156 std::enable_if_t< cc == 2 && dim == 3, bool >
157 equals(const MMeshEntity& other) const
158 {
159 const auto& v0 = hostEntity_.first->vertex( hostEntity_.second );
160 const auto& v1 = hostEntity_.first->vertex( hostEntity_.third );
161 const auto& w0 = other.hostEntity_.first->vertex( other.hostEntity_.second );
162 const auto& w1 = other.hostEntity_.first->vertex( other.hostEntity_.third );
163 return (v0 == w0 && v1 == w1) || (v0 == w1 && v1 == w0);
164 }
165
167 bool hasFather () const {
168 return false;
169 }
170
173 {
174 return EntitySeed( hostEntity_ );
175 }
176
178 int level () const {
179 // we only have one level
180 return 0;
181 }
182
184 PartitionType partitionType () const
185 {
186 const auto& ph = mMesh_->partitionHelper();
187 if constexpr (codim == 0 || codim == dim)
188 return ph.partitionType( hostEntity_->info().partition );
189 else
190 return ph.partitionType( grid().entity(hostEntity_) );
191 }
192
194 unsigned int subEntities (unsigned int cc) const
195 {
196 // we have a simplex grid
197 int n = dim-codim+1;
198 int k = dim-cc+1;
199
200 // binomial: n over k
201 int binomial=1;
202 for (int i=n-k+1; i<=n; i++)
203 binomial *= i;
204 for (long i=2; i<=k; i++)
205 binomial /= i;
206
207 return binomial;
208 }
209
211 template <int cc>
212 std::enable_if_t< codim == 1 && cc == dim, typename GridImp::template Codim<dim>::Entity >
213 subEntity (unsigned int i) const
214 {
215 assert( i < subEntities( cc ) );
216 const auto& cell = hostEntity_.first;
217 auto facetIdx = MMeshImpl::cgalFacetToDuneFacet<dim, HostGridEntity>( hostEntity_ );
218 const auto i0 = cgalIndex( MMeshImpl::ref<dim>().subEntity(facetIdx, 1, i, dim) );
219
221 mMesh_,
222 typename GridImp::template HostGridEntity<dim> (
223 cell->vertex( i0 )
224 )
225 );
226 }
227
229 template <int cc>
230 std::enable_if_t< codim == 2 && cc == 3, typename GridImp::template Codim<3>::Entity >
231 subEntity (unsigned int i) const
232 {
233 assert( i < subEntities( cc ) );
234 const auto& cell = hostEntity_.first;
235
236 auto edgeIdx = MMeshImpl::cgalEdgeToDuneEdge<3, HostGridEntity>( hostEntity_ );
237
238 const auto i0 = cgalIndex( MMeshImpl::ref<dim>().subEntity(edgeIdx, 2, i, 3) );
239
241 mMesh_,
242 typename GridImp::template HostGridEntity<dim> (
243 cell->vertex( i0 )
244 )
245 );
246 }
247
249 template <int cc>
250 std::enable_if_t< codim == dim && cc == dim, typename GridImp::template Codim<dim>::Entity >
251 subEntity (unsigned int i) const
252 {
253 assert( i < subEntities( cc ) );
255 mMesh_,
256 hostEntity_
257 );
258 }
259
261 template <bool enable = true>
262 std::enable_if_t< codim == dim && enable, MMeshIncidentIterator<GridImp> >
263 incidentBegin () const {
265 return MMeshIncidentIterator<GridImp>( Impl( mMesh_, hostEntity_) );
266 }
267
269 template <bool enable = true>
270 std::enable_if_t< codim == dim && enable, MMeshIncidentIterator<GridImp> >
271 incidentEnd () const {
273 return MMeshIncidentIterator<GridImp>( Impl( mMesh_, hostEntity_, true ) );
274 }
275
277 template <bool enable = true>
278 std::enable_if_t< codim == dim-1 && enable, MMeshEdgeIncidentIterator<GridImp> >
279 incidentBegin () const {
281 return MMeshEdgeIncidentIterator<GridImp>( Impl( mMesh_, hostEntity_) );
282 }
283
285 template <bool enable = true>
286 std::enable_if_t< codim == dim-1 && enable, MMeshEdgeIncidentIterator<GridImp> >
287 incidentEnd () const {
289 return MMeshEdgeIncidentIterator<GridImp>( Impl( mMesh_, hostEntity_, true ) );
290 }
291
293 template <bool enable = true>
294 std::enable_if_t< codim == dim && enable, MMeshIncidentFacetsIterator<GridImp> >
297 return MMeshIncidentFacetsIterator<GridImp>( Impl( mMesh_, hostEntity_) );
298 }
299
301 template <bool enable = true>
302 std::enable_if_t< codim == dim && enable, MMeshIncidentFacetsIterator<GridImp> >
305 return MMeshIncidentFacetsIterator<GridImp>( Impl( mMesh_, hostEntity_, true ) );
306 }
307
309 template <bool enable = true>
310 std::enable_if_t< codim == dim && enable, MMeshIncidentVerticesIterator<GridImp>>
311 incidentVerticesBegin ( bool includeInfinite ) const {
313 return MMeshIncidentVerticesIterator<GridImp>( Impl( mMesh_, hostEntity_, includeInfinite) );
314 }
315
317 template <bool enable = true>
318 std::enable_if_t< codim == dim && enable, MMeshIncidentVerticesIterator<GridImp>>
319 incidentVerticesEnd ( bool includeInfinite ) const {
321 return MMeshIncidentVerticesIterator<GridImp>( Impl( mMesh_, hostEntity_, includeInfinite, true ) );
322 }
323
325 template <int cd = codim>
326 std::enable_if_t< cd == dim, std::size_t >
328 {
329 if ( codim == dim )
330 return hostEntity_->info().insertionLevel;
331 }
332
334 template <int cd = codim>
335 std::enable_if_t< cd != dim, std::size_t >
337 {
338 std::size_t insertionLevel = 0;
339 for( std::size_t i = 0; i < subEntities(dim); ++i )
340 insertionLevel = std::max( insertionLevel, this->template subEntity<dim>(i).impl().insertionLevel() );
341 return insertionLevel;
342 }
343
345 bool isInterface() const
346 {
347 if constexpr( codim == dim )
348 return hostEntity_->info().isInterface;
349 else
350 DUNE_THROW( NotImplemented, "isInterface for codim != dim" );
351 }
352
354 int boundaryFlag() const
355 {
356 if constexpr( codim == dim )
357 return hostEntity_->info().boundaryFlag;
358 else
359 DUNE_THROW( NotImplemented, "boudnaryFlag for codim != dim" );
360 }
361
364 {
365 return Geometry( hostEntity_ );
366 }
367
369 GeometryType type () const
370 {
371 return GeometryTypes::simplex(dim-codim);
372 }
373
375 const HostGridEntity& hostEntity () const
376 {
377 return hostEntity_;
378 }
379
381 HostGridEntity& hostEntity ()
382 {
383 return hostEntity_;
384 }
385
387 const GridImp& grid () const
388 {
389 return *mMesh_;
390 }
391
393 IdType id() const
394 {
395 // cache id
396 if (id_ == IdType())
397 {
398 typename IdType::VT idlist( dim+1-codim );
399 for( std::size_t i = 0; i < this->subEntities(dim); ++i )
400 idlist[i] = this->template subEntity<dim>(i).impl().hostEntity()->info().id;
401 std::sort( idlist.begin(), idlist.end() );
402 id_ = IdType( idlist );
403 }
404
405 return id_;
406 }
407
408 private:
409
411 const auto cgalIndex ( const std::size_t& i ) const
412 {
413 if constexpr( codim != dim )
414 return hostEntity_.first->info().cgalIndex[i];
415 else
416 {
417 DUNE_THROW( NotImplemented, "cgalIndex(i) for codim != dim");
418 return 0;
419 }
420 }
421
422
424 mutable IdType id_;
425
427 HostGridEntity hostEntity_;
428
430 const GridImp* mMesh_;
431 };
432
433
434 //***********************
435 //
436 // --MMeshEntity
437 //
438 //***********************
443 template<int dim, class GridImp>
444 class MMeshEntity<0,dim,GridImp>
445#ifndef DOXYGEN_SHOULD_SKIP_THIS
446 : public EntityDefaultImplementation<0,dim,GridImp, MMeshEntity>
447#endif /* DOXYGEN_SHOULD_SKIP_THIS */
448 {
449 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
450
451 typedef Entity< 0, dim, GridImp, MMeshEntity > EntityType;
452
453 public:
454 // equivalent entity in the host grid
455 typedef typename GridImp::template HostGridEntity<0> HostGridEntity;
456
457 typedef typename GridImp::template Codim<0>::Geometry Geometry;
458
459 typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;
460
461 // type of global coordinate
462 typedef typename Geometry::GlobalCoordinate GlobalCoordinate;
463
464 // ctype
465 typedef typename GridImp::ctype ctype;
466
467 // Grid
468 typedef GridImp Grid;
469
472
475
477 typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
478
481
483 using IdType = MMeshImpl::MultiId;
484
486 using VertexStorage = std::array<GlobalCoordinate, dim+1>;
487
489 : isLeaf_(true), mMesh_(nullptr)
490 {}
491
492 MMeshEntity(const GridImp* mMesh, const HostGridEntity& hostEntity)
493 : hostEntity_(hostEntity), isLeaf_(true)
494 , mMesh_(mMesh)
495 {}
496
497 MMeshEntity(const GridImp* mMesh, HostGridEntity&& hostEntity)
498 : hostEntity_(std::move(hostEntity)), isLeaf_(true)
499 , mMesh_(mMesh)
500 {}
501
502 MMeshEntity(const GridImp* mMesh, const HostGridEntity& hostEntity, const IdType& id)
503 : hostEntity_(hostEntity)
504 , id_(id), isLeaf_(false)
505 , mMesh_(mMesh)
506 {}
507
508 MMeshEntity(const GridImp* mMesh, const VertexStorage& vertex)
509 : id_( /*caching id*/ IdType({ std::size_t(-4), std::size_t(-3), std::size_t(-2) }) ), isLeaf_(false), mMesh_(mMesh), vertex_(vertex)
510 {}
511
512 MMeshEntity(const MMeshEntity& original)
513 : hostEntity_(original.hostEntity_), id_(original.id_), isLeaf_(original.isLeaf_)
514 , mMesh_(original.mMesh_), vertex_(original.vertex_)
515 {}
516
517 MMeshEntity(MMeshEntity&& original)
518 : hostEntity_(std::move(original.hostEntity_)), id_(original.id_), isLeaf_(original.isLeaf_)
519 , mMesh_(original.mMesh_), vertex_(original.vertex_)
520 {}
521
522 MMeshEntity& operator=(const MMeshEntity& original)
523 {
524 if (this != &original)
525 {
526 mMesh_ = original.mMesh_;
527 hostEntity_ = original.hostEntity_;
528 isLeaf_ = original.isLeaf_;
529 id_ = original.id_;
530 vertex_ = original.vertex_;
531 }
532 return *this;
533 }
534
535 MMeshEntity& operator=(MMeshEntity&& original)
536 {
537 if (this != &original)
538 {
539 mMesh_ = original.mMesh_;
540 hostEntity_ = std::move(original.hostEntity_);
541 isLeaf_ = original.isLeaf_;
542 id_ = original.id_;
543 vertex_ = original.vertex_;
544 }
545 return *this;
546 }
547
549 bool equals(const MMeshEntity& other) const
550 {
551 return hostEntity_ == other.hostEntity_;
552 }
553
555 bool operator==(const MMeshEntity& other) const
556 {
557 return this->equals(other);
558 }
559
561 bool operator<(const MMeshEntity& other) const
562 {
563 return hostEntity_ < other.hostEntity_;
564 }
565
568 {
569 DUNE_THROW( InvalidStateException, "MMesh entities do no have a father, but a connectedComponent instead!" );
570 return *this;
571 }
572
574 bool hasFather () const
575 {
576 return false;
577 }
578
579 /* \brief Returns the connected component
580 */
581 const ConnectedComponent& connectedComponent () const
582 {
583 assert( isNew() == true );
584 return mMesh_->getConnectedComponent(*this);
585 }
586
588 const bool isNew () const
589 {
590 return hostEntity_->info().isNew;
591 }
592
594 void setIsNew ( bool isNew ) const
595 {
596 hostEntity_->info().isNew = isNew;
597 }
598
600 const bool mightVanish () const
601 {
602 return hostEntity_->info().mightVanish;
603 }
604
606 void setWillVanish ( bool mightVanish ) const
607 {
608 hostEntity_->info().mightVanish = mightVanish;
609 }
610
612 void mark ( int refCount ) const
613 {
614 hostEntity_->info().mark = refCount;
615 }
616
618 int getMark () const
619 {
620 return hostEntity_->info().mark;
621 }
622
625 {
626 return EntitySeed(hostEntity_);
627 }
628
630 int level () const
631 {
632 // we only have one level
633 return 0;
634 }
635
637 PartitionType partitionType () const
638 {
639 // for caching entities
640 if (hostEntity_ == decltype(hostEntity_)())
641 return InteriorEntity;
642
643 const auto& ph = mMesh_->partitionHelper();
644 return ph.partitionType( hostEntity_->info().partition );
645 }
646
648 Geometry geometry () const
649 {
650 if (isLeaf_)
651 return Geometry( hostEntity_ );
652 else
653 return Geometry( this->vertex_ );
654 }
655
656 void bindFather( const EntityType& father )
657 {
658 father_ = &father;
659 }
660
662 LocalGeometry geometryInFather() const
663 {
664 if constexpr( dim != 2 )
665 DUNE_THROW(NotImplemented, "geometryInFather() for dim != 2");
666 else
667 {
668 assert( father_ != nullptr );
669
670 auto thisPoints = this->vertex_;
671
672 if( isLeaf_ )
673 for ( int i = 0; i < 3; ++i )
674 thisPoints[i] = geometry().corner(i);
675
676 std::array< GlobalCoordinate, 3 > local;
677 for ( int i = 0; i < 3; ++i )
678 local[i] = father_->impl().geometry().local( thisPoints[i] );
679
680 return LocalGeometry( local );
681 }
682 }
683
685 unsigned int subEntities (unsigned int cc) const
686 {
687 return MMeshImpl::ref<dim>().size(cc);
688 }
689
693 template <int cc>
694 std::enable_if_t< cc == 0, typename GridImp::template Codim<cc>::Entity >
695 subEntity (unsigned int i) const {
696 assert( i < subEntities( cc ) );
697 return *this;
698 }
699
700 template <int cc>
701 std::enable_if_t< cc == dim, typename GridImp::template Codim<cc>::Entity >
702 subEntity (unsigned int i) const {
703 assert( i < subEntities( cc ) );
704 if (hostEntity_ != HostGridEntity())
705 {
706 const auto i0 = cgalIndex( i );
707 return MMeshEntity<cc, dim, GridImp>( mMesh_, hostEntity_->vertex( i0 ) );
708 }
709 else {
710 auto vh = mMesh_->getHostGrid().infinite_vertex();
711 // TODO should distinguish for different i
712 return MMeshEntity<cc, dim, GridImp>( mMesh_, vh );
713 }
714 }
715
716 template <int cc>
717 std::enable_if_t< cc == 1, typename GridImp::template Codim<cc>::Entity >
718 subEntity (unsigned int i) const {
719 assert( i < subEntities( cc ) );
720 auto second = MMeshImpl::duneFacetToCgalSecond<dim>( i, cgalIndex() );
721 return MMeshEntity<cc, dim, GridImp> ( mMesh_, typename GridImp::template HostGridEntity<1> ( hostEntity_, second ) );
722 }
723
724 template <int cc>
725 std::enable_if_t< cc == 2 && dim == 3, typename GridImp::template Codim<cc>::Entity >
726 subEntity (unsigned int i) const {
727 assert( i < subEntities( cc ) );
728
729 const auto i0 = cgalIndex( MMeshImpl::ref<dim>().subEntity(i, 2, 0, 3) );
730 const auto i1 = cgalIndex( MMeshImpl::ref<dim>().subEntity(i, 2, 1, 3) );
731
732 return MMeshEntity<cc, dim, GridImp> ( mMesh_, typename GridImp::template HostGridEntity<2> ( hostEntity_, i0, i1 ) );
733 }
734
738 mMesh_,
739 hostEntity_);
740 }
741
745 mMesh_,
746 hostEntity_,
747 true);
748 }
749
752 return ileafbegin();
753 }
754
755 MMeshLeafIntersectionIterator<GridImp> ilevelend () const {
756 return ileafend();
757 }
758
762 mMesh_,
763 *this,
764 maxlevel);
765 }
766
770 mMesh_,
771 *this,
772 maxlevel,
773 true);
774 }
775
777 bool isLeaf() const {
778 return isLeaf_ && !isNew();
779 }
780
782 bool wasRefined () const
783 {
784 return false;
785 }
786
788 bool mightBeCoarsened () const
789 {
790 return false;
791 }
792
794 GeometryType type () const
795 {
796 return GeometryTypes::simplex(dim);
797 }
798
800 std::size_t domainMarker() const
801 {
802 return hostEntity_->info().domainMarker;
803 }
804
806 const HostGridEntity& hostEntity () const
807 {
808 return hostEntity_;
809 }
810
812 HostGridEntity& hostEntity ()
813 {
814 return hostEntity_;
815 }
816
818 const GridImp& grid () const
819 {
820 return *mMesh_;
821 }
822
824 IdType id() const
825 {
826 // cache id
827 if (id_ == IdType())
828 {
829 typename IdType::VT idlist( dim+1 );
830 for( std::size_t i = 0; i < this->subEntities(dim); ++i )
831 idlist[i] = hostEntity_->vertex(i)->info().id;
832 std::sort( idlist.begin(), idlist.end() );
833 id_ = IdType( idlist );
834 }
835
836 return id_;
837 }
838
839 private:
840
842 const auto& cgalIndex ( const std::size_t& i ) const
843 {
844 return hostEntity_->info().cgalIndex[i];
845 }
846
848 const auto& cgalIndex () const
849 {
850 return hostEntity_->info().cgalIndex;
851 }
852
854 HostGridEntity hostEntity_;
855
857 mutable IdType id_;
858
860 bool isLeaf_;
861
863 const GridImp* mMesh_;
864
865 protected:
868
869 const EntityType* father_;
870
871 }; // end of MMeshEntity codim = 0
872
873} // namespace Dune
874
876
877#endif
The implementation of a connected component of entities in MMeshThe connected component stores a list...
Definition: connectedcomponent.hh:34
void mark(int refCount) const
mark entity for refine or coarse
Definition: entity.hh:612
GridImp::template Codim< 0 >::EntitySeed EntitySeed
The type of the EntitySeed interface class.
Definition: entity.hh:477
void setWillVanish(bool mightVanish) const
set if this entity will vanish after adaptation
Definition: entity.hh:606
MMeshLeafIntersectionIterator< GridImp > ileafbegin() const
First leaf intersection.
Definition: entity.hh:736
PartitionType partitionType() const
The partition type for parallel computing.
Definition: entity.hh:637
bool operator<(const MMeshEntity &other) const
returns true if host entities are equal
Definition: entity.hh:561
bool isLeaf() const
returns true if Entity has no children
Definition: entity.hh:777
const GridImp & grid() const
Return the host grid.
Definition: entity.hh:818
LocalGeometry geometryInFather() const
Geometry of this entity in bounded father entity ( assumption: this \subset father )
Definition: entity.hh:662
int getMark() const
get mark of entity
Definition: entity.hh:618
std::array< GlobalCoordinate, dim+1 > VertexStorage
define the type used for storage the vertices of a caching entity
Definition: entity.hh:486
MMeshLeafIntersectionIterator< GridImp > ileafend() const
Reference to one past the last leaf intersection.
Definition: entity.hh:743
MMeshImpl::MultiId IdType
define the type used for persistent indices
Definition: entity.hh:483
const bool isNew() const
returns true if this entity is new after adaptation
Definition: entity.hh:588
const bool mightVanish() const
returns true if this entity will vanish after adaptation
Definition: entity.hh:600
int level() const
Level of this element.
Definition: entity.hh:630
std::size_t domainMarker() const
Return domain marker of entity.
Definition: entity.hh:800
IdType id() const
Return id computed by vertex ids.
Definition: entity.hh:824
bool equals(const MMeshEntity &other) const
returns true if host entities are equal
Definition: entity.hh:549
VertexStorage vertex_
the vertices of the host entity object of this entity (for caching entity)
Definition: entity.hh:867
bool wasRefined() const
returns if grid was refined
Definition: entity.hh:782
Geometry geometry() const
Geometry of this entity.
Definition: entity.hh:648
unsigned int subEntities(unsigned int cc) const
Return the number of subEntities of codimension cc.
Definition: entity.hh:685
bool operator==(const MMeshEntity &other) const
returns true if host entities are equal
Definition: entity.hh:555
MMeshLeafIntersectionIterator< GridImp > ilevelbegin() const
We only have one level.
Definition: entity.hh:751
GeometryType type() const
returns the geometry type
Definition: entity.hh:794
bool mightBeCoarsened() const
returns if grid might be coarsened
Definition: entity.hh:788
MMeshHierarchicIterator< GridImp > hbegin(int maxlevel) const
First hierarchic entity, i.e. this entity, because we only have one level.
Definition: entity.hh:760
EntitySeed seed() const
Create EntitySeed.
Definition: entity.hh:624
MMeshEntity father() const
returns the father entity
Definition: entity.hh:567
const HostGridEntity & hostEntity() const
Return the host entity.
Definition: entity.hh:806
HostGridEntity & hostEntity()
Return the host entity.
Definition: entity.hh:812
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:574
void setIsNew(bool isNew) const
set if this entity is new after adaptation
Definition: entity.hh:594
MMeshHierarchicIterator< GridImp > hend(int maxlevel) const
Reference to one past the last hierarchic entity.
Definition: entity.hh:768
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:695
The implementation of entities in a MMesh.
Definition: entity.hh:53
std::enable_if_t< codim==dim-1 &&enable, MMeshEdgeIncidentIterator< GridImp > > incidentEnd() const
Last incident element.
Definition: entity.hh:287
GridImp::template Codim< codim >::Geometry Geometry
The type of the Geometry interface class.
Definition: entity.hh:79
std::enable_if_t< cd !=dim, std::size_t > insertionLevel() const
Return insertion level (maximal insertionLevel of the corresponding vertices)
Definition: entity.hh:336
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:251
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:231
Geometry geometry() const
geometry of this entity
Definition: entity.hh:363
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:213
GridImp::template Codim< codim >::EntitySeed EntitySeed
The type of the EntitySeed interface class.
Definition: entity.hh:82
const GridImp & grid() const
returns the grid
Definition: entity.hh:387
const HostGridEntity & hostEntity() const
returns the host entity
Definition: entity.hh:375
std::enable_if_t< codim==dim &&enable, MMeshIncidentVerticesIterator< GridImp > > incidentVerticesBegin(bool includeInfinite) const
First incident vertex.
Definition: entity.hh:311
unsigned int subEntities(unsigned int cc) const
Return the number of subEntities of codimension codim.
Definition: entity.hh:194
bool hasFather() const
returns true if father entity exists
Definition: entity.hh:167
bool isInterface() const
Return if vertex is part of the interface.
Definition: entity.hh:345
std::enable_if_t< cd==dim, std::size_t > insertionLevel() const
Return insertion level of vertex.
Definition: entity.hh:327
std::enable_if_t< codim==dim-1 &&enable, MMeshEdgeIncidentIterator< GridImp > > incidentBegin() const
First incident element.
Definition: entity.hh:279
int boundaryFlag() const
Return boundary flag (-1 = not set, 0 = can be removed, 1 = important for domain boundary)
Definition: entity.hh:354
EntitySeed seed() const
Return entity seed.
Definition: entity.hh:172
std::enable_if_t< codim==dim &&enable, MMeshIncidentVerticesIterator< GridImp > > incidentVerticesEnd(bool includeInfinite) const
Last incident vertex.
Definition: entity.hh:319
std::enable_if_t< codim==dim &&enable, MMeshIncidentIterator< GridImp > > incidentBegin() const
First incident element.
Definition: entity.hh:263
std::enable_if_t< codim==dim &&enable, MMeshIncidentFacetsIterator< GridImp > > incidentFacetsEnd() const
Last incident facet.
Definition: entity.hh:303
IdType id() const
returns id computed by vertex ids
Definition: entity.hh:393
std::enable_if_t< codim==dim &&enable, MMeshIncidentFacetsIterator< GridImp > > incidentFacetsBegin() const
First incident facet.
Definition: entity.hh:295
HostGridEntity & hostEntity()
returns the host entity
Definition: entity.hh:381
GeometryType type() const
returns the geometry type
Definition: entity.hh:369
std::enable_if_t< codim==dim &&enable, MMeshIncidentIterator< GridImp > > incidentEnd() const
Last incident element.
Definition: entity.hh:271
PartitionType partitionType() const
The partition type for parallel computing.
Definition: entity.hh:184
int level() const
level of this element
Definition: entity.hh:178
Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
Definition: hierarchiciterator.hh:24
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: intersectioniterator.hh:30
The MMeshCachingEntity class.
The MMeshConnectedComponent class.
EntityIterator< Grid::dimension, Grid, MMeshIncidentVerticesIteratorImp< Grid, Grid::dimensionworld > > MMeshIncidentVerticesIterator
The Incident Facets Iterator alias.
Definition: incidentiterator.hh:45
EntityIterator< 0, Grid, MMeshEdgeIncidentIteratorImp< Grid, Grid::dimension > > MMeshEdgeIncidentIterator
The Incident Entity Iterator alias for edges.
Definition: incidentiterator.hh:29
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:37
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 10, 22:40, 2025)