24#ifndef DUMUX_MULTIDOMAIN_FV_PROBLEM_HH
25#define DUMUX_MULTIDOMAIN_FV_PROBLEM_HH
31#include <dune/common/hybridutilities.hh>
32#include <dune/common/indices.hh>
43template<
class MDTraits>
46 using SolutionVector =
typename MDTraits::SolutionVector;
47 static constexpr std::size_t numSubDomains = MDTraits::numSubDomains;
49 template<std::
size_t i>
50 using GridGeometry =
typename MDTraits::template SubDomain<i>::GridGeometry;
51 using GridGeometries =
typename MDTraits::template Tuple<GridGeometry>;
55 template<std::
size_t i>
56 using Type =
typename MDTraits::template SubDomain<i>::Problem;
59 template<std::
size_t i>
63 using TupleType =
typename MDTraits::template Tuple<PtrType>;
71 using namespace Dune::Hybrid;
72 forEach(std::make_index_sequence<numSubDomains>{}, [&](
auto&& id)
74 constexpr auto i = std::decay_t<
decltype(id)>::value;
75 std::get<i>(problems_) = std::make_shared<Type<i>>(gridGeometries.template get<i>());
84 : problems_(std::move(problemTuple))
93 using namespace Dune::Hybrid;
94 forEach(std::make_index_sequence<numSubDomains>{}, [&](
auto&& id)
96 elementAt(problems_,
id)->applyInitialSolution(sol[
id]);
101 template<std::
size_t i>
103 {
return *std::get<i>(problems_); }
106 template<std::
size_t i>
108 {
return *std::get<i>(problems_); }
111 template<std::
size_t i>
112 const PtrType<i>&
get(Dune::index_constant<i>
id = Dune::index_constant<i>{})
const
113 {
return std::get<i>(problems_); }
116 template<std::
size_t i>
118 {
return std::get<i>(problems_); }
124 {
return problems_; }
130 {
return problems_; }
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
A multidomain wrapper for multiple grid geometries.
Definition: multidomain/fvgridgeometry.hh:58
A multidomain wrapper for multiple problems.
Definition: multidomain/fvproblem.hh:45
std::shared_ptr< Type< i > > PtrType
export pointer types the stored type
Definition: multidomain/fvproblem.hh:60
PtrType< i > & get(Dune::index_constant< i > id=Dune::index_constant< i >{})
access the problem ptr for domain with index i
Definition: multidomain/fvproblem.hh:117
const PtrType< i > & get(Dune::index_constant< i > id=Dune::index_constant< i >{}) const
access the problem ptr for domain with index i
Definition: multidomain/fvproblem.hh:112
MultiDomainFVProblem(TupleType problemTuple)
Construct wrapper from a tuple of problems.
Definition: multidomain/fvproblem.hh:83
typename MDTraits::template SubDomain< i >::Problem Type
export base types of the stored type
Definition: multidomain/fvproblem.hh:56
MultiDomainFVProblem(MultiDomainFVGridGeometry< MDTraits > gridGeometries)
Construct the problem.
Definition: multidomain/fvproblem.hh:69
const Type< i > & operator[](Dune::index_constant< i > id) const
return the problem for domain with index i
Definition: multidomain/fvproblem.hh:102
typename MDTraits::template Tuple< PtrType > TupleType
export type of tuple of pointers
Definition: multidomain/fvproblem.hh:63
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: multidomain/fvproblem.hh:91
const TupleType & asTuple() const
Access the underlying tuple representation.
Definition: multidomain/fvproblem.hh:129
TupleType & asTuple()
Access the underlying tuple representation.
Definition: multidomain/fvproblem.hh:123
Multidomain wrapper for multiple grid geometries.