1#ifndef DUNE_FEM_MISC_BOUNDARYIDPROVIDER_HH
2#define DUNE_FEM_MISC_BOUNDARYIDPROVIDER_HH
5#include <dune/grid/spgrid/declaration.hh>
9#include <opm/grid/polyhedralgrid/declaration.hh>
12#if HAVE_DUNE_POLYGONGRID
13#include <dune/polygongrid/declaration.hh>
24 template<
class Gr
id >
35 template<
class Gr
id >
44 template<
int dim,
int dimW >
49 template<
class Intersection >
50 static int boundaryId (
const Intersection &intersection )
52 return intersection.impl().boundaryId();
63 template<
int dim,
int dimw, ALUGr
idElementType elType, ALUGr
idRefinementType refineType,
class Comm >
64 struct BoundaryIdProvider< ALUGrid< dim, dimw, elType, refineType, Comm > >
66 typedef ALUGrid< dim, dimw, elType, refineType, Comm > GridType;
68 template<
class Intersection >
69 static int boundaryId (
const Intersection &intersection )
71 return intersection.impl().boundaryId();
82 template<
class HostGr
id >
83 struct BoundaryIdProvider< CacheItGrid< HostGrid > >
85 typedef CacheItGrid< HostGrid > GridType;
87 template<
class Intersection >
88 static int boundaryId (
const Intersection &intersection )
90 return BoundaryIdProvider< HostGrid >
91 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
101#if HAVE_DUNE_METAGRID
102 template<
class HostGr
id >
103 struct BoundaryIdProvider< CartesianGrid< HostGrid > >
105 typedef CartesianGrid< HostGrid > GridType;
107 template<
class Intersection >
108 static int boundaryId (
const Intersection &intersection )
110 return BoundaryIdProvider< HostGrid >
111 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
121#if HAVE_DUNE_METAGRID
122 template<
class HostGr
id >
123 struct BoundaryIdProvider< FilteredGrid< HostGrid > >
125 typedef FilteredGrid< HostGrid > GridType;
129 template<
class Intersection >
130 static int boundaryId (
const Intersection &intersection )
132 if( !HostGridAccess< GridType >::hostIntersection( intersection ).boundary() )
133 DUNE_THROW( NotImplemented,
"BoundaryIdProvider for artificial boundaries of FilteredGrid not implemented." );
134 return BoundaryIdProvider< HostGrid >
135 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
145 template<
class HostGr
id,
class CoordFunction,
class Allocator >
148 typedef GeometryGrid< HostGrid, CoordFunction, Allocator >
GridType;
150 template<
class Intersection >
163#if HAVE_DUNE_METAGRID
164 template<
class HostGr
id >
165 struct BoundaryIdProvider< IdGrid< HostGrid > >
167 typedef IdGrid< HostGrid > GridType;
169 template<
class Intersection >
170 static int boundaryId (
const Intersection &intersection )
172 return BoundaryIdProvider< HostGrid >
188 template<
class Intersection >
191 return intersection.boundarySegmentIndex();
200#if HAVE_DUNE_METAGRID
201 template<
class HostGr
id >
202 struct BoundaryIdProvider< ParallelGrid< HostGrid > >
204 typedef ParallelGrid< HostGrid > GridType;
206 template<
class Intersection >
207 static int boundaryId (
const Intersection &intersection )
209 return BoundaryIdProvider< HostGrid >
220#if HAVE_DUNE_METAGRID
221 template<
class HostGr
id,
class MapToSphere >
222 struct BoundaryIdProvider< SphereGrid< HostGrid, MapToSphere > >
224 typedef SphereGrid< HostGrid, MapToSphere > GridType;
226 template<
class Intersection >
227 static int boundaryId (
const Intersection &intersection )
229 return BoundaryIdProvider< HostGrid >
230 ::boundaryId ( HostGridAccess< GridType >::hostIntersection( intersection ) );
241 template<
class ct,
int dim,
template<
int >
class Strategy,
class Comm >
242 struct BoundaryIdProvider< SPGrid< ct, dim, Strategy, Comm > >
244 typedef SPGrid< ct, dim, Strategy, Comm > GridType;
246 template<
class Intersection >
247 static int boundaryId (
const Intersection &intersection )
249 return (intersection.boundary() ? (intersection.indexInInside()+1) : 0);
258#if HAVE_DUNE_POLYGONGRID
260 struct BoundaryIdProvider< PolygonGrid< ct > >
262 typedef PolygonGrid< ct > GridType;
264 template<
class Intersection >
265 static int boundaryId (
const Intersection &intersection )
267 return (intersection.boundary() ? (intersection.impl().boundaryId()) : 0);
276 template<
int dim,
int dimworld,
class ct >
277 struct BoundaryIdProvider< PolyhedralGrid< dim, dimworld, ct > >
279 typedef PolyhedralGrid< dim, dimworld, ct > GridType;
281 template<
class Intersection >
282 static int boundaryId (
const Intersection &intersection )
284 return (intersection.boundary() ? (intersection.impl().boundaryId()) : 0);
298 template<
class Intersection >
301 return intersection.boundarySegmentIndex();
310 template<
int dim,
class CoordCont >
315 template<
class Intersection >
318 return (intersection.boundary() ? (intersection.indexInInside()+1) : 0);
Definition: bindguard.hh:11
Definition: boundaryidprovider.hh:25
Definition: boundaryidprovider.hh:36
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:151
GeometryGrid< HostGrid, CoordFunction, Allocator > GridType
Definition: boundaryidprovider.hh:148
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:189
OneDGrid GridType
Definition: boundaryidprovider.hh:186
UGGrid< dim > GridType
Definition: boundaryidprovider.hh:296
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:299
static int boundaryId(const Intersection &intersection)
Definition: boundaryidprovider.hh:316
YaspGrid< dim, CoordCont > GridType
Definition: boundaryidprovider.hh:313
Definition: griddeclaration.hh:33
Definition: griddeclaration.hh:36
Definition: griddeclaration.hh:39