Loading...
Searching...
No Matches
rangegenerators.hh
Go to the documentation of this file.
// 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_RANGEGENERATORS_HH
#define DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH
#include <dune/common/iteratorrange.hh>
namespace Dune {
namespace GridGlue {
template<bool reverse>
struct Reverse
: std::integral_constant<bool, reverse>
{
typedef Reverse type;
constexpr
Reverse<!reverse> operator!() const
{ return {}; }
};
#ifdef DOXYGEN
const Reverse<true> reversed;
template<...>
IteratorRange<...>
intersections(const GridGlue<...>& glue, const Reverse<...>& reverse = !reversed);
#else
namespace {
const Reverse<true> reversed = {};
} /* namespace */
template<typename P0, typename P1, bool reverse = false>
IteratorRange< typename GridGlue<P0, P1>::template IntersectionIterator<reverse ? 1 : 0> >
intersections(const GridGlue<P0, P1>& glue, const Reverse<reverse>& = {})
{
const static int side = reverse ? 1 : 0;
return {glue.template ibegin<side>(), glue.template iend<side>()};
}
#endif // DOXYGEN
} /* namespace GridGlue */
} /* namespace Dune */
#endif
Dune
Definition gridglue.hh:37
Dune::GridGlue
Definition gridglue.hh:38
Dune::GridGlue::intersections
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
Dune::GridGlue::GridGlue::GridGlue
GridGlue(const std::shared_ptr< const GridPatch< 0 > > &gp0, const std::shared_ptr< const GridPatch< 1 > > &gp1, const std::shared_ptr< Merger > &merger)
constructor
Definition gridglue.cc:21
Dune::GridGlue::GridGlue::intersections
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
Dune::GridGlue::Reverse
Definition rangegenerators.hh:17
Dune::GridGlue::Reverse::reversed
const Reverse< true > reversed
Definition rangegenerators.hh:31
Dune::GridGlue::Reverse::type
Reverse type
Definition rangegenerators.hh:18
Dune::GridGlue::Reverse::operator!
constexpr Reverse<!reverse > operator!() const
Definition rangegenerators.hh:21