24#ifndef DUMUX_MULTIDOMAIN_FVGRIDGEOMETRY_HH
25#define DUMUX_MULTIDOMAIN_FVGRIDGEOMETRY_HH
31#include <dune/common/hybridutilities.hh>
32#include <dune/common/indices.hh>
41template<
class MDTraits>
44 static constexpr std::size_t numSubDomains = MDTraits::numSubDomains;
48 template<std::
size_t i>
49 using Type =
typename MDTraits::template SubDomain<i>::GridGeometry;
52 template<std::
size_t i>
56 using TupleType =
typename MDTraits::template Tuple<PtrType>;
67 template<
class Gr
idViews>
70 using namespace Dune::Hybrid;
71 forEach(std::make_index_sequence<numSubDomains>{}, [&](
auto&& id)
73 constexpr auto i = std::decay_t<
decltype(id)>::value;
74 elementAt(gridGeometries_,
id) = std::make_shared<Type<i>>(std::get<i>(gridViews));
83 using namespace Dune::Hybrid;
84 forEach(std::make_index_sequence<numSubDomains>{}, [&](
auto&& id)
86 elementAt(gridGeometries_,
id)->update();
91 template<std::
size_t i>
93 {
return *Dune::Hybrid::elementAt(gridGeometries_,
id); }
96 template<std::
size_t i>
98 {
return *Dune::Hybrid::elementAt(gridGeometries_,
id); }
101 template<std::
size_t i>
103 {
return Dune::Hybrid::elementAt(gridGeometries_,
id); }
106 template<std::
size_t i>
107 void set(
PtrType<i> p, Dune::index_constant<i>
id = Dune::index_constant<i>{})
108 { Dune::Hybrid::elementAt(gridGeometries_, Dune::index_constant<i>{}) = p; }
115 {
return gridGeometries_; }
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
A multidomain wrapper for multiple grid geometries.
Definition: multidomain/fvgridgeometry.hh:43
TupleType getTuple()
return the grid variables tuple we are wrapping
Definition: multidomain/fvgridgeometry.hh:114
void set(PtrType< i > p, Dune::index_constant< i > id=Dune::index_constant< i >{})
set the pointer for sub domain i
Definition: multidomain/fvgridgeometry.hh:107
typename MDTraits::template SubDomain< i >::GridGeometry Type
export base types of the stored type
Definition: multidomain/fvgridgeometry.hh:49
const Type< i > & operator[](Dune::index_constant< i > id) const
return the grid geometry for domain with index i
Definition: multidomain/fvgridgeometry.hh:92
typename MDTraits::template Tuple< PtrType > TupleType
export type of tuple of pointers
Definition: multidomain/fvgridgeometry.hh:56
PtrType< i > get(Dune::index_constant< i > id=Dune::index_constant< i >{})
! return the grid geometry pointer for domain with index i
Definition: multidomain/fvgridgeometry.hh:102
MultiDomainFVGridGeometry(GridViews &&gridViews)
Contruct the problem.
Definition: multidomain/fvgridgeometry.hh:68
MultiDomainFVGridGeometry()=default
The default constructor.
void update()
Update all grid geometries (do this again after grid adaption)
Definition: multidomain/fvgridgeometry.hh:81
std::shared_ptr< Type< i > > PtrType
export pointer types the stored type
Definition: multidomain/fvgridgeometry.hh:53