1#ifndef DUNE_MULTIDOMAINGRID_INTERSECTION_HH 
    2#define DUNE_MULTIDOMAINGRID_INTERSECTION_HH 
    4#include <dune/grid/common/intersection.hh> 
    6#include <dune/grid/multidomaingrid/hostgridaccessor.hh> 
    7#include <dune/grid/multidomaingrid/subdomaingrid/intersection.hh> 
   13template<
int codim, 
int dim, 
typename Gr
idImp>
 
   17template<
typename Gr
idImp, 
typename HostIntersection_>
 
   18class IntersectionWrapper {
 
   20  template<
class, 
class>
 
   21  friend class Dune::Intersection;
 
   23  template<
typename,
typename,
typename>
 
   24  friend class subdomain::IntersectionWrapper;
 
   26  template<
typename,
typename>
 
   27  friend class IntersectionIteratorWrapper;
 
   29  using HostIntersection = HostIntersection_;
 
   30  using Entity           = 
typename GridImp::Traits::template Codim<0>::Entity;
 
   31  using Geometry         = 
typename GridImp::Traits::template Codim<1>::Geometry;
 
   32  using LocalGeometry    = 
typename GridImp::Traits::template Codim<1>::LocalGeometry;
 
   33  using EntityWrapper    = Dune::mdgrid::EntityWrapper<0,GridImp::dimension,GridImp>;
 
   35  static const int dimension = GridImp::dimension;
 
   36  static const int dimensionworld = GridImp::dimensionworld;
 
   38  using ctype            = 
typename GridImp::ctype;
 
   39  using GlobalCoords     = FieldVector<ctype,dimensionworld>;
 
   40  using LocalCoords      = FieldVector<ctype,dimension - 1>;
 
   46  IntersectionWrapper() = 
default;
 
   48  explicit IntersectionWrapper(
const HostIntersection& hostIntersection)
 
   49    : _hostIntersection(hostIntersection)
 
   52  explicit IntersectionWrapper(HostIntersection&& hostIntersection)
 
   53    : _hostIntersection(std::move(hostIntersection))
 
   58  const HostIntersection& hostIntersection()
 const {
 
   59    return _hostIntersection;
 
   62  bool equals(
const IntersectionWrapper& rhs)
 const {
 
   63    return _hostIntersection == rhs._hostIntersection;
 
   66  bool boundary()
 const {
 
   67    return _hostIntersection.boundary();
 
   70  int boundaryId()
 const {
 
   71    return _hostIntersection.boundaryId();
 
   74  std::size_t boundarySegmentIndex()
 const {
 
   75    return _hostIntersection.boundarySegmentIndex();
 
   78  bool neighbor()
 const {
 
   79    return _hostIntersection.neighbor();
 
   82  Entity inside()
 const {
 
   83    return {EntityWrapper(_hostIntersection.inside())};
 
   86  Entity outside()
 const {
 
   87    return {EntityWrapper(_hostIntersection.outside())};
 
   90  bool conforming()
 const {
 
   91    return _hostIntersection.conforming();
 
   94  LocalGeometry geometryInInside()
 const {
 
   95    return LocalGeometry(_hostIntersection.geometryInInside());
 
   98  LocalGeometry geometryInOutside()
 const {
 
   99    return LocalGeometry(_hostIntersection.geometryInOutside());
 
  102  Geometry geometry()
 const {
 
  103    return Geometry(_hostIntersection.geometry());
 
  106  GeometryType type()
 const {
 
  107    return _hostIntersection.type();
 
  110  int indexInInside()
 const {
 
  111    return _hostIntersection.indexInInside();
 
  114  int indexInOutside()
 const {
 
  115    return _hostIntersection.indexInOutside();
 
  118  GlobalCoords outerNormal(
const LocalCoords& local)
 const {
 
  119    return _hostIntersection.outerNormal(local);
 
  122  GlobalCoords integrationOuterNormal(
const LocalCoords& local)
 const {
 
  123    return _hostIntersection.integrationOuterNormal(local);
 
  126  GlobalCoords unitOuterNormal(
const LocalCoords& local)
 const {
 
  127    return _hostIntersection.unitOuterNormal(local);
 
  130  GlobalCoords centerUnitOuterNormal()
 const {
 
  131    return _hostIntersection.centerUnitOuterNormal();
 
  136  HostIntersection _hostIntersection;