25#ifndef DUMUX_MULTIDOMAIN_EMBEDDED_COUPLINGMANAGER_1D3D_LINE_HH
26#define DUMUX_MULTIDOMAIN_EMBEDDED_COUPLINGMANAGER_1D3D_LINE_HH
38namespace Embedded1d3dCouplingMode {
40 static std::string
name() {
return "line"; }
42 [[deprecated(
"Comparison with enum is deprecated. Removed after 3.3. Use tags.")]]
44 [[deprecated(
"Comparison with enum is deprecated. Removed after 3.3. Use tags.")]]
46 [[deprecated(
"Comparison with enum is deprecated. Removed after 3.3. Use tags.")]]
48 [[deprecated(
"Comparison with enum is deprecated. Removed after 3.3. Use tags.")]]
56template<
class MDTraits,
class CouplingMode>
57class Embedded1d3dCouplingManager;
67template<
class MDTraits>
74 using Scalar =
typename MDTraits::Scalar;
75 using SolutionVector =
typename MDTraits::SolutionVector;
77 static constexpr auto bulkIdx =
typename MDTraits::template SubDomain<0>::Index();
78 static constexpr auto lowDimIdx =
typename MDTraits::template SubDomain<1>::Index();
81 template<std::
size_t id>
using SubDomainTypeTag =
typename MDTraits::template SubDomain<id>::TypeTag;
84 template<std::
size_t id>
using GridView =
typename GridGeometry<id>::GridView;
85 template<std::
size_t id>
using Element =
typename GridView<id>::template Codim<0>::Entity;
91 using ParentType::ParentType;
93 void init(std::shared_ptr<Problem<bulkIdx>> bulkProblem,
94 std::shared_ptr<Problem<lowDimIdx>> lowDimProblem,
95 const SolutionVector& curSol)
97 ParentType::init(bulkProblem, lowDimProblem, curSol);
98 computeLowDimVolumeFractions();
105 lowDimVolumeInBulkElement_.resize(this->gridView(bulkIdx).size(0));
107 const auto& lowDimGridGeometry = this->problem(lowDimIdx).gridGeometry();
108 const auto& bulkGridGeometry = this->problem(bulkIdx).gridGeometry();
111 for (
const auto& is : intersections(this->glue()))
114 const auto& inside = is.targetEntity(0);
115 const auto intersectionGeometry = is.geometry();
116 const auto lowDimElementIdx = lowDimGridGeometry.elementMapper().index(inside);
119 const auto radius = this->problem(lowDimIdx).spatialParams().radius(lowDimElementIdx);
120 for (
int outsideIdx = 0; outsideIdx < is.numDomainNeighbors(); ++outsideIdx)
122 const auto& outside = is.domainEntity(outsideIdx);
123 const auto bulkElementIdx = bulkGridGeometry.elementMapper().index(outside);
124 lowDimVolumeInBulkElement_[bulkElementIdx] += intersectionGeometry.volume()*M_PI*radius*radius;
137 const auto& data = this->pointSourceData()[id];
138 return this->problem(lowDimIdx).spatialParams().radius(data.lowDimElementIdx());
145 const auto eIdx = this->problem(bulkIdx).gridGeometry().elementMapper().index(element);
146 return lowDimVolumeInBulkElement_[eIdx];
153 const auto totalVolume = element.geometry().volume();
154 return lowDimVolume(element) / totalVolume;
161 std::vector<Scalar> lowDimVolumeInBulkElement_;
Coupling manager for low-dimensional domains embedded in the bulk domain. Point sources on each integ...
Helper class to create (named and comparable) tagged types.
Defines the index types used for grid and local indices.
EmbeddedCouplingMode
The coupling mode.
Definition: couplingmanager1d3d.hh:44
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
constexpr Line line
Definition: couplingmanager1d3d_line.hh:52
Struture to define the index types used for grid and local indices.
Definition: indextraits.hh:38
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:57
Definition: common/properties.hh:101
Helper class to create (named and comparable) tagged types Tags any given type. The tagged type is eq...
Definition: tag.hh:42
Manages the coupling between bulk elements and lower dimensional elements Point sources on each integ...
Definition: couplingmanager1d3d.hh:36
Definition: couplingmanager1d3d_line.hh:39
friend constexpr bool operator==(EmbeddedCouplingMode m, Line)
Definition: couplingmanager1d3d_line.hh:45
friend constexpr bool operator!=(Line, EmbeddedCouplingMode m)
Definition: couplingmanager1d3d_line.hh:47
friend constexpr bool operator!=(EmbeddedCouplingMode m, Line)
Definition: couplingmanager1d3d_line.hh:49
friend constexpr bool operator==(Line, EmbeddedCouplingMode m)
Definition: couplingmanager1d3d_line.hh:43
static std::string name()
Definition: couplingmanager1d3d_line.hh:40
Manages the coupling between bulk elements and lower dimensional elements Point sources on each integ...
Definition: couplingmanager1d3d_line.hh:70
Scalar lowDimVolume(const Element< bulkIdx > &element) const
The volume the lower dimensional domain occupies in the bulk domain element.
Definition: couplingmanager1d3d_line.hh:143
void computeLowDimVolumeFractions()
Compute the low dim volume fraction in the bulk domain cells.
Definition: couplingmanager1d3d_line.hh:102
Scalar radius(std::size_t id) const
Methods to be accessed by the subproblems.
Definition: couplingmanager1d3d_line.hh:135
void init(std::shared_ptr< Problem< bulkIdx > > bulkProblem, std::shared_ptr< Problem< lowDimIdx > > lowDimProblem, const SolutionVector &curSol)
Definition: couplingmanager1d3d_line.hh:93
Scalar lowDimVolumeFraction(const Element< bulkIdx > &element) const
The volume fraction the lower dimensional domain occupies in the bulk domain element.
Definition: couplingmanager1d3d_line.hh:151
Manages the coupling between bulk elements and lower dimensional elements Point sources on each integ...
Definition: couplingmanagerbase.hh:78
Declares all properties used in Dumux.