3#ifndef DUNE_ALBERTA_INTERSECTION_HH
4#define DUNE_ALBERTA_INTERSECTION_HH
6#include <dune/grid/common/intersection.hh>
8#include <dune/grid/albertagrid/transformation.hh>
10#include <dune/grid/albertagrid/geometry.hh>
20 template<
int codim,
int dim,
class Gr
idImp >
21 class AlbertaGridEntity;
28 template<
class Gr
id >
29 class AlbertaGridIntersectionBase
31 typedef AlbertaGridIntersectionBase< Grid > This;
39 typedef FieldVector< ctype, dimensionworld > NormalVector;
40 typedef FieldVector< ctype, dimension-1 > LocalCoordType;
42 typedef typename Grid::template Codim< 0 >::Entity Entity;
44 typedef typename Grid::template Codim< 1 >::Geometry Geometry;
45 typedef typename Grid::template Codim< 1 >::LocalGeometry LocalGeometry;
47 typedef Alberta::ElementInfo< dimension > ElementInfo;
50 typedef AlbertaGridEntity< 0, dimension, Grid > EntityImp;
52 typedef typename Grid::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
53 typedef typename Grid::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
55 struct GlobalCoordReader;
56 struct LocalCoordReader;
60 AlbertaGridIntersectionBase ();
62 AlbertaGridIntersectionBase (
const EntityImp &entity,
const int oppVertex );
64 Entity inside ()
const;
66 bool boundary ()
const;
67 int boundaryId ()
const;
68 size_t boundarySegmentIndex ()
const;
70 int indexInInside ()
const;
74 NormalVector centerIntegrationOuterNormal ()
const;
75 NormalVector centerOuterNormal ()
const;
76 NormalVector centerUnitOuterNormal ()
const;
78 NormalVector integrationOuterNormal ( [[maybe_unused]]
const LocalCoordType &local )
const;
79 NormalVector outerNormal ( [[maybe_unused]]
const LocalCoordType &local )
const;
80 NormalVector unitOuterNormal ( [[maybe_unused]]
const LocalCoordType &local )
const;
83 AlbertaTransformation transformation ()
const;
86 const Grid &grid ()
const;
87 const ElementInfo &elementInfo ()
const;
91 ElementInfo elementInfo_;
100 template<
class Gr
idImp >
101 class AlbertaGridLeafIntersection
102 :
public AlbertaGridIntersectionBase< GridImp >
104 typedef AlbertaGridLeafIntersection< GridImp > This;
105 typedef AlbertaGridIntersectionBase< GridImp > Base;
107 friend class AlbertaGridEntity< 0, GridImp::dimension, GridImp >;
110 typedef This ImplementationType;
112 static const int dimension = Base::dimension;
113 static const int dimensionworld = Base::dimensionworld;
115 typedef typename Base::NormalVector NormalVector;
116 typedef typename Base::LocalCoordType LocalCoordType;
118 typedef typename Base::Entity Entity;
120 typedef typename Base::Geometry Geometry;
121 typedef typename Base::LocalGeometry LocalGeometry;
123 typedef typename Base::ElementInfo ElementInfo;
126 typedef typename Base::EntityImp EntityImp;
128 typedef typename Base::GeometryImpl GeometryImpl;
129 typedef typename Base::LocalGeometryImpl LocalGeometryImpl;
131 typedef typename Base::GlobalCoordReader GlobalCoordReader;
132 typedef typename Base::LocalCoordReader LocalCoordReader;
136 using Base::elementInfo;
140 AlbertaGridLeafIntersection () = default;
142 AlbertaGridLeafIntersection ( const EntityImp &entity, int n ) : Base( entity, n ) {}
144 AlbertaGridLeafIntersection (
const This &other ) : Base( other ) {}
146 This &operator= (
const This &other )
148 *
static_cast< Base *
>( this ) = other;
149 neighborInfo_ = ElementInfo();
153 bool operator== (
const This &other )
const {
return (oppVertex_ == other.oppVertex_) && (elementInfo_ == other.elementInfo_); }
154 bool operator!= (
const This &other )
const {
return (oppVertex_ != other.oppVertex_) || (elementInfo_ != other.elementInfo_); }
156 bool equals (
const AlbertaGridLeafIntersection& other )
const {
return (*
this) == other; }
160 typename GridImp::template Codim< 0 >::Entity outside ()
const;
162 bool neighbor ()
const;
166 LocalGeometry geometryInInside ()
const;
167 LocalGeometry geometryInOutside ()
const;
169 Geometry geometry ()
const;
171 int indexInOutside ()
const;
173 int twistInInside ()
const {
return elementInfo().template twist< 1 >( oppVertex_ ); }
174 int twistInOutside ()
const {
return elementInfo().twistInNeighbor( oppVertex_ ); }
177 using Base::elementInfo_;
178 using Base::oppVertex_;
181 mutable ElementInfo neighborInfo_;
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:392
@ dimension
The dimension of the grid.
Definition: grid.hh:386
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:521
@ conforming
Output conforming data.
Definition: common.hh:71
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:130
provides a wrapper for ALBERTA's el_info structure
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:400
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:235
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition: iteratorfacades.hh:257
Dune namespace.
Definition: alignedallocator.hh:11