13#ifndef DUMUX_MULTIDOMAIN_EMBEDDED_COUPLINGMANAGER_1D3D_BASE_HH
14#define DUMUX_MULTIDOMAIN_EMBEDDED_COUPLINGMANAGER_1D3D_BASE_HH
33template<
class MDTraits,
class Implementation,
class PSTraits = DefaultPo
intSourceTraits<MDTraits>>
40 using Scalar =
typename MDTraits::Scalar;
41 using SolutionVector =
typename MDTraits::SolutionVector;
43 static constexpr auto bulkIdx =
typename MDTraits::template SubDomain<0>::Index();
44 static constexpr auto lowDimIdx =
typename MDTraits::template SubDomain<1>::Index();
47 template<std::
size_t id>
using SubDomainTypeTag =
typename MDTraits::template SubDomain<id>::TypeTag;
50 template<std::
size_t id>
using GridView =
typename GridGeometry<id>::GridView;
51 template<std::
size_t id>
using Element =
typename GridView<id>::template Codim<0>::Entity;
56 using ParentType::ParentType;
58 void init(std::shared_ptr<Problem<bulkIdx>> bulkProblem,
59 std::shared_ptr<Problem<lowDimIdx>> lowDimProblem,
60 const SolutionVector&
curSol)
63 computeLowDimVolumeFractions_();
67 [[deprecated(
"Will be removed after release 3.11. Only needed for the deprecated lowDimVolume and lowDimVolumeFraction.")]]
69 { computeLowDimVolumeFractions_(); }
80 return this->
problem(lowDimIdx).spatialParams().radius(data.lowDimElementIdx());
85 [[deprecated(
"Will be removed after release 3.11. This is not a general implementation: the volume of "
86 "a cylinder around a segment is counted in full in every bulk element containing the segment "
87 "(several for a segment on a face or an edge) and not in the elements the cylinder reaches "
88 "beyond the segment. Use EmbeddedCoupling::lowDimVolumePerBulkElement "
89 "from dumux/multidomain/embedded/lowdimvolume.hh.")]]
93 return lowDimVolumeInBulkElement_[eIdx];
98 [[deprecated(
"Will be removed after release 3.11. This is not a general implementation: see lowDimVolume. "
99 "Divide the result of EmbeddedCoupling::lowDimVolumePerBulkElement "
100 "from dumux/multidomain/embedded/lowdimvolume.hh by the element volume.")]]
104 return lowDimVolumeInBulkElement_[eIdx] / element.geometry().volume();
110 void computeLowDimVolumeFractions_()
113 lowDimVolumeInBulkElement_.resize(this->
gridView(bulkIdx).size(0));
119 for (
const auto& is : intersections(this->
glue()))
122 const auto& inside = is.targetEntity(0);
123 const auto intersectionGeometry = is.geometry();
124 const auto lowDimElementIdx = lowDimGridGeometry.elementMapper().index(inside);
127 const auto radius = this->
problem(lowDimIdx).spatialParams().radius(lowDimElementIdx);
128 for (
int outsideIdx = 0; outsideIdx < is.numDomainNeighbors(); ++outsideIdx)
130 const auto& outside = is.domainEntity(outsideIdx);
131 const auto bulkElementIdx = bulkGridGeometry.elementMapper().index(outside);
132 lowDimVolumeInBulkElement_[bulkElementIdx] += intersectionGeometry.volume()*M_PI*
radius*
radius;
138 std::vector<Scalar> lowDimVolumeInBulkElement_;
const Problem< i > & problem(Dune::index_constant< i > domainIdx) const
Definition multidomain/couplingmanager.hh:318
Manages the coupling between bulk elements and lower dimensional elements Point sources on each integ...
Definition couplingmanager1d3dbase.hh:36
Scalar lowDimVolumeFraction(const Element< bulkIdx > &element) const
The volume fraction the lower dimensional domain occupies in the bulk domain element.
Definition couplingmanager1d3dbase.hh:101
Scalar radius(std::size_t id) const
Methods to be accessed by the subproblems.
Definition couplingmanager1d3dbase.hh:77
Scalar lowDimVolume(const Element< bulkIdx > &element) const
The volume the lower dimensional domain occupies in the bulk domain element.
Definition couplingmanager1d3dbase.hh:90
void computeLowDimVolumeFractions()
Compute the low dim volume fraction in the bulk domain cells.
Definition couplingmanager1d3dbase.hh:68
void init(std::shared_ptr< Problem< bulkIdx > > bulkProblem, std::shared_ptr< Problem< lowDimIdx > > lowDimProblem, const SolutionVector &curSol)
Definition couplingmanager1d3dbase.hh:58
EmbeddedCouplingManagerBase(std::shared_ptr< const GridGeometry< bulkIdx > > bulkGridGeometry, std::shared_ptr< const GridGeometry< lowDimIdx > > lowDimGridGeometry)
Constructor.
Definition couplingmanagerbase.hh:150
const GridView< id > & gridView(Dune::index_constant< id > domainIdx) const
Return a reference to the bulk problem.
Definition couplingmanagerbase.hh:407
auto & curSol(Dune::index_constant< i > domainIdx)
Definition couplingmanagerbase.hh:500
const GlueType & glue() const
Definition couplingmanagerbase.hh:807
void init(std::shared_ptr< Problem< bulkIdx > > bulkProblem, std::shared_ptr< Problem< lowDimIdx > > lowDimProblem, const SolutionVector &curSol)
Definition couplingmanagerbase.hh:161
const std::vector< PointSourceData > & pointSourceData() const
Return reference to point source data vector member.
Definition couplingmanagerbase.hh:478
Defines all properties used in Dumux.
Coupling manager for low-dimensional domains embedded in the bulk domain. Point sources on each integ...
Type traits for classes providing a grid discretization.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
decltype(auto) gridDiscretization(const T &t, Args &&... args)
The grid discretization.
Definition griddiscretization.hh:98
Structure to define the index types used for grid and local indices.
Definition indextraits.hh:26
Helper class to create (named and comparable) tagged types.