4#ifndef DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
5#define DUNE_GRID_IO_FILE_VTK_BOUNDARYITERATORS_HH
12#include <dune/grid/io/file/vtk/corner.hh>
13#include <dune/grid/io/file/vtk/corneriterator.hh>
14#include <dune/grid/io/file/vtk/functionwriter.hh>
36 < BoundaryIterator<GV>,
37 const typename GV::Intersection,
38 const typename GV::Intersection&,
39 typename std::iterator_traits<typename GV::template Codim<0>::
40 Iterator>::difference_type>
45 typedef const typename GV::Intersection Value;
46 typedef Value& Reference;
48 typedef typename GV::IntersectionIterator IntersectionIterator;
49 typedef typename std::iterator_traits<ElementIterator>::difference_type
58 shared_ptr<IntersectionIterator> iit;
62 if(eit == gv->template end<0>())
return true;
64 if((*iit)->boundary() && !(*iit)->neighbor())
return true;
69 void basic_increment() {
71 if(*iit == gv->iend(*eit)) {
74 if(eit != gv->template end<0>())
75 iit.reset(
new IntersectionIterator(gv->ibegin(*eit)));
80 Reference dereference()
const {
84 if(eit != other.eit)
return false;
88 bool mePassedTheEnd = eit == gv->template end<0>();
89 bool otherPassedTheEnd = other.eit == other.gv->template end<0>();
92 if(mePassedTheEnd && otherPassedTheEnd)
return true;
95 if(mePassedTheEnd || otherPassedTheEnd)
return false;
98 return *iit == *other.iit;
103 while(!valid()) basic_increment();
112 const IntersectionIterator& iit_)
113 : gv(&gv_), eit(eit_), iit(new IntersectionIterator(iit_))
115 while(!valid()) basic_increment();
124 : gv(&gv_), eit(eit_)
126 if(eit != gv->template end<0>())
127 iit.reset(
new IntersectionIterator(gv->ibegin(*eit)));
129 while(!valid()) basic_increment();
137 : gv(&gv_), eit(end ? gv->template end<0>() : gv->template begin<0>())
139 if(eit != gv->template end<0>())
140 iit.reset(
new IntersectionIterator(gv->ibegin(*eit)));
142 while(!valid()) basic_increment();
146 template<
typename ElementIndexSet>
147 class IntersectionIndexSet {
148 const ElementIndexSet& eis;
151 IntersectionIndexSet(
const ElementIndexSet& eis_)
156 template<
typename GV>
157 class NonConformingBoundaryIteratorFactory {
161 static const unsigned dimCell = GV::dimension-1;
163 typedef typename GV::Intersection Cell;
164 typedef BoundaryIterator<GV> CellIterator;
166 typedef VTK::Corner<Cell> Corner;
167 typedef VTK::CornerIterator<CellIterator> CornerIterator;
169 typedef Corner Point;
170 typedef CornerIterator PointIterator;
172 typedef NonConformingConnectivityWriter<Cell> ConnectivityWriter;
173 typedef typename GV::CollectiveCommunication CollectiveCommunication;
175 explicit NonConformingBoundaryIteratorFactory(
const GV& gv_)
179 CellIterator beginCells()
const {
180 return CellIterator(gv);
182 CellIterator endCells()
const {
183 return CellIterator(gv,
true);
186 CornerIterator beginCorners()
const {
187 return CornerIterator(beginCells(), endCells());
189 CornerIterator endCorners()
const {
190 return CornerIterator(endCells());
193 PointIterator beginPoints()
const {
return beginCorners(); }
194 PointIterator endPoints()
const {
return endCorners(); }
196 ConnectivityWriter makeConnectivity()
const {
197 return ConnectivityWriter();
199 const CollectiveCommunication& comm()
const {
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:141
iterate over the GridViews boundary intersections
Definition: boundaryiterators.hh:41
BoundaryIterator(const GV &gv_, const ElementIterator &eit_)
construct a BoundaryIterator
Definition: boundaryiterators.hh:123
BoundaryIterator(const GV &gv_, bool end=false)
construct a BoundaryIterator
Definition: boundaryiterators.hh:136
BoundaryIterator(const GV &gv_, const ElementIterator &eit_, const IntersectionIterator &iit_)
construct a BoundaryIterator
Definition: boundaryiterators.hh:111
This file implements iterator facade classes for writing stl conformant iterators.
Dune namespace.
Definition: alignment.hh:10
This file implements the class shared_ptr (a reference counting pointer), for those systems that don'...
Static tag representing a codimension.
Definition: dimension.hh:22