Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
boundary.hh
Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set ts=8 sw=2 et sts=2:
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 DUNE_FUFEM_DOMAINS_BOUNDARY_HH
8#define DUNE_FUFEM_DOMAINS_BOUNDARY_HH
9
11
12
13
14namespace Dune::Fufem {
15
16
17
25template <class GV>
27{
28
29 static const int dim = GV::dimension;
30
31 using Element = typename GV::template Codim<0>::Entity;
32 using Intersection = typename GV::Intersection;
33
34public:
35
39 using GridView = GV;
40
45
50 : gridView_(gridView)
51 {}
52
56 const GridView& gridView () const
57 {
58 return gridView_;
59 }
60
66 constexpr bool contains (const Intersection& intersection) const
67 {
68 return intersection.boundary();
69 }
70
78 bool containsFaceOf (const Element& element) const
79 {
80 return element.hasBoundaryIntersections() and gridView().contains(element);
81 }
82
86 iterator begin () const
87 {
88 return iterator(*this, gridView().template begin<0>());
89 }
90
94 iterator end () const
95 {
96 return iterator(*this, gridView().template end<0>());
97 }
98
99private:
100 GridView gridView_;
101};
102
103
104} // namespace Dune::Fufem
105
106
107
108#endif // DUNE_FUFEM_DOMAINS_BOUNDARY_HH
Definition dunefunctionsboundaryfunctionalassembler.hh:29
Encapsulate the set of the boundary intersections of a GridView.
Definition boundary.hh:27
bool containsFaceOf(const Element &element) const
Return true if the element may have a face on the boundary.
Definition boundary.hh:78
Dune::Fufem::IntersectionSetIterator< Boundary > iterator
Export the appropriate iterator type.
Definition boundary.hh:44
iterator end() const
Return iterator pointing after last boundary face.
Definition boundary.hh:94
iterator begin() const
Return iterator pointing to first boundary face.
Definition boundary.hh:86
Boundary(const GridView &gridView)
Construct boundary object for given gridview.
Definition boundary.hh:49
const GridView & gridView() const
Return GridView the boundary is associated to.
Definition boundary.hh:56
GV GridView
GridView type the boundary is associated to.
Definition boundary.hh:39
constexpr bool contains(const Intersection &intersection) const
Return true for all boundary intersections.
Definition boundary.hh:66
An iterator iterating over all intersections of an intersection set.
Definition intersectionsetiterator.hh:57