From 0fcb18b3e38ab3eaaf9e5a2212679eef563c8cbb Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Wed, 3 Jan 2018 15:55:08 +0100 Subject: [PATCH] [pointsources] Do not enable by default The point source computation in FVProblem uses the problem implementation to compute the point source map. However it is executed in the constructor where the problem implemenation is not fully instatiated yet as it derives from FVProblem. This patch disables point source computation by default. If you want to specify point sources you have to manually call problem->computePointSourceMap() now. --- dumux/common/fvproblem.hh | 9 +++++---- .../1p/implicit/pointsources/test_1pfv_pointsources.cc | 1 + .../pointsources/test_1pfv_pointsources_timedependent.cc | 1 + .../2p/implicit/adaptive/test_2p_adaptive_fv.cc | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh index 807f4741c2..cb8c6522bf 100644 --- a/dumux/common/fvproblem.hh +++ b/dumux/common/fvproblem.hh @@ -87,9 +87,6 @@ public: { // set a default name for the problem problemName_ = getParamFromGroup<std::string>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Problem.Name"); - - // compute which scvs contain point sources - computePointSourceMap(); } /*! @@ -432,7 +429,11 @@ public: return source; } - //! Compute the point source map, i.e. which scvs have point source contributions + /*! + * \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 diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc index 917f4da90d..d0e41825d5 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc @@ -88,6 +88,7 @@ int main(int argc, char** argv) try // the problem (initial and boundary conditions) using Problem = typename GET_PROP_TYPE(TypeTag, Problem); auto problem = std::make_shared<Problem>(fvGridGeometry); + problem->computePointSourceMap(); // enable point sources // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc index e07f665b92..dabe20b670 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc @@ -88,6 +88,7 @@ int main(int argc, char** argv) try // the problem (initial and boundary conditions) using Problem = typename GET_PROP_TYPE(TypeTag, Problem); auto problem = std::make_shared<Problem>(fvGridGeometry); + problem->computePointSourceMap(); // enable point sources // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index 3ee56a5758..161900bd12 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc @@ -112,6 +112,7 @@ int main(int argc, char** argv) try // the problem (initial and boundary conditions) using Problem = typename GET_PROP_TYPE(TypeTag, Problem); auto problem = std::make_shared<Problem>(fvGridGeometry); + problem->computePointSourceMap(); // enable point sources // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); -- GitLab