Loading...
Searching...
No Matches
subdomain.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-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
#ifndef DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
#define DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
#include <array>
#include <cstddef>
#include <limits>
#include <type_traits>
#include <utility>
#include <vector>
#include <dune/common/exceptions.hh>
#include <dune/common/iteratorfacades.hh>
#include <dune/common/iteratorrange.hh>
#include <dune/common/rangeutilities.hh>
#include <dune/geometry/type.hh>
#include <dune/geometry/typeindex.hh>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/common/partitionset.hh>
namespace Dune::Functions::Experimental {
namespace Impl {
template<class GridView>
using GlobalIntersectionIteratorTraits = Dune::DefaultIteratorTraits<
std::forward_iterator_tag,
decltype(*std::declval<typename GridView::IntersectionIterator>())>;
template<class GV, class ContainsCallback>
class GlobalIntersectionIt
: public Dune::IteratorFacadeForTraits<GlobalIntersectionIt<GV, ContainsCallback>, GlobalIntersectionIteratorTraits<GV>>
{
using Facade = Dune::IteratorFacadeForTraits<GlobalIntersectionIt<GV, ContainsCallback>, GlobalIntersectionIteratorTraits<GV>>;
public:
using GridView = GV;
using Element = typename GridView::template Codim<0>::Entity;
using ElementIterator = typename GridView::template Codim<0>::Iterator;
using IntersectionIterator = typename GridView::IntersectionIterator;
class SentinelIterator
{};
GlobalIntersectionIt(const GridView& gridView, const ContainsCallback& contains, ElementIterator elementIt, ElementIterator elementEnd)
: gridView_(gridView)
, contains_(contains)
, elementIt_(std::move(elementIt))
, elementEnd_(std::move(elementEnd))
{
if (elementIt_ != elementEnd_)
{
element_ = *elementIt_;
iIt_ = gridView_.ibegin(element_);
iEnd_ = gridView_.iend(element_);
if (not contains_(*iIt_))
++(*this);
}
}
using reference = typename Facade::reference;
reference operator*() const
{
return *iIt_;
}
GlobalIntersectionIt& operator++()
{
while(true)
{
++iIt_;
if (iIt_ == iEnd_)
{
++elementIt_;
if (elementIt_ == elementEnd_)
return *this;
element_ = *elementIt_;
iIt_ = gridView_.ibegin(element_);
iIt_ = gridView_.ibegin(element_);
iEnd_ = gridView_.iend(element_);
}
if (contains_(*iIt_))
return *this;
}
return *this;
}
friend bool operator==(const GlobalIntersectionIt& it1, const GlobalIntersectionIt& it2)
{
if (it1.elementIt_ != it2.elementIt_)
return false;
if (it1.elementIt_ == it1.elementEnd_)
return true;
return (it1.iIt_ == it2.iIt_);
}
friend bool operator==(const GlobalIntersectionIt& it1, const SentinelIterator& it2)
{
return it1.elementIt_ == it1.elementEnd_;
}
private:
GridView gridView_;
ContainsCallback contains_;
ElementIterator elementIt_;
ElementIterator elementEnd_;
Element element_;
IntersectionIterator iIt_;
IntersectionIterator iEnd_;
};
}
template<class HGV>
class SubDomainIndexSet
{
using HostGridView = HGV;
public:
using Grid = typename HostGridView::Grid;
using Types = std::vector<Dune::GeometryType>;
using IndexType = std::size_t;
template<int codim>
struct Codim
{
using Entity = typename Grid::template Codim<codim>::Entity;
using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
using Geometry = typename Grid::template Codim<codim>::Geometry;
using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
};
enum {dimension = Grid::dimension};
private:
using AllEntityMapper = Dune::MultipleCodimMultipleGeomTypeMapper<HostGridView>;
static auto allCodimLayout()
{
return [](Dune::GeometryType, int) { return true; };
}
static constexpr auto typeIndexSize = Dune::GlobalGeometryTypeIndex::size(dimension);
static constexpr auto unusesIndex = std::numeric_limits<IndexType>::max();
public:
SubDomainIndexSet(const HostGridView& hostGridView)
: hostGridView_(hostGridView)
, allEntityMapper_(hostGridView_, allCodimLayout())
{
clear();
}
// *********************************
// IndexSet interface methods
// *********************************
IndexType size(Dune::GeometryType gt) const
{
return sizePerGT_[Dune::GlobalGeometryTypeIndex::index(gt)];
}
IndexType size(int codim) const
{
return sizePerCodim_[codim];
}
template<class Entity>
IndexType index(const Entity& entity) const
{
auto index = indices_[allEntityMapper_.index(entity)];
if (index==unusesIndex)
DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using SubDomainIndexSet::index()!");
return index;
}
template<int cc>
IndexType index(const typename Codim<cc>::Entity& entity) const
{
return index<typename Codim<cc>::Entity>(entity);
}
template<class Entity>
IndexType subIndex(const Entity& entity, int subEntity, unsigned int codim) const
{
auto index = indices_[allEntityMapper_.subIndex(entity, subEntity, codim)];
if (index==unusesIndex)
DUNE_THROW(Dune::InvalidStateException, "Accessing nonexisting entry using SubDomainIndexSet::subIndex()!");
return index;
}
template<int cc>
IndexType subIndex(const typename Codim<cc>::Entity& entity, int subEntity, unsigned int codim) const
{
return subIndex<typename Codim<cc>::Entity>(entity, subEntity, codim);
}
template<class Entity >
bool contains(const Entity& entity) const
{
return (indices_[allEntityMapper_.index(entity)] != unusesIndex);
}
Types types(int codim) const
{
return typesPerCodim_[codim];
}
// *********************************
// Extended methods
// *********************************
const HostGridView& hostGridView() const
{
return hostGridView_;
}
void insertElement(const typename Codim<0>::Entity& element)
{
const auto& re = referenceElement(element);
for (auto codim : Dune::range(0, dimension+1))
{
for (auto subEntity : Dune::range(re.size(codim)))
{
auto& index = indices_[allEntityMapper_.subIndex(element, subEntity, codim)];
if (index==unusesIndex)
{
const auto& type = re.type(subEntity, codim);
const auto typeIndex = Dune::GlobalGeometryTypeIndex::index(type);
index = sizePerGT_[typeIndex];
if (sizePerGT_[typeIndex]==0)
typesPerCodim_[codim].push_back(type);
sizePerGT_[typeIndex]++;
sizePerCodim_[codim]++;
}
}
}
}
protected:
// Clear all data
void clear()
{
for(auto& size : sizePerGT_)
size = 0;
for(auto& size : sizePerCodim_)
size = 0;
for(auto& types : typesPerCodim_)
types.clear();
indices_.clear();
indices_.resize(allEntityMapper_.size(), unusesIndex);
}
HostGridView hostGridView_;
// Global size information
std::array<std::size_t, typeIndexSize> sizePerGT_;
std::array<std::size_t, dimension+1> sizePerCodim_;
std::array<Types, dimension+1> typesPerCodim_;
AllEntityMapper allEntityMapper_;
// Index map
std::vector<IndexType> indices_;
};
template<class HGV>
class SubDomainGridView
{
template<int codim>
class NonImplementedIterator
{
public:
NonImplementedIterator()
{
static_assert(codim==0, "SubDomainGridView::Codim::Iterator<codim> is only implemented for codim=0");
}
};
template<PartitionIteratorType pit>
class ElementIterator
{
using Element = typename HGV::template Codim<0>::Entity;
public:
using HostElementIterator = typename HGV::template Codim<0>::template Partition<pit>::Iterator;
ElementIterator(const SubDomainIndexSet<HGV>& indexSet, HostElementIterator&& it, HostElementIterator&& endIt)
: indexSet_(&indexSet)
, hostIt_(std::move(it))
, hostEndIt_(std::move(endIt))
{
while ((hostIt_!= hostEndIt_) and (not indexSet_->contains(*hostIt_)))
++hostIt_;
}
ElementIterator& operator++()
{
++hostIt_;
while ((hostIt_!= hostEndIt_) and (not indexSet_->contains(*hostIt_)))
++hostIt_;
return *this;
}
const Element& operator*() const
{
return *hostIt_;
}
friend bool operator==(const ElementIterator& a, const ElementIterator& b)
{
return a.hostIt_==b.hostIt_;
}
private:
HostElementIterator hostIt_;
HostElementIterator hostEndIt_;
const SubDomainIndexSet<HGV>* indexSet_;
};
public:
using HostGridView = HGV;
using Grid = typename HostGridView::Grid;
using ctype = typename Grid::ctype;
using IndexSet = SubDomainIndexSet<HostGridView>;
using Intersection = typename HostGridView::Intersection;
using IntersectionIterator = typename HostGridView::IntersectionIterator;
template<int codim>
struct Codim
{
using Entity = typename Grid::template Codim<codim>::Entity;
using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
using Geometry = typename Grid::template Codim<codim>::Geometry;
using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
using Iterator = std::conditional_t<codim==0, ElementIterator<All_Partition>, NonImplementedIterator<codim>>;
template<PartitionIteratorType pit>
struct Partition
{
using Iterator = std::conditional_t<codim==0, ElementIterator<pit>, NonImplementedIterator<codim>>;
};
};
enum {dimension = Grid::dimension};
enum {dimensionworld = Grid::dimensionworld};
SubDomainGridView(const IndexSet& indexSet)
: indexSet_(&indexSet)
{}
SubDomainGridView(const SubDomainGridView& other) = default;
const Grid& grid() const
{
return indexSet_->hostGridView().grid();
}
const IndexSet& indexSet() const
{
return *indexSet_;
}
int size(int codim) const
{
return indexSet_->size(codim);
}
int size(Dune::GeometryType gt) const
{
return indexSet_->size(gt);
}
template<class Entity>
bool contains(const Entity& entity) const
{
return indexSet_->contains(entity);
}
template<int codim, PartitionIteratorType pit = All_Partition>
typename Codim<codim>::template Partition<pit>::Iterator begin() const
{
static_assert(codim==0, "SubDomainGridView::begin<codim> is only implemented for codim=0");
return {indexSet(), hostGridView().template begin<codim, pit>(), hostGridView().template end<codim, pit>()};
}
template<int codim, PartitionIteratorType pit = All_Partition>
typename Codim<codim>::template Partition<pit>::Iterator end() const
{
static_assert(codim==0, "SubDomainGridView::end<codim> is only implemented for codim=0");
return {indexSet(), hostGridView().template end<codim, pit>(), hostGridView().template end<codim, pit>()};
}
decltype(auto) comm() const
{
return hostGridView().comm();
}
decltype(auto) ibegin(const typename Codim<0>::Entity& element) const
{
return hostGridView().ibegin(element);
}
decltype(auto) iend(const typename Codim<0>::Entity& element) const
{
return hostGridView().iend(element);
}
const HostGridView& hostGridView() const
{
return indexSet_->hostGridView();
}
protected:
const IndexSet* indexSet_;
};
template<class HostGridView>
auto elements(const SubDomainGridView<HostGridView>& subDomainGridView)
{
return Dune::IteratorRange(subDomainGridView.template begin<0>(), subDomainGridView.template end<0>());
}
template<class HostGridView, unsigned int partitions>
auto elements(const SubDomainGridView<HostGridView>& subDomainGridView, Dune::PartitionSet<partitions> partitionSet)
{
constexpr auto pit = partitionSet.partitionIterator();
return Dune::IteratorRange(subDomainGridView.template begin<0, pit>(), subDomainGridView.template end<0, pit>());
}
template<class HostGridView, class Element>
auto intersections(const SubDomainGridView<HostGridView>& subDomainGridView, const Element& element)
{
return Dune::IteratorRange(subDomainGridView.ibegin(element), subDomainGridView.iend(element));
}
template<class HGV>
class SubDomain
{
public:
using HostGridView = HGV;
using Grid = typename HostGridView::Grid;
using IndexSet = SubDomainIndexSet<HostGridView>;
using GridView = SubDomainGridView<HostGridView>;
template<int codim>
struct Codim
{
using Entity = typename Grid::template Codim<codim>::Entity;
using EntitySeed = typename Grid::template Codim<codim>::EntitySeed;
using Geometry = typename Grid::template Codim<codim>::Geometry;
using LocalGeometry = typename Grid::template Codim<codim>::LocalGeometry;
};
enum {dimension = Grid::dimension};
SubDomain(const HostGridView& hostGridView)
: indexSet_(hostGridView)
{}
const IndexSet& indexSet() const
{
return indexSet_;
}
GridView gridView() const
{
return GridView(indexSet_);
}
HostGridView hostGridView() const
{
return indexSet_.hostGridView();
}
void insertElement(const typename Codim<0>::Entity& element)
{
indexSet_.insertElement(element);
}
bool contains(const typename Codim<0>::Entity& element) const
{
return indexSet_.contains(element);
}
private:
IndexSet indexSet_;
};
template<class SubDomainA, class SubDomainB>
class SubDomainInterface
{
static_assert(
std::is_same_v<typename SubDomainA::GridView::Intersection, typename SubDomainB::GridView::Intersection>,
"SubDomainInterface requires that both SubDomain types have the same Intersection type");
public:
using Intersection = typename SubDomainA::GridView::Intersection;
SubDomainInterface(const SubDomainA& subDomainA, const SubDomainB& subDomainB)
: subDomainA_(subDomainA)
, subDomainB_(subDomainB)
{}
bool contains(const Intersection& is) const
{
if (is.boundary() or not(is.neighbor()))
return false;
return (subDomainA_.contains(is.inside()) && subDomainB_.contains(is.outside()))
|| (subDomainA_.contains(is.outside()) && subDomainB_.contains(is.inside()));
}
bool isOriented(const Intersection& is) const
{
if (is.boundary() or not(is.neighbor()))
return false;
return (subDomainA_.contains(is.inside()) && subDomainB_.contains(is.outside()));
}
const auto begin() const
{
return Impl::GlobalIntersectionIt(subDomainA_.gridView(), [&](const auto& is) {
if (is.boundary() or not(is.neighbor()))
return false;
return subDomainB_.indexSet().contains(is.outside());
}, subDomainA_.gridView().template begin<0>(), subDomainA_.gridView().template end<0>());
}
const auto end() const
{
return typename decltype(begin())::SentinelIterator();
}
private:
const SubDomainA& subDomainA_;
const SubDomainB& subDomainB_;
};
template<class SubDomain>
class SubDomainSkeleton
{
public:
using Intersection = typename SubDomain::GridView::Intersection;
SubDomainSkeleton(const SubDomain& subDomain)
: subDomain_(subDomain)
{}
bool contains(const Intersection& is) const
{
if (is.boundary() or not(is.neighbor()))
return false;
return subDomain_.contains(is.inside()) and subDomain_.contains(is.outside());
}
private:
const SubDomain& subDomain_;
};
} // namespace Dune::Functions::Experimental
#endif// DUNE_FUNCTIONS_COMMON_SUBDOMAIN_HH
Dune::Functions::Experimental::elements
auto elements(const SubDomainGridView< HostGridView > &subDomainGridView)
ADL findable access to element range for a SubDomainGridView.
Definition subdomain.hh:487
Dune::Functions::Experimental::intersections
auto intersections(const SubDomainGridView< HostGridView > &subDomainGridView, const Element &element)
ADL findable access to intersection range for an element of a SubDomainGridView.
Definition subdomain.hh:510
Dune::Functions::Experimental
Definition subdomain.hh:28
Dune::Functions::Experimental::SubDomainIndexSet
An IndexSet for a sub-domain.
Definition subdomain.hh:148
Dune::Functions::Experimental::SubDomainIndexSet::SubDomainIndexSet
SubDomainIndexSet(const HostGridView &hostGridView)
Construct SubDomainIndexSet for underlying host grid view.
Definition subdomain.hh:184
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::sizePerGT_
std::array< std::size_t, typeIndexSize > sizePerGT_
Definition subdomain.hh:297
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::indices_
std::vector< IndexType > indices_
Definition subdomain.hh:304
Dune::Functions::Experimental::SubDomainIndexSet::index
IndexType index(const typename Codim< cc >::Entity &entity) const
Definition subdomain.hh:215
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::dimension
@ dimension
Definition subdomain.hh:167
Dune::Functions::Experimental::SubDomainIndexSet::index
IndexType index(const Entity &entity) const
Definition subdomain.hh:206
Dune::Functions::Experimental::SubDomainIndexSet::size
IndexType size(int codim) const
Definition subdomain.hh:200
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::allEntityMapper_
AllEntityMapper allEntityMapper_
Definition subdomain.hh:301
Dune::Functions::Experimental::SubDomainIndexSet::size
IndexType size(Dune::GeometryType gt) const
Definition subdomain.hh:195
Dune::Functions::Experimental::SubDomainIndexSet::insertElement
void insertElement(const typename Codim< 0 >::Entity &element)
Insert element and all its sub-entities into SubDomainIndexSet.
Definition subdomain.hh:257
Dune::Functions::Experimental::SubDomainIndexSet::types
Types types(int codim) const
Definition subdomain.hh:241
Dune::Functions::Experimental::SubDomainIndexSet::Types
std::vector< Dune::GeometryType > Types
Definition subdomain.hh:154
Dune::Functions::Experimental::SubDomainIndexSet::subIndex
IndexType subIndex(const typename Codim< cc >::Entity &entity, int subEntity, unsigned int codim) const
Definition subdomain.hh:230
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::hostGridView_
HostGridView hostGridView_
Definition subdomain.hh:294
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::sizePerCodim_
std::array< std::size_t, dimension+1 > sizePerCodim_
Definition subdomain.hh:298
Dune::Functions::Experimental::SubDomainIndexSet::Grid
typename HostGridView::Grid Grid
Definition subdomain.hh:153
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::hostGridView
const HostGridView & hostGridView() const
Definition subdomain.hh:251
Dune::Functions::Experimental::SubDomainIndexSet::clear
void clear()
Definition subdomain.hh:282
Dune::Functions::Experimental::SubDomainIndexSet::contains
bool contains(const Entity &entity) const
Definition subdomain.hh:236
Dune::Functions::Experimental::SubDomainIndexSet< HostGridView >::typesPerCodim_
std::array< Types, dimension+1 > typesPerCodim_
Definition subdomain.hh:299
Dune::Functions::Experimental::SubDomainIndexSet::IndexType
std::size_t IndexType
Definition subdomain.hh:155
Dune::Functions::Experimental::SubDomainIndexSet::subIndex
IndexType subIndex(const Entity &entity, int subEntity, unsigned int codim) const
Definition subdomain.hh:221
Dune::Functions::Experimental::SubDomainIndexSet::Codim
Codim specific typedefs.
Definition subdomain.hh:160
Dune::Functions::Experimental::SubDomainIndexSet::Codim::EntitySeed
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:162
Dune::Functions::Experimental::SubDomainIndexSet::Codim::Geometry
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:163
Dune::Functions::Experimental::SubDomainIndexSet::Codim::LocalGeometry
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:164
Dune::Functions::Experimental::SubDomainIndexSet::Codim::Entity
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:161
Dune::Functions::Experimental::SubDomainGridView
A GridView for a sub-domain.
Definition subdomain.hh:323
Dune::Functions::Experimental::SubDomainGridView< HostGridView >::dimensionworld
@ dimensionworld
Definition subdomain.hh:404
Dune::Functions::Experimental::SubDomainGridView::Grid
typename HostGridView::Grid Grid
Definition subdomain.hh:380
Dune::Functions::Experimental::SubDomainGridView::end
Codim< codim >::template Partition< pit >::Iterator end() const
Create an iterator pointing to the end of the range.
Definition subdomain.hh:448
Dune::Functions::Experimental::SubDomainGridView::contains
bool contains(const Entity &entity) const
Definition subdomain.hh:433
Dune::Functions::Experimental::SubDomainGridView::indexSet_
const IndexSet * indexSet_
Definition subdomain.hh:476
Dune::Functions::Experimental::SubDomainGridView::indexSet
const IndexSet & indexSet() const
Definition subdomain.hh:417
Dune::Functions::Experimental::SubDomainGridView::SubDomainGridView
SubDomainGridView(const SubDomainGridView &other)=default
Dune::Functions::Experimental::SubDomainGridView::grid
const Grid & grid() const
Definition subdomain.hh:412
Dune::Functions::Experimental::SubDomainGridView< HostGridView >::dimension
@ dimension
Definition subdomain.hh:403
Dune::Functions::Experimental::SubDomainGridView::ctype
typename Grid::ctype ctype
Definition subdomain.hh:381
Dune::Functions::Experimental::SubDomainGridView::IntersectionIterator
typename HostGridView::IntersectionIterator IntersectionIterator
Definition subdomain.hh:384
Dune::Functions::Experimental::SubDomainGridView::hostGridView
const HostGridView & hostGridView() const
Access underlying host grid view.
Definition subdomain.hh:470
Dune::Functions::Experimental::SubDomainGridView::IndexSet
SubDomainIndexSet< HostGridView > IndexSet
Definition subdomain.hh:382
Dune::Functions::Experimental::SubDomainGridView::Intersection
typename HostGridView::Intersection Intersection
Definition subdomain.hh:383
Dune::Functions::Experimental::SubDomainGridView::comm
decltype(auto) comm() const
Definition subdomain.hh:454
Dune::Functions::Experimental::SubDomainGridView::size
int size(int codim) const
Definition subdomain.hh:422
Dune::Functions::Experimental::SubDomainGridView::ibegin
decltype(auto) ibegin(const typename Codim< 0 >::Entity &element) const
Definition subdomain.hh:459
Dune::Functions::Experimental::SubDomainGridView::size
int size(Dune::GeometryType gt) const
Definition subdomain.hh:427
Dune::Functions::Experimental::SubDomainGridView::iend
decltype(auto) iend(const typename Codim< 0 >::Entity &element) const
Definition subdomain.hh:464
Dune::Functions::Experimental::SubDomainGridView::HostGridView
HGV HostGridView
Definition subdomain.hh:378
Dune::Functions::Experimental::SubDomainGridView::begin
Codim< codim >::template Partition< pit >::Iterator begin() const
Create an iterator pointing to the begin of the range.
Definition subdomain.hh:440
Dune::Functions::Experimental::SubDomainGridView::SubDomainGridView
SubDomainGridView(const IndexSet &indexSet)
Definition subdomain.hh:406
Dune::Functions::Experimental::SubDomainGridView::Codim
Codim specific typedefs.
Definition subdomain.hh:389
Dune::Functions::Experimental::SubDomainGridView::Codim::Entity
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:390
Dune::Functions::Experimental::SubDomainGridView::Codim::Geometry
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:392
Dune::Functions::Experimental::SubDomainGridView::Codim::LocalGeometry
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:393
Dune::Functions::Experimental::SubDomainGridView::Codim::EntitySeed
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:391
Dune::Functions::Experimental::SubDomainGridView::Codim::Iterator
std::conditional_t< codim==0, ElementIterator< All_Partition >, NonImplementedIterator< codim > > Iterator
Definition subdomain.hh:394
Dune::Functions::Experimental::SubDomainGridView::Codim::Partition
Definition subdomain.hh:398
Dune::Functions::Experimental::SubDomainGridView::Codim::Partition::Iterator
std::conditional_t< codim==0, ElementIterator< pit >, NonImplementedIterator< codim > > Iterator
Definition subdomain.hh:399
Dune::Functions::Experimental::SubDomain
Class representing a sub-domain of a GridView.
Definition subdomain.hh:534
Dune::Functions::Experimental::SubDomain::insertElement
void insertElement(const typename Codim< 0 >::Entity &element)
Insert element and all its sub-entities into SubDomain.
Definition subdomain.hh:577
Dune::Functions::Experimental::SubDomain::gridView
GridView gridView() const
Create grid view representing the SubDomain.
Definition subdomain.hh:565
Dune::Functions::Experimental::SubDomain::indexSet
const IndexSet & indexSet() const
Definition subdomain.hh:559
Dune::Functions::Experimental::SubDomain::GridView
SubDomainGridView< HostGridView > GridView
Definition subdomain.hh:540
Dune::Functions::Experimental::SubDomain::dimension
@ dimension
Definition subdomain.hh:552
Dune::Functions::Experimental::SubDomain::hostGridView
HostGridView hostGridView() const
Access underlying host grid view.
Definition subdomain.hh:571
Dune::Functions::Experimental::SubDomain::SubDomain
SubDomain(const HostGridView &hostGridView)
Construct SubDomain for underlying host grid view.
Definition subdomain.hh:555
Dune::Functions::Experimental::SubDomain::Grid
typename HostGridView::Grid Grid
Definition subdomain.hh:538
Dune::Functions::Experimental::SubDomain::contains
bool contains(const typename Codim< 0 >::Entity &element) const
Check if element is contained in SubDomain.
Definition subdomain.hh:583
Dune::Functions::Experimental::SubDomain::IndexSet
SubDomainIndexSet< HostGridView > IndexSet
Definition subdomain.hh:539
Dune::Functions::Experimental::SubDomain::HostGridView
HGV HostGridView
Definition subdomain.hh:537
Dune::Functions::Experimental::SubDomain::Codim
Codim specific typedefs.
Definition subdomain.hh:545
Dune::Functions::Experimental::SubDomain::Codim::Geometry
typename Grid::template Codim< codim >::Geometry Geometry
Definition subdomain.hh:548
Dune::Functions::Experimental::SubDomain::Codim::Entity
typename Grid::template Codim< codim >::Entity Entity
Definition subdomain.hh:546
Dune::Functions::Experimental::SubDomain::Codim::LocalGeometry
typename Grid::template Codim< codim >::LocalGeometry LocalGeometry
Definition subdomain.hh:549
Dune::Functions::Experimental::SubDomain::Codim::EntitySeed
typename Grid::template Codim< codim >::EntitySeed EntitySeed
Definition subdomain.hh:547
Dune::Functions::Experimental::SubDomainInterface::end
const auto end() const
End iterator (sentinel).
Definition subdomain.hh:670
Dune::Functions::Experimental::SubDomainInterface::contains
bool contains(const Intersection &is) const
Check if intersection is contained in the interface between the subdomains.
Definition subdomain.hh:631
Dune::Functions::Experimental::SubDomainInterface::begin
const auto begin() const
Begin iterator over all intersection between the subdomains.
Definition subdomain.hh:660
Dune::Functions::Experimental::SubDomainInterface::SubDomainInterface
SubDomainInterface(const SubDomainA &subDomainA, const SubDomainB &subDomainB)
Create interface between two subdomains.
Definition subdomain.hh:617
Dune::Functions::Experimental::SubDomainInterface::isOriented
bool isOriented(const Intersection &is) const
Check if intersection is oriented.
Definition subdomain.hh:647
Dune::Functions::Experimental::SubDomainInterface::Intersection
typename SubDomainA::GridView::Intersection Intersection
Definition subdomain.hh:608
Dune::Functions::Experimental::SubDomainSkeleton::SubDomainSkeleton
SubDomainSkeleton(const SubDomain &subDomain)
Create skeleton of a subdomain.
Definition subdomain.hh:695
Dune::Functions::Experimental::SubDomainSkeleton::contains
bool contains(const Intersection &is) const
Check if intersection is contained in the skeleton of the subdomain.
Definition subdomain.hh:700
Dune::Functions::Experimental::SubDomainSkeleton::Intersection
typename SubDomain::GridView::Intersection Intersection
Definition subdomain.hh:692