1#ifndef DUNE_FEM_DOMAINFILTER_HH
2#define DUNE_FEM_DOMAINFILTER_HH
4#include <dune/fem/gridpart/filter/filter.hh>
5#include <dune/fem/storage/dynamicarray.hh>
7#include <dune/fem/misc/boundaryidprovider.hh>
17 template<
class >
class FilterDefaultImplementation;
18 template<
class ,
class >
class DomainFilter;
24 template<
class Gr
idPartImp,
class DomainArrayImp >
25 struct DomainFilterTraits
28 typedef GridPartImp GridPartType;
31 typedef DomainArrayImp DomainArrayType;
34 typedef DomainFilter< GridPartType, DomainArrayType > FilterType;
52 template<
class Gr
idPartImp,
class DomainArrayImp = DynamicArray<
int > >
54 :
public FilterDefaultImplementation< DomainFilterTraits< GridPartImp, DomainArrayImp > >
58 typedef GridPartImp GridPartType;
61 typedef DomainArrayImp DomainArrayType;
64 typedef typename DomainArrayType::value_type FieldType;
67 typedef DomainFilterTraits< GridPartType, DomainArrayType > Traits;
70 typedef BoundaryIdProvider< typename GridPartType::GridType >
71 BoundaryIdProviderType;
74 typedef DomainFilter< GridPartType, DomainArrayType > ThisType;
77 typedef FilterDefaultImplementation< Traits > BaseType;
81 typedef typename Traits::FilterType FilterType;
84 typedef typename GridPartType :: IndexSetType IndexSetType;
93 typedef typename Traits::EntityType EntityType;
96 DomainFilter (
const GridPartType & gridPart,
97 const DomainArrayType& tags,
99 : indexSet_( gridPart.indexSet() ),
104 DomainFilter (
const ThisType & ) =
default;
105 DomainFilter ( ThisType && ) =
default;
107 ThisType &operator= (
const ThisType & ) =
default;
108 ThisType &operator= ( ThisType && ) =
default;
111 template<
class Intersection >
112 bool interiorIntersection(
const Intersection & )
const
120 bool contains (
const typename Codim< cd >::EntityType & entity )
const
124 return ( tag_ == tags_[ indexSet_.index( entity ) ] );
132 template<
class Entity >
133 bool contains (
const Entity & entity )
const
135 return contains< Entity::codimension >( entity );
139 template<
class Intersection >
140 bool intersectionBoundary(
const Intersection & intersection )
const
142 return BoundaryIdProviderType::boundaryId( intersection );
146 template<
class Intersection >
147 int intersectionBoundaryId (
const Intersection & intersection )
const
149 return BoundaryIdProviderType::boundaryId( intersection );
153 template<
class Intersection >
154 bool intersectionNeighbor (
const Intersection & intersection )
const
156 return intersection.neighbor();
160 const IndexSetType& indexSet_;
161 const DomainArrayType& tags_;
162 const FieldType tag_;
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: domainfilter.hh:39
GridPartType::template Codim< cd >::EntityType EntityType
entity type for given codimension
Definition: domainfilter.hh:41