1 #ifndef DUNE_FEM_MISC_BOUNDARYIDPROVIDER_HH
2 #define DUNE_FEM_MISC_BOUNDARYIDPROVIDER_HH
4 #if not DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
5 #error "Experimental grid extensions required for BoundaryIdProvider. Reconfigure with -DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS=TRUE."
9 #include <dune/grid/spgrid/declaration.hh>
20 template<
class Gr
id >
31 template<
class Gr
id >
40 template<
int dim,
int dimW >
45 template<
class Intersection >
46 static int boundaryId (
const Intersection &intersection )
48 return intersection.impl().boundaryId();
59 template<
int dim,
int dimw, ALUGr
idElementType elType, ALUGr
idRefinementType refineType,
class Comm >
60 struct BoundaryIdProvider< ALUGrid< dim, dimw, elType, refineType, Comm > >
62 typedef ALUGrid< dim, dimw, elType, refineType, Comm > GridType;
64 template<
class Intersection >
65 static int boundaryId (
const Intersection &intersection )
67 return intersection.impl().boundaryId();
77 #if HAVE_DUNE_METAGRID
78 template<
class HostGr
id >
79 struct BoundaryIdProvider< CacheItGrid< HostGrid > >
81 typedef CacheItGrid< HostGrid > GridType;
83 template<
class Intersection >
84 static int boundaryId (
const Intersection &intersection )
86 return BoundaryIdProvider< HostGrid >
87 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
97 #if HAVE_DUNE_METAGRID
98 template<
class HostGr
id >
99 struct BoundaryIdProvider< CartesianGrid< HostGrid > >
101 typedef CartesianGrid< HostGrid > GridType;
103 template<
class Intersection >
104 static int boundaryId (
const Intersection &intersection )
106 return BoundaryIdProvider< HostGrid >
107 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
117 #if HAVE_DUNE_METAGRID
118 template<
class HostGr
id >
119 struct BoundaryIdProvider< FilteredGrid< HostGrid > >
121 typedef FilteredGrid< HostGrid > GridType;
125 template<
class Intersection >
126 static int boundaryId (
const Intersection &intersection )
128 if( !HostGridAccess< GridType >::hostIntersection( intersection ).boundary() )
129 DUNE_THROW( NotImplemented,
"BoundaryIdProvider for artificial boundaries of FilteredGrid not implemented." );
130 return BoundaryIdProvider< HostGrid >
131 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
141 template<
class HostGr
id,
class CoordFunction,
class Allocator >
144 typedef GeometryGrid< HostGrid, CoordFunction, Allocator >
GridType;
146 template<
class Intersection >
159 #if HAVE_DUNE_METAGRID
160 template<
class HostGr
id >
161 struct BoundaryIdProvider< IdGrid< HostGrid > >
163 typedef IdGrid< HostGrid > GridType;
165 template<
class Intersection >
166 static int boundaryId (
const Intersection &intersection )
168 return BoundaryIdProvider< HostGrid >
184 template<
class Intersection >
187 return intersection.boundarySegmentIndex();
196 #if HAVE_DUNE_METAGRID
197 template<
class HostGr
id >
198 struct BoundaryIdProvider< ParallelGrid< HostGrid > >
200 typedef ParallelGrid< HostGrid > GridType;
202 template<
class Intersection >
203 static int boundaryId (
const Intersection &intersection )
205 return BoundaryIdProvider< HostGrid >
216 #if HAVE_DUNE_METAGRID
217 template<
class HostGr
id,
class MapToSphere >
218 struct BoundaryIdProvider< SphereGrid< HostGrid, MapToSphere > >
220 typedef SphereGrid< HostGrid, MapToSphere > GridType;
222 template<
class Intersection >
223 static int boundaryId (
const Intersection &intersection )
225 return BoundaryIdProvider< HostGrid >
226 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
237 template<
class ct,
int dim,
template<
int >
class Strategy,
class Comm >
238 struct BoundaryIdProvider< SPGrid< ct, dim, Strategy, Comm > >
240 typedef SPGrid< ct, dim, Strategy, Comm > GridType;
242 template<
class Intersection >
243 static int boundaryId (
const Intersection &intersection )
245 return (intersection.boundary() ? (intersection.indexInInside()+1) : 0);
260 template<
class Intersection >
263 return intersection.boundarySegmentIndex();
272 template<
int dim,
class CoordCont >
277 template<
class Intersection >
280 return (intersection.boundary() ? (intersection.indexInInside()+1) : 0);
Definition: bindguard.hh:11
Definition: boundaryidprovider.hh:21
Definition: boundaryidprovider.hh:32
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:147
GeometryGrid< HostGrid, CoordFunction, Allocator > GridType
Definition: boundaryidprovider.hh:144
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:185
OneDGrid GridType
Definition: boundaryidprovider.hh:182
UGGrid< dim > GridType
Definition: boundaryidprovider.hh:258
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:261
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:278
YaspGrid< dim, CoordCont > GridType
Definition: boundaryidprovider.hh:275
Definition: griddeclaration.hh:33
Definition: griddeclaration.hh:36
Definition: griddeclaration.hh:39