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