dune-fem  2.4.1-rc
inversefilter.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_GRIDPART_FILTER_INVERSEFILTER_HH
2 #define DUNE_FEM_GRIDPART_FILTER_INVERSEFILTER_HH
3 
4 namespace Dune
5 {
6 
7  namespace Fem
8  {
9 
10  template< class FilterImp >
12  {
13  public:
16 
18  template< int cd >
19  struct Codim
20  {
21  typedef typename FilterImp::template Codim< cd >::EntityType EntityType;
22  };
23 
26 
28  InverseFilter ( const FilterImp & filter = FilterImp() )
29  : filter_( filter )
30  { }
31 
33  template< int cd >
34  bool contains ( const typename Codim< cd >::EntityType & entity ) const
35  {
36  return !filter().contains< cd >( entity );
37  }
38 
40  template< class Entity >
41  bool contains ( const Entity & entity ) const
42  {
43  return !filter().contains( entity );
44  }
45 
47  // (allows boundarys within a given domain)
48  template< class Intersection >
49  bool interiorIntersection ( const Intersection &intersection ) const
50  {
51  typedef typename Intersection::Entity EntityType;
52  const EntityType outside(intersection.outside());
53  return contains( outside );
54  }
55 
57  template< class Intersection >
58  bool intersectionBoundary( const Intersection &intersection ) const
59  {
60  return filter().intersectionBoundary( intersection );
61  }
62 
64  template< class Intersection >
65  int intersectionBoundaryId ( const Intersection &intersection ) const
66  {
67  return filter().intersectionBoundaryId( intersection );
68  }
69 
71  template< class Intersection >
72  bool intersectionNeighbor ( const Intersection &intersection ) const
73  {
74  return filter().intersectionNeighbor( intersection );
75  }
76 
77  private:
78  const FilterImp filter () const
79  {
80  return filter_;
81  }
82 
83  FilterImp filter_;
84 
85  }; // end class InverseFilter
86 
87  } // namespace Fem
88 
89 } // namespace Dune
90 
91 #endif // #ifndef DUNE_FEM_GRIDPART_FILTER_INVERSEFILTER_HH
Definition: inversefilter.hh:11
FilterImp::template Codim< cd >::EntityType EntityType
Definition: inversefilter.hh:21
InverseFilter< FilterImp > FilterType
type of the filter implementation
Definition: inversefilter.hh:15
bool contains(const Entity &entity) const
returns true if the given entity of the pointer in the domain
Definition: inversefilter.hh:41
Definition: coordinate.hh:4
bool intersectionBoundary(const Intersection &intersection) const
returns true if an intersection is a boundary intersection
Definition: inversefilter.hh:58
entity types
Definition: inversefilter.hh:19
Codim< 0 >::EntityType EntityType
type of entity with codim=0
Definition: inversefilter.hh:25
InverseFilter(const FilterImp &filter=FilterImp())
constructor
Definition: inversefilter.hh:28
bool interiorIntersection(const Intersection &intersection) const
returns true if an intersection is interior
Definition: inversefilter.hh:49
bool contains(const typename Codim< cd >::EntityType &entity) const
returns true if the given entity of the pointer in the domain
Definition: inversefilter.hh:34
int intersectionBoundaryId(const Intersection &intersection) const
returns the boundary id for an intersection
Definition: inversefilter.hh:65
bool intersectionNeighbor(const Intersection &intersection) const
returns true if for an intersection a neighbor exsits
Definition: inversefilter.hh:72