Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
boundarypatch.hh
Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set ts=8 sw=4 et sts=4:
3
4// SPDX-FileCopyrightText: Copyright © DUNE-FUFEM Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef BOUNDARY_PATCH_HH
8#define BOUNDARY_PATCH_HH
9
10#include <vector>
11#include <set>
12
15
18#include <dune/grid/common/gridview.hh>
19#include <dune/grid/common/gridfactory.hh>
20
23
24
25
33template <class GridView>
35{
37
38public:
39 typedef typename GridView::Intersection Intersection;
40
43 template<class T>
44 BoundaryPatchInsertionIndexProperty(const GridFactory& factory, const T& t) : factory_(factory)
45 {
46 indices_.insert(t.begin(), t.end());
47 }
48
51 BoundaryPatchInsertionIndexProperty(const GridFactory& factory, int i) : factory_(factory)
52 {
53 indices_.insert(i);
54 }
55
58 bool operator() (const Intersection& i) const
59 {
60 return (factory_.wasInserted(i) and (indices_.find(factory_.insertionIndex(i))!=indices_.end()));
61 }
62private:
63 const GridFactory& factory_;
64 std::set<int> indices_;
65};
66
67
68
76template <class GridView>
78{
79public:
80 typedef typename GridView::Intersection Intersection;
81
84 template<class T>
86 {
87 indices_.insert(t.begin(), t.end());
88 }
89
93 {
94 indices_.insert(i);
95 }
96
99 bool operator() (const Intersection& i) const
100 {
101 return (indices_.find(i.boundarySegmentIndex())!=indices_.end());
102 }
103private:
104 std::set<int> indices_;
105};
106
107
108
116template <class GridView, int ncomp = 1>
118{
119 typedef typename GridView::IndexSet IndexSet;
120 static const int dim = GridView::dimension;
121public:
122 typedef typename GridView::Intersection Intersection;
123
126 BoundaryPatchEnclosingVerticesProperty(const GridView& gridView, const Dune::BitSetVector<ncomp>& vertices) :
127 indexSet_(gridView.indexSet()),
128 vertices_(vertices)
129 {}
130
133 bool operator() (const Intersection& i) const
134 {
135 const auto inside = i.inside();
136 int localFaceIndex = i.indexInInside();
137
138 auto refElement = Dune::ReferenceElements<double, dim>::general(inside.type());
139
140 // Get global node ids
141 int n = refElement.size(localFaceIndex, 1, dim);
142
143 // Using ReferenceElement::subEntity is OK here, because we loop
144 // over all subEntities (i.e. sub-vertices) and just return false
145 // if _any_ of them is not marked.
146 for (int i=0; i<n; i++) {
147 int localVertexIndex = refElement.subEntity(localFaceIndex, 1, i, dim);
148 if (not(vertices_[indexSet_.subIndex(inside, localVertexIndex, dim)].any()))
149 return false;
150 }
151 return true;
152 }
153
154private:
155 const IndexSet& indexSet_;
156 const Dune::BitSetVector<ncomp>& vertices_;
157};
158
166template <class GridView>
168{
169 typedef typename GridView::IndexSet IndexSet;
170 static const int dim = GridView::dimension;
171public:
172 typedef typename GridView::Intersection Intersection;
173
176 BoundaryPatchTouchingVerticesProperty(const GridView& gridView, const Dune::BitSetVector<1>& vertices) :
177 indexSet_(gridView.indexSet()),
178 vertices_(vertices)
179 {}
180
183 bool operator() (const Intersection& i) const
184 {
185 const auto inside = i.inside();
186 int localFaceIndex = i.indexInInside();
187
188 auto refElement = Dune::ReferenceElements<double, dim>::general(inside.type());
189
190 // Get global node ids
191 int n = refElement.size(localFaceIndex, 1, dim);
192
193 // Using ReferenceElement::subEntity is OK here, because we loop
194 // over all subEntities (i.e. sub-vertices) and return true as soon
195 // as _any_ of them is marked.
196 for (int i=0; i<n; i++) {
197 int localVertexIndex = refElement.subEntity(localFaceIndex, 1, i, dim);
198 if (vertices_[indexSet_.subIndex(inside, localVertexIndex, dim)][0])
199 return true;
200 }
201 return false;
202 }
203
204private:
205 const IndexSet& indexSet_;
206 const Dune::BitSetVector<1>& vertices_;
207};
208
209
210
211
215template <class GV>
217 : public Dune::Fufem::BoundaryPatch<GV>
218{
219protected:
220
222 using Element = typename Base::Element;
223 using Intersection = typename Base::Intersection;
224 using IntersectionIterator = typename GV::IntersectionIterator;
225
226public:
227
228 using iterator = typename Base::iterator;
229
230 using GridView = GV;
231
232 using Base::dim;
233 using Base::gridView;
234 using Base::begin;
235 using Base::end;
236 using Base::contains;
237 using Base::isInitialized;
238 using Base::insertFace;
239 using Base::size;
240
241
246 BoundaryPatch(const GridView& gridView, bool initialValue = false)
247 : Base()
248 , verticesAreUpToDate_(false)
249 {
250 setup(gridView, initialValue);
251 }
252
258 template <int blocksize>
260 : Base()
261 , verticesAreUpToDate_(false)
262 {
263 setup(gridView, vertices);
264 }
265
266 BoundaryPatch() = default;
267
268 BoundaryPatch(const BoundaryPatch&) = default;
269
271
273
275
282 void setup(const GridView& gridView, bool insertAllBoundaryFaces = false)
283 {
284 Base::setGridView(gridView);
285 if (insertAllBoundaryFaces)
286 for (const auto& intersection : Dune::Fufem::Boundary(this->gridView()))
287 insertFace(intersection);
288 verticesAreUpToDate_ = false;
289 }
290
296 template <int blocksize>
298 {
299 // setup empty BoundaryPatch
301
302 // create property for insertion by vertex vector
304
305 // insert by property
307 }
308
310 void clear() {
311 Base::clear();
313 verticesAreUpToDate_ = false;
314 }
315
316 void getFaces(Dune::BitSetVector<1>& faces) const {
317 faces = Base::faces_;
318 }
319
321 int numFaces() const {
322 return Base::size();
323 }
324
326 void addFace(const IntersectionIterator& nIt) {
327 insertFace(*nIt);
328 }
329
331 void addFace(const Intersection& nIt) {
332 insertFace(nIt);
333 }
334
336 void addFace(const Element& en, int fIdx) {
337 insertFace(en, fIdx);
338 }
339
345 template<class InsertionProperty>
346 void insertFacesByProperty(const InsertionProperty& property)
347 {
348 for(const auto& element : elements(gridView()))
349 if (element.hasBoundaryIntersections())
350 for (const auto& is : intersections(gridView(), element))
351 if (is.boundary())
352 if (property(is))
353 insertFace(is);
354 this->verticesAreUpToDate_ = false;
355 }
356
360 bool contains(const IntersectionIterator& nIt) const
361 {
362 return contains(*nIt);
363 }
364
365
366 bool containsVertex(size_t v) const {
368 makeVertices();
369
370#ifdef DUNE_RANGE_CHECKING
371 if (v<0 || v>=vertices_.size())
372 DUNE_THROW(Dune::RangeError, "Trying to check for vertex " << v
373 << ", but the vertices are only in the range [0..." << int(vertices_.size())-1
374 << "]!");
375#endif
376
377 return vertices_[v][0];
378 }
379
381 typename GridView::Grid::ctype area() const {
382 auto patchArea = typename GridView::Grid::ctype(0);
383 for(const auto& intersection : *this)
384 patchArea += intersection.geometry().volume();
385 return patchArea;
386 }
387
388 void getVertices(Dune::BitSetVector<1>& vertices) const {
389 if (!this->verticesAreUpToDate_)
390 this->makeVertices();
391
392 vertices = this->vertices_;
393 }
394
396 if (!this->verticesAreUpToDate_)
397 this->makeVertices();
398
399 return &this->vertices_;
400 }
401
410
411 const auto& indexSet = gridView().indexSet();
412
413 patchBoundary.resize(indexSet.size(dim));
414 patchBoundary.unsetAll();
415
416 // loop over all elements
417 for (const auto& e : elements(gridView())) {
418
419 auto refElement = Dune::ReferenceElements<double, dim>::general(e.type());
420
421 // Loop over all neighbors
422 for (const auto& is : intersections(gridView(),e)) {
423
424 // if the element is a boundary element, but _not_ a patch element
425 if (is.boundary() && !contains(is)) {
426
427 // Get global node ids
428 int n = refElement.size(is.indexInInside(),1,dim);
429
430 // ATTENTION: This implementation is broken!
431 //
432 // It will not work in general, because there's no guarantee that:
433 //
434 // subIndex(e, refElement.subEntity(face,1,i,dim)) == subIndex(e.subEntity<1>(face), i, dim)
435 //
436 // The latter is what you really want because it uses the correct embedding
437 // of the face into the element (which is not the same as the one in the
438 // reference element)
439 for (int i=0; i<n; i++) {
440 int faceIdxi = refElement.subEntity(is.indexInInside(), 1, i, dim);
441 int globalIdx = indexSet.subIndex(e, faceIdxi,dim);
442 if (this->containsVertex(globalIdx))
443 patchBoundary[globalIdx] = true;
444 }
445
446 }
447
448 }
449
450 }
451
452 }
453
463 void getPatchBoundaryEdges(Dune::BitSetVector<1>& patchBoundaryEdges) const {
464
465 assert(dim==3);
466 const auto& indexSet = gridView().indexSet();
467
468 patchBoundaryEdges.resize(indexSet.size(dim-1));
469 patchBoundaryEdges.unsetAll();
470
471 // loop over all elements
472 for (const auto& e : elements(gridView())) {
473
474 auto refElement = Dune::ReferenceElements<double, dim>::general(e.type());
475
476 // Loop over all neighbors
477 for (const auto& is : intersections(gridView(),e)) {
478
479 // if the element is a boundary element, but _not_ a patch element
480 if (is.boundary() && !contains(is)) {
481
482 // Loop over the face edges
483 int n = refElement.size(is.indexInInside(),1,dim-1);
484
485 for (int i=0; i<n; i++) {
486
487 // ATTENTION: This implementation is broken!
488 //
489 // It will not work in general, because there's no guarantee that:
490 //
491 // subIndex(e, refElement.subEntity(face,1,i,dim-1)) == subIndex(e.subEntity<1>(face), i, dim-1)
492 //
493 // The latter is what you really want because it uses the correct embedding
494 // of the face into the element (which is not the same as the one in the
495 // reference element).
496 int edge = refElement.subEntity(is.indexInInside(), 1, i, dim-1);
497
498 // If 'edge' would be correct, the following use of ReferenceElement::subEntity
499 // would be OK, because we just do a check for all vertices we pass, i.e. 0 and 1.
500 int v0 = refElement.subEntity(edge, dim-1, 0, dim);
501 int v1 = refElement.subEntity(edge, dim-1, 1, dim);
502
503 if (containsVertex(indexSet.subIndex(e, v0,dim))
504 && containsVertex(indexSet.subIndex(e, v1,dim)))
505 patchBoundaryEdges[indexSet.subIndex(e, edge,dim-1)] = true;
506 }
507
508 }
509
510 }
511
512 }
513
514 }
515
517 int numVertices() const {
518 if (not(isInitialized()))
519 return 0;
520 if (!this->verticesAreUpToDate_)
521 this->makeVertices();
522
523 return this->vertices_.count();
524 }
525
533 normals = getNormals();
534 }
535
538
539 const auto& indexSet = gridView().indexSet();
540
541 if (!this->verticesAreUpToDate_)
542 this->makeVertices();
543
544 typedef Dune::FieldVector<double, dim> Vector;
545 std::vector<Vector> normals(this->vertices_.size(), Vector(0.0));
546
547 // Loop over all boundary segments
548 iterator it = begin();
549 iterator endIt = end();
550
551 for (; it!=endIt; ++it) {
552 const auto inside = it->inside();
553
554 auto refElement = Dune::ReferenceElements<double, dim>::general(inside.type());
555
556 // Compute actual surface normals
557 int n = refElement.size(it->indexInInside(),1,dim);
558
559 for (int i=0; i<n; i++) {
560 // ATTENTION: This implementation does only work if unitOuterNormal is constant on the intersection.
561 // It will not work in general, because there's no guarantee that:
562 //
563 // subIndex(e, refElement.subEntity(inside,1,i,dim)) == subIndex(e.subEntity<1>(inside), i, dim)
564 //
565 // The latter is what you really want because it uses the correct embedding
566 // of the face into the element (which is not the same as the one in the
567 // reference element).
568 //
569 // If unitOuterNormal is constant we add the same faceNormal to all vertices
570 // of this face, hence the proper order does not matter. Otherwise this
571 // implementation may compute the faceNormal at the wrong posInBoundary
572 // because posInElement and vertexIdx don't correspond to each other.
573 int faceIdxi = refElement.subEntity(it->indexInInside(), 1, i, dim);
574
575 // local position of vertex in element
576 const Dune::FieldVector<double, dim>& posInElement = refElement.position(faceIdxi, dim);
577
578 // local position in boundary segment
579 Dune::FieldVector<double, dim-1> posInBoundary = it->geometryInInside().local(posInElement);
580
581 // Get normal there
582 const Dune::FieldVector<double, dim>& faceNormal = it->unitOuterNormal(posInBoundary);
583
584 int vertexIdx = indexSet.subIndex(inside, faceIdxi,dim);
585 normals[vertexIdx] += faceNormal;
586 }
587
588 }
589
590 // Normalize vertex normals
591 for (size_t i=0; i<normals.size(); i++)
592 if (this->vertices_[i][0])
593 normals[i] /= normals[i].two_norm();
594
595 return normals;
596 }
597
600
601 const auto& indexSet = gridView().indexSet();
602
603 if (!this->verticesAreUpToDate_)
604 this->makeVertices();
605
606 auto globalToLocal = makeGlobalToLocal();
607
608 using Vector = Dune::FieldVector<double, dim>;
609 std::vector<Vector> normals(this->vertices_.count(), Vector(0.0));
610
611 // Loop over all boundary segments
612 for (const auto& it : *this) {
613
614 const auto inside = it.inside();
615
616 auto refElement = Dune::ReferenceElements<double, dim>::general(inside.type());
617
618 // Compute actual surface normals
619 int n = refElement.size(it.indexInInside(),1,dim);
620
621 const auto& geomInInside = it.geometryInInside();
622 for (int i=0; i<n; i++) {
623
624 // See the Warning in the method above!
625 int faceIdxi = refElement.subEntity(it.indexInInside(), 1, i, dim);
626
627 // local position of vertex in element
628 auto& posInElement = refElement.position(faceIdxi, dim);
629
630 // local position in boundary segment
631 auto posInBoundary = geomInInside.local(posInElement);
632
633 // Get normal there
634 const auto& faceNormal = it.unitOuterNormal(posInBoundary);
635
636 int vertexIdx = indexSet.subIndex(inside, faceIdxi,dim);
637 normals[globalToLocal[vertexIdx]] += faceNormal;
638 }
639
640 }
641
642 // Normalize vertex normals
643 for (size_t i=0; i<normals.size(); i++)
644 normals[i] /= normals[i].two_norm();
645
646 return normals;
647 }
648
649 void makeGlobalToLocal(std::vector<int>& globalToLocal) const {
650 globalToLocal = makeGlobalToLocal();
651 }
652
654 if (!this->verticesAreUpToDate_)
655 this->makeVertices();
656
657 std::vector<int> globalToLocal(this->vertices_.size());
658 int idx = 0;
659 for (size_t i=0; i< globalToLocal.size(); i++)
660 globalToLocal[i] = (this->vertices_[i][0]) ? idx++ : -1;
661
662 return globalToLocal;
663 }
664
665
672
673 /* test whether both patches live on the same grid
674 * for LevelBoundaryPatches it is not tested whether both patches refer to the same level*/
675 if (&this->gridView().grid() != &patch.gridView().grid())
676 DUNE_THROW(Dune::NotImplemented, "addPatch only works for patches defined on the same grid");
677
678 Dune::BitSetVector<1> vertices, additionalVertices;
679 this->getVertices(vertices);
680 patch.getVertices(additionalVertices);
681
682 // create combined BitSetVector
683 for (size_t i=0; i<vertices.size(); i++)
684 if (additionalVertices[i][0])
685 vertices[i] = true;
686
687 GridView gridView = this->gridView();
688 this->setup(gridView, vertices);
689
690 return *this;
691 }
692
693
700
701 /* test whether both patches live on the same grid
702 * for LevelBoundaryPatches it is not tested whether both patches refer to the same level*/
703 if (&this->gridView().grid() != &patch.gridView().grid())
704 DUNE_THROW(Dune::NotImplemented, "addPatch only works for patches defined on the same grid");
705
706 Dune::BitSetVector<1> vertices, intersectionVertices;
707 this->getVertices(vertices);
708 patch.getVertices(intersectionVertices);
709
710 // create intersection BitSetVector
711 for (size_t i=0; i<vertices.size(); i++)
712 if (vertices[i][0] && intersectionVertices[i][0])
713 vertices[i][0] = true;
714 else
715 vertices[i][0] = false;
716
717 GridView gridView = this->gridView();
718 this->setup(gridView, vertices);
719
720 return *this;
721 }
722
723protected:
724
725 void makeVertices() const {
726
727 const auto& indexSet = gridView().indexSet();
728
729 this->vertices_.resize(gridView().size(dim));
730 this->vertices_.unsetAll();
731
732 // loop over all elements
733 iterator it = begin();
734 iterator endIt = end();
735
736 for (; it!=endIt; ++it) {
737 const auto inside = it->inside();
738
739 auto refElement = Dune::ReferenceElements<double, dim>::general(inside.type());
740
741 // Get global node ids
742 int n = refElement.size(it->indexInInside(),1,dim);
743
744 // This use of ReferenceElement::subEntity is OK, because
745 // we mark the vertices corresponding to all returned indices.
746 for (int i=0; i<n; i++) {
747 int faceIdxi = refElement.subEntity(it->indexInInside(), 1, i, dim);
748 vertices_[indexSet.subIndex(inside,faceIdxi,dim)] = true;
749 }
750
751 }
752
754
755 }
756
757
758
760
761 mutable bool verticesAreUpToDate_ = false;
762};
763
764
765
766
767#endif
768
real_type two_norm() const
size_type dim() const
virtual void operator()()=0
#define DUNE_THROW(E,...)
size_type count() const
size_type size() const
void resize(int n, bool v=bool())
auto size(GeometryType type) const
IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
virtual bool wasInserted(const typename GridType::LeafIntersection &intersection) const
Insertion property for segment insertion indices.
Definition boundarypatch.hh:35
BoundaryPatchInsertionIndexProperty(const GridFactory &factory, int i)
Create property from GridFactory and a single insertion index.
Definition boundarypatch.hh:51
GridView::Intersection Intersection
Definition boundarypatch.hh:39
BoundaryPatchInsertionIndexProperty(const GridFactory &factory, const T &t)
Create property from GridFactory and container of insertion indices.
Definition boundarypatch.hh:44
Insertion property for segment indices.
Definition boundarypatch.hh:78
GridView::Intersection Intersection
Definition boundarypatch.hh:80
BoundaryPatchSegmentIndexProperty(const T &t)
Create property from a container of boundary segment indices.
Definition boundarypatch.hh:85
BoundaryPatchSegmentIndexProperty(int i)
Create property from a single boundary segment index.
Definition boundarypatch.hh:92
Insertion property for vertex vector.
Definition boundarypatch.hh:118
GridView::Intersection Intersection
Definition boundarypatch.hh:122
BoundaryPatchEnclosingVerticesProperty(const GridView &gridView, const Dune::BitSetVector< ncomp > &vertices)
Create property from a marker vector.
Definition boundarypatch.hh:126
Insertion property for vertex vector.
Definition boundarypatch.hh:168
BoundaryPatchTouchingVerticesProperty(const GridView &gridView, const Dune::BitSetVector< 1 > &vertices)
Create property from a marker vector.
Definition boundarypatch.hh:176
GridView::Intersection Intersection
Definition boundarypatch.hh:172
Encapsulate a part of a grid boundary.
Definition boundarypatch.hh:218
BoundaryPatch()=default
void clear()
Clear the boundary patch, but don't disconnect it from the GridView.
Definition boundarypatch.hh:310
typename Base::Intersection Intersection
Definition boundarypatch.hh:223
void addFace(const IntersectionIterator &nIt)
Add a boundary face to the patch.
Definition boundarypatch.hh:326
void addFace(const Intersection &nIt)
Add a boundary face to the patch.
Definition boundarypatch.hh:331
void addFace(const Element &en, int fIdx)
Add a boundary face to the patch.
Definition boundarypatch.hh:336
void getPatchBoundaryVertices(Dune::BitSetVector< 1 > &patchBoundary) const
Get the vertices which are on the boundary of the boundary patch.
Definition boundarypatch.hh:409
void getFaces(Dune::BitSetVector< 1 > &faces) const
Definition boundarypatch.hh:316
GridView::Grid::ctype area() const
Returns the area of the boundary patch.
Definition boundarypatch.hh:381
Dune::BitSetVector< 1 > vertices_
Definition boundarypatch.hh:759
BoundaryPatch(BoundaryPatch &&)=default
typename Base::Element Element
Definition boundarypatch.hh:222
BoundaryPatch & operator=(const BoundaryPatch &)=default
BoundaryPatch< GridView > addPatch(const BoundaryPatch< GridView > &patch)
Adds another patch in the sense that afterwards this patch contains all the vertices included in any ...
Definition boundarypatch.hh:671
std::vector< Dune::FieldVector< double, dim > > getNormals() const
Return vertex unit normals.
Definition boundarypatch.hh:537
std::vector< int > makeGlobalToLocal() const
Definition boundarypatch.hh:653
void makeVertices() const
Definition boundarypatch.hh:725
typename GV::IntersectionIterator IntersectionIterator
Definition boundarypatch.hh:224
bool containsVertex(size_t v) const
Definition boundarypatch.hh:366
BoundaryPatch(const GridView &gridView, bool initialValue=false)
Constructor for a given grid view.
Definition boundarypatch.hh:246
bool verticesAreUpToDate_
Definition boundarypatch.hh:761
int numFaces() const
Returns the number of faces in the surface.
Definition boundarypatch.hh:321
typename Base::iterator iterator
Definition boundarypatch.hh:228
void setup(const GridView &gridView, const Dune::BitSetVector< blocksize > &vertices)
Setup for a given grid view and a bitfield.
Definition boundarypatch.hh:297
void insertFacesByProperty(const InsertionProperty &property)
Insert boundary faces filtered by an insertion property.
Definition boundarypatch.hh:346
void makeGlobalToLocal(std::vector< int > &globalToLocal) const
Definition boundarypatch.hh:649
typename Dune::Fufem::BoundaryPatch< GV > Base
Definition boundarypatch.hh:221
BoundaryPatch(const GridView &gridView, const Dune::BitSetVector< blocksize > &vertices)
Construct boundary patch from given vertices.
Definition boundarypatch.hh:259
const Dune::BitSetVector< 1 > * getVertices() const
Definition boundarypatch.hh:395
BoundaryPatch< GridView > intersect(const BoundaryPatch< GridView > &patch)
Determines the overlap of this boundary patch and another by reducing this patch to the common vertic...
Definition boundarypatch.hh:699
void getPatchBoundaryEdges(Dune::BitSetVector< 1 > &patchBoundaryEdges) const
Get the edges which are on the boundary of the boundary patch.
Definition boundarypatch.hh:463
BoundaryPatch & operator=(BoundaryPatch &&)=default
bool contains(const IntersectionIterator &nIt) const
Return true if the BoundaryPatch contains a certain boundary face.
Definition boundarypatch.hh:360
void getNormals(std::vector< Dune::FieldVector< double, dim > > &normals) const
Return vertex unit normals.
Definition boundarypatch.hh:532
BoundaryPatch(const BoundaryPatch &)=default
std::vector< Dune::FieldVector< double, dim > > getLocalNormals() const
Return vertex unit normals corr. to local indices.
Definition boundarypatch.hh:599
GV GridView
Definition boundarypatch.hh:230
int numVertices() const
Returns the number of vertices in the surface.
Definition boundarypatch.hh:517
void getVertices(Dune::BitSetVector< 1 > &vertices) const
Definition boundarypatch.hh:388
void setup(const GridView &gridView, bool insertAllBoundaryFaces=false)
Setup for a given grid view.
Definition boundarypatch.hh:282
Encapsulate the set of the boundary intersections of a GridView.
Definition boundary.hh:27
Encapsulate a subset of the boundary intersections of a GridView.
Definition domains/boundarypatch.hh:37
static const int dim
Definition domains/boundarypatch.hh:40
std::size_t size() const
Returns the number of faces in the surface.
Definition domains/boundarypatch.hh:130
const GridView & gridView() const
Return reference to the carrier grid view.
Definition domains/boundarypatch.hh:197
iterator end() const
Return iterator pointing after last boundary patch face.
Definition domains/boundarypatch.hh:122
void insertFace(const Element &element, int faceIndex)
Insert a boundary face into the patch.
Definition domains/boundarypatch.hh:98
bool isInitialized() const
Check if BoundaryPatch is initialized.
Definition domains/boundarypatch.hh:205
iterator begin() const
Return iterator pointing to first boundary patch face.
Definition domains/boundarypatch.hh:114
T end(T... args)
T find(T... args)
T insert(T... args)
T size(T... args)