5#ifndef DUNE_ALBERTA_INTERSECTION_HH
6#define DUNE_ALBERTA_INTERSECTION_HH
8#include <dune/grid/common/intersection.hh>
10#include <dune/grid/albertagrid/transformation.hh>
12#include <dune/grid/albertagrid/geometry.hh>
22 template<
int codim,
int dim,
class Gr
idImp >
23 class AlbertaGridEntity;
30 template<
class Gr
id >
31 class AlbertaGridIntersectionBase
33 typedef AlbertaGridIntersectionBase< Grid > This;
41 typedef FieldVector< ctype, dimensionworld > NormalVector;
42 typedef FieldVector< ctype, dimension-1 > LocalCoordType;
44 typedef typename Grid::template Codim< 0 >::Entity Entity;
46 typedef typename Grid::template Codim< 1 >::Geometry Geometry;
47 typedef typename Grid::template Codim< 1 >::LocalGeometry LocalGeometry;
49 typedef Alberta::ElementInfo< dimension > ElementInfo;
52 typedef AlbertaGridEntity< 0, dimension, Grid > EntityImp;
54 typedef typename Grid::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
55 typedef typename Grid::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
57 struct GlobalCoordReader;
58 struct LocalCoordReader;
62 AlbertaGridIntersectionBase ();
64 AlbertaGridIntersectionBase (
const EntityImp &entity,
const int oppVertex );
66 Entity inside ()
const;
68 bool boundary ()
const;
69 int boundaryId ()
const;
70 size_t boundarySegmentIndex ()
const;
72 int indexInInside ()
const;
76 NormalVector centerIntegrationOuterNormal ()
const;
77 NormalVector centerOuterNormal ()
const;
78 NormalVector centerUnitOuterNormal ()
const;
80 NormalVector integrationOuterNormal ( [[maybe_unused]]
const LocalCoordType &local )
const;
81 NormalVector outerNormal ( [[maybe_unused]]
const LocalCoordType &local )
const;
82 NormalVector unitOuterNormal ( [[maybe_unused]]
const LocalCoordType &local )
const;
85 AlbertaTransformation transformation ()
const;
88 const Grid &grid ()
const;
89 const ElementInfo &elementInfo ()
const;
93 ElementInfo elementInfo_;
102 template<
class Gr
idImp >
103 class AlbertaGridLeafIntersection
104 :
public AlbertaGridIntersectionBase< GridImp >
106 typedef AlbertaGridLeafIntersection< GridImp > This;
107 typedef AlbertaGridIntersectionBase< GridImp > Base;
109 friend class AlbertaGridEntity< 0, GridImp::dimension, GridImp >;
112 typedef This ImplementationType;
114 static const int dimension = Base::dimension;
115 static const int dimensionworld = Base::dimensionworld;
117 typedef typename Base::NormalVector NormalVector;
118 typedef typename Base::LocalCoordType LocalCoordType;
120 typedef typename Base::Entity Entity;
122 typedef typename Base::Geometry Geometry;
123 typedef typename Base::LocalGeometry LocalGeometry;
125 typedef typename Base::ElementInfo ElementInfo;
128 typedef typename Base::EntityImp EntityImp;
130 typedef typename Base::GeometryImpl GeometryImpl;
131 typedef typename Base::LocalGeometryImpl LocalGeometryImpl;
133 typedef typename Base::GlobalCoordReader GlobalCoordReader;
134 typedef typename Base::LocalCoordReader LocalCoordReader;
138 using Base::elementInfo;
142 AlbertaGridLeafIntersection () = default;
144 AlbertaGridLeafIntersection ( const EntityImp &entity, int n ) : Base( entity, n ) {}
146 AlbertaGridLeafIntersection (
const This &other ) : Base( other ) {}
148 This &operator= (
const This &other )
150 *
static_cast< Base *
>( this ) = other;
151 neighborInfo_ = ElementInfo();
155 bool operator== (
const This &other )
const {
return (oppVertex_ == other.oppVertex_) && (elementInfo_ == other.elementInfo_); }
156 bool operator!= (
const This &other )
const {
return (oppVertex_ != other.oppVertex_) || (elementInfo_ != other.elementInfo_); }
158 bool equals (
const AlbertaGridLeafIntersection& other )
const {
return (*
this) == other; }
162 typename GridImp::template Codim< 0 >::Entity outside ()
const;
164 bool neighbor ()
const;
168 LocalGeometry geometryInInside ()
const;
169 LocalGeometry geometryInOutside ()
const;
171 Geometry geometry ()
const;
173 int indexInOutside ()
const;
175 int twistInInside ()
const {
return elementInfo().template twist< 1 >( oppVertex_ ); }
176 int twistInOutside ()
const {
return elementInfo().twistInNeighbor( oppVertex_ ); }
179 using Base::elementInfo_;
180 using Base::oppVertex_;
183 mutable ElementInfo neighborInfo_;
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
static constexpr int dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:390
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:518
@ conforming
Output conforming data.
Definition: common.hh:73
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
provides a wrapper for ALBERTA's el_info structure
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:587
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:238
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:260
Dune namespace.
Definition: alignedallocator.hh:13