Loading...
Searching...
No Matches
intersectioniterator.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTIONITERATOR_HH
#define DUNE_GRIDGLUE_ADAPTER_INTERSECTIONITERATOR_HH
#include <dune/grid-glue/gridglue.hh>
namespace Dune {
namespace GridGlue {
template<typename P0, typename P1, int inside, int outside>
class IntersectionIterator :
public Dune::ForwardIteratorFacade< IntersectionIterator<P0,P1,inside,outside>,
const Intersection<P0,P1,inside,outside> >
{
public:
typedef ::Dune::GridGlue::GridGlue<P0, P1> GridGlue;
typedef ::Dune::GridGlue::Intersection<P0,P1,inside,outside> Intersection;
IntersectionIterator(const GridGlue * glue, unsigned int i)
: glue_(glue),
index_(i),
intersection_(glue_, & glue_->intersections_[index_])
{}
const Intersection& dereference() const
{
assert(("never dereference the end iterator" &&
index_ != glue_->index__sz));
return intersection_;
}
void increment()
{
intersection_ = Intersection(glue_, & glue_->intersections_[++index_]);
}
bool equals(const IntersectionIterator& iter) const
{
return iter.index_ == index_;
}
private:
const GridGlue* glue_;
unsigned int index_;
Intersection intersection_;
};
} // end namespace GridGlue
} // end namespace Dune
#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTIONITERATOR_HH
gridglue.hh
Central component of the module implementing the coupling of two grids.
Dune
Definition gridglue.hh:37
Dune::GridGlue
Definition gridglue.hh:38
Dune::GridGlue::GridGlue
sequential adapter to couple two grids at specified close together boundaries
Definition gridglue.hh:67
Dune::GridGlue::Intersection
The intersection of two entities of the two patches of a GridGlue.
Definition intersection.hh:257
Dune::GridGlue::IntersectionIterator< P0, P1, side,(side+1) % 2 >::GridGlue
::Dune::GridGlue::GridGlue< P0, P1 > GridGlue
Definition intersectioniterator.hh:28
Dune::GridGlue::IntersectionIterator::dereference
const Intersection & dereference() const
Definition intersectioniterator.hh:37
Dune::GridGlue::IntersectionIterator::increment
void increment()
Definition intersectioniterator.hh:44
Dune::GridGlue::IntersectionIterator< P0, P1, side,(side+1) % 2 >::Intersection
::Dune::GridGlue::Intersection< P0, P1, inside, outside > Intersection
Definition intersectioniterator.hh:29
Dune::GridGlue::IntersectionIterator::IntersectionIterator
IntersectionIterator(const GridGlue *glue, unsigned int i)
Definition intersectioniterator.hh:31
Dune::GridGlue::IntersectionIterator::equals
bool equals(const IntersectionIterator &iter) const
Definition intersectioniterator.hh:49