Commit 0b42f9ba authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[md][embedded] Use new distance function from geometry module

parent 4685f756
......@@ -33,6 +33,7 @@
#include <dumux/common/properties.hh>
#include <dumux/common/indextraits.hh>
#include <dumux/common/geometry/distance.hh>
#include <dumux/multidomain/embedded/pointsourcedata.hh>
#include <dumux/multidomain/embedded/integrationpointsource.hh>
#include <dumux/multidomain/embedded/couplingmanagerbase.hh>
......@@ -1040,7 +1041,7 @@ public:
this->pointSourceData().emplace_back(std::move(psData));
// compute average distance to bulk cell
this->averageDistanceToBulkCell().push_back(this->computeDistance(outside.geometry(), globalPos));
this->averageDistanceToBulkCell().push_back(averageDistancePointGeometry(globalPos, outside.geometry()));
// export the lowdim coupling stencil
// we insert all vertices / elements and make it unique later
......
......@@ -36,6 +36,7 @@
#include <dune/geometry/quadraturerules.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/geometry/distance.hh>
#include <dumux/common/geometry/intersectingentities.hh>
#include <dumux/discretization/method.hh>
#include <dumux/multidomain/couplingmanager.hh>
......@@ -318,7 +319,7 @@ public:
this->pointSourceData().emplace_back(std::move(psData));
// compute average distance to bulk cell
averageDistanceToBulkCell_.push_back(computeDistance(outside.geometry(), globalPos));
averageDistanceToBulkCell_.push_back(averageDistancePointGeometry(globalPos, outside.geometry()));
// export the lowdim coupling stencil
// we insert all vertices / elements and make it unique later
......@@ -477,16 +478,6 @@ protected:
glue_->build(bulkGridGeometry.boundingBoxTree(), lowDimGridGeometry.boundingBoxTree());
}
template<class Geometry, class GlobalPosition>
Scalar computeDistance(const Geometry& geometry, const GlobalPosition& p) const
{
Scalar avgDist = 0.0;
const auto& quad = Dune::QuadratureRules<Scalar, bulkDim>::rule(geometry.type(), 5);
for (auto&& qp : quad)
avgDist += (geometry.global(qp.position())-p).two_norm()*qp.weight();
return avgDist;
}
//! Return reference to point source data vector member
std::vector<PointSourceData>& pointSourceData()
{ return pointSourceData_; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment