DUNE-FEM (unstable)

inversefilter.hh
1#ifndef DUNE_FEM_GRIDPART_FILTER_INVERSEFILTER_HH
2#define DUNE_FEM_GRIDPART_FILTER_INVERSEFILTER_HH
3
4namespace Dune
5{
6
7 namespace Fem
8 {
9
10 template< class FilterImp >
11 class InverseFilter
12 {
13 public:
14 typedef InverseFilter< FilterImp > ThisType;
15
17 template< int cd >
18 struct Codim
19 {
20 typedef typename FilterImp::template Codim< cd >::EntityType EntityType;
21 };
22
24 typedef typename Codim< 0 >::EntityType EntityType;
25
27 InverseFilter ( const FilterImp & filter = FilterImp() )
28 : filter_( filter )
29 { }
30
31 InverseFilter( const ThisType & ) = default;
32 InverseFilter( ThisType && ) = default;
33
34 ThisType &operator= ( const ThisType & ) = default;
35 ThisType &operator= ( ThisType && ) = default;
36
38 template< int cd >
39 bool contains ( const typename Codim< cd >::EntityType & entity ) const
40 {
41 return !filter().contains< cd >( entity );
42 }
43
45 template< class Entity >
46 bool contains ( const Entity & entity ) const
47 {
48 return !filter().contains( entity );
49 }
50
52 // (allows boundarys within a given domain)
53 template< class Intersection >
54 bool interiorIntersection ( const Intersection &intersection ) const
55 {
56 return contains( intersection.outside() );
57 }
58
60 template< class Intersection >
61 bool intersectionBoundary( const Intersection &intersection ) const
62 {
63 return filter().intersectionBoundary( intersection );
64 }
65
67 template< class Intersection >
68 int intersectionBoundaryId ( const Intersection &intersection ) const
69 {
70 return filter().intersectionBoundaryId( intersection );
71 }
72
74 template< class Intersection >
75 bool intersectionNeighbor ( const Intersection &intersection ) const
76 {
77 return filter().intersectionNeighbor( intersection );
78 }
79
80 private:
81 const FilterImp filter () const
82 {
83 return filter_;
84 }
85
86 FilterImp filter_;
87
88 }; // end class InverseFilter
89
90 } // namespace Fem
91
92} // namespace Dune
93
94#endif // #ifndef DUNE_FEM_GRIDPART_FILTER_INVERSEFILTER_HH
Wrapper class for entities.
Definition: entity.hh:66
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::bool_constant<((II==value)||...)> contains(std::integer_sequence< T, II... >, std::integral_constant< T, value >)
Checks whether or not a given sequence contains a value.
Definition: integersequence.hh:137
Static tag representing a codimension.
Definition: dimension.hh:24
entity types
Definition: inversefilter.hh:19
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)