/usr/include/dune/grid/identitygrid/identitygridintersectioniterator.hh is in libdune-grid-dev 2.4.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
#define DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
#include "identitygridintersections.hh"
#include "identitygridentity.hh"
#include <dune/grid/common/intersection.hh>
/** \file
* \brief The IdentityGridLeafIntersectionIterator and IdentityGridLevelIntersectionIterator classes
*/
namespace Dune {
/** \brief Iterator over all element neighbors
* \ingroup IdentityGrid
* Mesh entities of codimension 0 ("elements") allow to visit all neighbors, where
* a neighbor is an entity of codimension 0 which has a common entity of codimension 1
* These neighbors are accessed via a IntersectionIterator. This allows the implement
* non-matching meshes. The number of neighbors may be different from the number
* of an element!
*/
template<class GridImp>
class IdentityGridLeafIntersectionIterator
{
enum {dim=GridImp::dimension};
enum {dimworld=GridImp::dimensionworld};
// The type used to store coordinates
typedef typename GridImp::ctype ctype;
typedef typename GridImp::HostGridType::LeafGridView::IntersectionIterator HostLeafIntersectionIterator;
public:
typedef Dune::Intersection<const GridImp, Dune::IdentityGridLeafIntersection<GridImp> > Intersection;
IdentityGridLeafIntersectionIterator()
{}
IdentityGridLeafIntersectionIterator(const GridImp* identityGrid,
const HostLeafIntersectionIterator& hostIterator)
: identityGrid_(identityGrid)
, hostIterator_(hostIterator)
{}
//! equality
bool equals(const IdentityGridLeafIntersectionIterator& other) const {
return hostIterator_ == other.hostIterator_;
}
//! prefix increment
void increment() {
++hostIterator_;
}
//! \brief dereferencing
Intersection dereference() const {
return IdentityGridLeafIntersection<GridImp>(identityGrid_,*hostIterator_);
}
private:
//**********************************************************
// private data
//**********************************************************
const GridImp* identityGrid_;
HostLeafIntersectionIterator hostIterator_;
};
//! \todo Please doc me !
template<class GridImp>
class IdentityGridLevelIntersectionIterator
{
enum {dim=GridImp::dimension};
enum {dimworld=GridImp::dimensionworld};
// The type used to store coordinates
typedef typename GridImp::ctype ctype;
typedef typename GridImp::HostGridType::LevelGridView::IntersectionIterator HostLevelIntersectionIterator;
public:
typedef Dune::Intersection<const GridImp, Dune::IdentityGridLevelIntersection<GridImp> > Intersection;
IdentityGridLevelIntersectionIterator()
{}
IdentityGridLevelIntersectionIterator(const GridImp* identityGrid,
const HostLevelIntersectionIterator& hostIterator)
: identityGrid_(identityGrid)
, hostIterator_(hostIterator)
{}
//! equality
bool equals(const IdentityGridLevelIntersectionIterator<GridImp>& other) const {
return hostIterator_ == other.hostIterator_;
}
//! prefix increment
void increment() {
++hostIterator_;
}
//! \brief dereferencing
Intersection dereference() const {
return IdentityGridLevelIntersection<GridImp>(identityGrid_,*hostIterator_);
}
private:
const GridImp* identityGrid_;
HostLevelIntersectionIterator hostIterator_;
};
} // namespace Dune
#endif
|