Commit 7b2848d1 authored by Timo Koch's avatar Timo Koch
Browse files

[fvproblem] Introduce getter function for point source map

parent 82c2c92a
......@@ -25,6 +25,7 @@
#define DUMUX_FV_PROBLEM_HH
#include <memory>
#include <map>
#include <dune/common/version.hh>
#include <dune/common/fvector.hh>
......@@ -75,6 +76,9 @@ class FVProblem
static constexpr bool isBox = GET_PROP_VALUE(TypeTag, DiscretizationMethod) == DiscretizationMethods::Box;
using PointSourceMap = std::map<std::pair<std::size_t, std::size_t>,
std::vector<PointSource> >;
public:
/*!
* \brief Constructor
......@@ -431,7 +435,7 @@ public:
* \brief Compute the point source map, i.e. which scvs have point source contributions
* \note Call this on the problem before assembly if you want to enable point sources set
* via the addPointSources member function.
*/
*/
void computePointSourceMap()
{
// clear the given point source maps in case it's not empty
......@@ -451,10 +455,16 @@ public:
}
}
/*!
* \brief Get the point source map. It stores the point sources per scv
*/
const PointSourceMap& pointSourceMap() const
{ return pointSourceMap_; }
/*!
* \brief Applies the initial solution for all degrees of freedom of the grid.
* \param sol the initial solution vector
*/
*/
void applyInitialSolution(SolutionVector& sol) const
{
// set the initial values by forwarding to a specialized method
......@@ -569,8 +579,7 @@ private:
std::string problemName_;
//! A map from an scv to a vector of point sources
std::map<std::pair<unsigned int, unsigned int>,
std::vector<PointSource> > pointSourceMap_;
PointSourceMap pointSourceMap_;
};
} // end namespace Dumux
......
......@@ -290,9 +290,10 @@ class BoundingBoxTreePointSourceHelper
public:
//! calculate a DOF index to point source map from given vector of point sources
template<class PointSourceMap>
static void computePointSourceMap(const FVGridGeometry& fvGridGeometry,
std::vector<PointSource>& sources,
std::map<std::pair<unsigned int, unsigned int>, std::vector<PointSource> >& pointSourceMap)
PointSourceMap& pointSourceMap)
{
const auto& boundingBoxTree = fvGridGeometry.boundingBoxTree();
......
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