diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh index 2d1811480fb0b87b76882892b850190c0a0df49f..16a6fcef6f3177ec1ed4ac5dd4f462b1d29a042b 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_darcy.hh @@ -247,10 +247,6 @@ public: // \} - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh index beefb1a1d71efa7bdbf297e9d4dafd8ed60535a3..6bef73f873f45ccb6fc3b661e994f6e84a36c03f 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/problem_stokes.hh @@ -234,10 +234,6 @@ public: // \} - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh index fe00a54ad7009464968e0e2c3d1710cc15a8ff44..8706a992aaef8d279a0fe810886fc758d4a75f84 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_darcy.hh @@ -269,12 +269,6 @@ public: // \} - /*! - * \brief Set the coupling manager - */ - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - /*! * \brief Get the coupling manager */ diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh index a207ce050afbb09f310d6a0f9edf9a73d5a98139..6f20a585d20edd48ff2f295f2d8255f70ab5a2f4 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/problem_stokes.hh @@ -243,12 +243,6 @@ public: // \} - /*! - * \brief Set the coupling manager - */ - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - /*! * \brief Get the coupling manager */ diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh index 836aca40339b4b0d41b73a8d4a25aba5fed97767..74e25b29e785dcf23438a9374239f031e9b31d0f 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_darcy.hh @@ -315,12 +315,6 @@ public: // \} - /*! - * \brief Set the coupling manager - */ - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - /*! * \brief Get the coupling manager */ diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh index 02a7b7d291067371cb555595b779fd965e540108..8dfa961988bd143b234b9e8ad29aaefa27abb347 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh @@ -270,12 +270,6 @@ public: // \} - /*! - * \brief Set the coupling manager - */ - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - /*! * \brief Get the coupling manager */ diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh index 725ff9beab86b606970965a96a3a59a35ec4b85a..be5bad7ab49c3bf1bc809892d565a08467e32413 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_darcy.hh @@ -235,10 +235,6 @@ public: // \} - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh index 06dee95386d44ae5aab4fbda5fbf4c903396be9d..1b621a15f4258d9e5f24b93badce56b5abf9634b 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/problem_stokes.hh @@ -210,10 +210,6 @@ public: // \} - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh index dcf978d92cad35d3d84ece4e6fc7f0fd93dc2680..34d1ebbb0d20b560a96010fd52297c74d13727ae 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_darcy.hh @@ -252,10 +252,6 @@ public: // \} - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh index 9299a48ebee8dc9c7b1bb4ba14c8f7c5ca77e4f0..cdf945f7badefa436d0c915f6fcfb302da910d6e 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/problem_stokes.hh @@ -223,10 +223,6 @@ public: // \} - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh index 84adb36f7a400eb1c0f81fdc1931b429c4ef6114..10985faab0601c2dc623cd6632943ef7b9f7a4dd 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_darcy.hh @@ -261,12 +261,6 @@ public: // \} - /*! - * \brief Set the coupling manager - */ - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - /*! * \brief Get the coupling manager */ diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh index 2d0366021f0c79b5464679460ab962042d87b077..8f17e5f1d660ba15188996d46c9b7efa22cfd676 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh @@ -201,12 +201,6 @@ public: // \} - /*! - * \brief Set the coupling manager - */ - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - /*! * \brief Get the coupling manager */ diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh index b0b23442182d7b7528c6c86df649f62970800c33..02273c5f6c068b4485a656fb87818e873c78184d 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_root.hh @@ -325,10 +325,6 @@ public: vtk.addField(this->spatialParams().getRadii(), "radius"); } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh index ba82e7a42b2f3eb4b33c19f10a9f582d962f0f93..c44c4115ffb3bd229c75610185b20ffa062e2549 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/problem_soil.hh @@ -315,10 +315,6 @@ public: return priVars; } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh b/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh index 62fb5fc16f47ac12f230d46486d15494e6b44998..4a97e6b5528b11d0b1d61a611e0c955de5d5da1c 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh +++ b/test/multidomain/embedded/1d3d/1p_1p/problem_bloodflow.hh @@ -356,10 +356,6 @@ public: vtk.addField(exactPressure_, "exact pressure"); } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh b/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh index d47d0231b942fd795f2b57be0b2cc04d13e7f8b3..82c4739470d13c94337b4c27d17c35916a2a459d 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh +++ b/test/multidomain/embedded/1d3d/1p_1p/problem_tissue.hh @@ -405,10 +405,6 @@ public: vtk.addField(exactPressure_, "exact pressure"); } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh b/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh index 31f08030d53925cbcab1672c3c29983318b2a537..9bcbf36b479334088576abcdc661d037416f645a 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh +++ b/test/multidomain/embedded/1d3d/1p_richards/problem_root.hh @@ -311,10 +311,6 @@ public: vtk.addField(this->spatialParams().getRadii(), "radius"); } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh b/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh index 0354251e3defc60c1f4a590f03cf914bfb143b37..477c62f6d1becafa79a409179e3df17be540eff9 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh +++ b/test/multidomain/embedded/1d3d/1p_richards/problem_soil.hh @@ -259,10 +259,6 @@ public: } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh b/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh index 99720a91df2cb79c09a374403e399d6b2971413a..7d659c20fe3492709a96b7997448dae262df2c23 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh +++ b/test/multidomain/embedded/2d3d/1p_1p/problem_fracture.hh @@ -283,10 +283,6 @@ public: std::cout << "Global integrated source (1D): " << source << '\n'; } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh b/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh index 812f891dcff657758ec8a16a841b2fca4027c8bc..56bec44a92cc7b2f2be36239048e5706ea451fd9 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh +++ b/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh @@ -259,10 +259,6 @@ public: std::cout << "Global integrated source (3D): " << source << '\n'; } - //! Set the coupling manager - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManager_ = cm; } - //! Get the coupling manager const CouplingManager& couplingManager() const { return *couplingManager_; } diff --git a/test/multidomain/facet/1p_1p/analytical/main.cc b/test/multidomain/facet/1p_1p/analytical/main.cc index 85cd06a63bb1338e69fd1c7cfcb29b643163595c..77ec421942b1bb01967a89c5e2266008de772f1d 100644 --- a/test/multidomain/facet/1p_1p/analytical/main.cc +++ b/test/multidomain/facet/1p_1p/analytical/main.cc @@ -224,16 +224,20 @@ int main(int argc, char** argv) try updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, lowDimGridView); lowDimFvGridGeometry->update(); + // the coupling manager + using TestTraits = TestTraits<BulkProblemTypeTag, LowDimProblemTypeTag>; + using CouplingManager = typename TestTraits::CouplingManager; + auto couplingManager = std::make_shared<CouplingManager>(); + // the problems (boundary conditions) using BulkProblem = typename GET_PROP_TYPE(BulkProblemTypeTag, Problem); using LowDimProblem = typename GET_PROP_TYPE(LowDimProblemTypeTag, Problem); auto bulkSpatialParams = std::make_shared<typename BulkProblem::SpatialParams>(bulkFvGridGeometry, "Bulk"); - auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, "Bulk"); + auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, couplingManager, "Bulk"); auto lowDimSpatialParams = std::make_shared<typename LowDimProblem::SpatialParams>(lowDimFvGridGeometry, "LowDim"); - auto lowDimProblem = std::make_shared<LowDimProblem>(lowDimFvGridGeometry, lowDimSpatialParams, "LowDim"); + auto lowDimProblem = std::make_shared<LowDimProblem>(lowDimFvGridGeometry, lowDimSpatialParams, couplingManager, "LowDim"); // the solution vector - using TestTraits = TestTraits<BulkProblemTypeTag, LowDimProblemTypeTag>; using MDTraits = typename TestTraits::MDTraits; using SolutionVector = typename MDTraits::SolutionVector; SolutionVector x; @@ -249,15 +253,9 @@ int main(int argc, char** argv) try auto couplingMapper = std::make_shared<typename TestTraits::CouplingMapper>(); couplingMapper->update(*bulkFvGridGeometry, *lowDimFvGridGeometry, gridManager.getEmbeddings()); - // the coupling manager - using CouplingManager = typename TestTraits::CouplingManager; - auto couplingManager = std::make_shared<CouplingManager>(); + // initialize the coupling manager couplingManager->init(bulkProblem, lowDimProblem, couplingMapper, x); - // set coupling manager pointer in sub-problems - bulkProblem->setCouplingManager(couplingManager); - lowDimProblem->setCouplingManager(couplingManager); - // the grid variables using BulkGridVariables = typename GET_PROP_TYPE(BulkProblemTypeTag, GridVariables); using LowDimGridVariables = typename GET_PROP_TYPE(LowDimProblemTypeTag, GridVariables); diff --git a/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh b/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh index be62c14f1d07c4c00474d670bfebf3f029b456f2..acf78c3f276736812cf7efc68879e397affcb154 100644 --- a/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh +++ b/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh @@ -95,8 +95,10 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> public: OnePBulkProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, + std::shared_ptr<CouplingManager> couplingManagerPtr, const std::string& paramGroup = "Bulk") : ParentType(fvGridGeometry, spatialParams, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) , lowDimPermeability_(getParam<Scalar>("LowDim.SpatialParams.Permeability")) , aperture_(getParam<Scalar>("Problem.FractureAperture")) { @@ -189,10 +191,6 @@ public: Scalar temperature() const { return 283.15; /*10°*/ } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManagerPtr_ = cm; } - //! returns reference to the coupling manager. const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } diff --git a/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh b/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh index 27474f6d33555b7e238998ca7dbe53d6a64a8c99..a2994affb00f4331141fae21126fcb970b5acecf 100644 --- a/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh +++ b/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh @@ -95,8 +95,10 @@ class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> public: OnePLowDimProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, + std::shared_ptr<CouplingManager> couplingManagerPtr, const std::string& paramGroup = "LowDim") : ParentType(fvGridGeometry, spatialParams, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) , aperture_(getParam<Scalar>("Problem.FractureAperture")) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); @@ -158,10 +160,6 @@ public: Scalar temperature() const { return 283.15; /*10°*/ } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManagerPtr_ = cm; } - //! returns reference to the coupling manager. const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } diff --git a/test/multidomain/facet/1p_1p/threedomain/main.cc b/test/multidomain/facet/1p_1p/threedomain/main.cc index ddc08ac3167f245a0a9e07f043584c4390114ab1..c15870ea83ad824bd73946a14b5c70d52ca0cc9a 100644 --- a/test/multidomain/facet/1p_1p/threedomain/main.cc +++ b/test/multidomain/facet/1p_1p/threedomain/main.cc @@ -122,16 +122,20 @@ int main(int argc, char** argv) try facetFvGridGeometry->update(); edgeFvGridGeometry->update(); + // the coupling manager + using CouplingManager = typename TestTraits::CouplingManager; + auto couplingManager = std::make_shared<CouplingManager>(); + // the problems (boundary conditions) using BulkProblem = typename GET_PROP_TYPE(BulkProblemTypeTag, Problem); using FacetProblem = typename GET_PROP_TYPE(FacetProblemTypeTag, Problem); using EdgeProblem = typename GET_PROP_TYPE(EdgeProblemTypeTag, Problem); auto bulkSpatialParams = std::make_shared<typename BulkProblem::SpatialParams>(bulkFvGridGeometry, "Bulk"); - auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, "Bulk"); + auto bulkProblem = std::make_shared<BulkProblem>(bulkFvGridGeometry, bulkSpatialParams, couplingManager, "Bulk"); auto facetSpatialParams = std::make_shared<typename FacetProblem::SpatialParams>(facetFvGridGeometry, "Facet"); - auto facetProblem = std::make_shared<FacetProblem>(facetFvGridGeometry, facetSpatialParams, "Facet"); + auto facetProblem = std::make_shared<FacetProblem>(facetFvGridGeometry, facetSpatialParams, couplingManager, "Facet"); auto edgeSpatialParams = std::make_shared<typename EdgeProblem::SpatialParams>(edgeFvGridGeometry, "Edge"); - auto edgeProblem = std::make_shared<EdgeProblem>(edgeFvGridGeometry, edgeSpatialParams, "Edge"); + auto edgeProblem = std::make_shared<EdgeProblem>(edgeFvGridGeometry, edgeSpatialParams, couplingManager, "Edge"); // the solution vector using Traits = typename TestTraits::MDTraits; @@ -153,16 +157,9 @@ int main(int argc, char** argv) try auto couplingMapper = std::make_shared<CouplingMapper>(); couplingMapper->update(*bulkFvGridGeometry, *facetFvGridGeometry, *edgeFvGridGeometry, gridManager.getEmbeddings()); - // the coupling manager - using CouplingManager = typename TestTraits::CouplingManager; - auto couplingManager = std::make_shared<CouplingManager>(); + // initialize the coupling manager couplingManager->init(bulkProblem, facetProblem, edgeProblem, couplingMapper, x); - // set coupling manager pointer in sub-problems - bulkProblem->setCouplingManager(couplingManager); - facetProblem->setCouplingManager(couplingManager); - edgeProblem->setCouplingManager(couplingManager); - // the grid variables using BulkGridVariables = typename GET_PROP_TYPE(BulkProblemTypeTag, GridVariables); using FacetGridVariables = typename GET_PROP_TYPE(FacetProblemTypeTag, GridVariables); diff --git a/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh b/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh index 49699ac073dfc2927d1230e5b9c61f0511c053a2..9b201894353dc7a59f15bdf075275b006e6056eb 100644 --- a/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh @@ -96,8 +96,10 @@ public: //! The constructor OnePBulkProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, + std::shared_ptr<CouplingManager> couplingManagerPtr, const std::string& paramGroup = "Bulk") : ParentType(fvGridGeometry, spatialParams, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); } @@ -157,10 +159,6 @@ public: const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManagerPtr_ = cm; } - private: std::string problemName_; std::shared_ptr<CouplingManager> couplingManagerPtr_; diff --git a/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh b/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh index 1274935d2f9acdc6b6843c6d7af9986fdb8ea235..d48f46f4ec98a16060d9268be2984ed32578096a 100644 --- a/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh @@ -100,8 +100,10 @@ public: //! The constructor OnePEdgeProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, + std::shared_ptr<CouplingManager> couplingManagerPtr, const std::string& paramGroup = "Edge") : ParentType(fvGridGeometry, spatialParams, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) { const auto a = getParam<Scalar>("Extrusion.Aperture"); exFactor_ = a*a; @@ -155,14 +157,10 @@ public: const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManagerPtr_ = cm; } - private: - Scalar exFactor_; - std::string problemName_; std::shared_ptr<CouplingManager> couplingManagerPtr_; + std::string problemName_; + Scalar exFactor_; }; } // end namespace Dumux diff --git a/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh b/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh index 6da834a064c4df28e9eaa0404de63a1858f240bb..f56e7f63abd7ff2a10f9fbb3ead7779af6006836 100644 --- a/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh @@ -100,8 +100,10 @@ public: //! The constructor OnePFacetProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, + std::shared_ptr<CouplingManager> couplingManagerPtr, const std::string& paramGroup = "Facet") : ParentType(fvGridGeometry, spatialParams, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) , aperture_(getParam<Scalar>("Extrusion.Aperture")) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); @@ -169,14 +171,10 @@ public: const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<CouplingManager> cm) - { couplingManagerPtr_ = cm; } - private: - Scalar aperture_; - std::string problemName_; std::shared_ptr<CouplingManager> couplingManagerPtr_; + std::string problemName_; + Scalar aperture_; }; } // end namespace Dumux diff --git a/test/multidomain/poromechanics/el1p/main.cc b/test/multidomain/poromechanics/el1p/main.cc index ad01e468a992239f32deedbed20cb421a1def983..4f9527ac97721abf3c972984987bd56daf312fb7 100644 --- a/test/multidomain/poromechanics/el1p/main.cc +++ b/test/multidomain/poromechanics/el1p/main.cc @@ -112,14 +112,19 @@ int main(int argc, char** argv) try onePFvGridGeometry->update(); poroMechFvGridGeometry->update(); + // the coupling manager + using Traits = MultiDomainTraits<OnePTypeTag, PoroMechTypeTag>; + using CouplingManager = PoroMechanicsCouplingManager<Traits>; + auto couplingManager = std::make_shared<CouplingManager>(); + // the problems (boundary conditions) using OnePProblem = typename GET_PROP_TYPE(OnePTypeTag, Problem); using PoroMechProblem = typename GET_PROP_TYPE(PoroMechTypeTag, Problem); - auto onePProblem = std::make_shared<OnePProblem>(onePFvGridGeometry, "OneP"); - auto poroMechProblem = std::make_shared<PoroMechProblem>(poroMechFvGridGeometry, "PoroElastic"); + auto onePSpatialParams = std::make_shared<typename OnePProblem::SpatialParams>(onePFvGridGeometry, couplingManager); + auto onePProblem = std::make_shared<OnePProblem>(onePFvGridGeometry, onePSpatialParams, "OneP"); + auto poroMechProblem = std::make_shared<PoroMechProblem>(poroMechFvGridGeometry, couplingManager, "PoroElastic"); // the solution vectors - using Traits = MultiDomainTraits<OnePTypeTag, PoroMechTypeTag>; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; @@ -131,16 +136,9 @@ int main(int argc, char** argv) try poroMechProblem->applyInitialSolution(x[poroMechId]); SolutionVector xOld = x; - // the coupling manager - using CouplingManager = PoroMechanicsCouplingManager<Traits>; - auto couplingManager = std::make_shared<CouplingManager>(); + // initialize the coupling manager couplingManager->init(onePProblem, poroMechProblem, x); - // set coupling manager pointer in sub-problems - // (in 1p problem the coupling enters in the parameters) - onePProblem->spatialParams().setCouplingManager(couplingManager); - poroMechProblem->setCouplingManager(couplingManager); - // the grid variables using OnePGridVariables = typename GET_PROP_TYPE(OnePTypeTag, GridVariables); using PoroMechGridVariables = typename GET_PROP_TYPE(PoroMechTypeTag, GridVariables); diff --git a/test/multidomain/poromechanics/el1p/problem_1p.hh b/test/multidomain/poromechanics/el1p/problem_1p.hh index 72f743bbf1bc3b462e5f5f92caa88bb6b30c024e..d61571d9050687bc084dfd23353a967a46236186 100644 --- a/test/multidomain/poromechanics/el1p/problem_1p.hh +++ b/test/multidomain/poromechanics/el1p/problem_1p.hh @@ -94,8 +94,10 @@ class OnePSubProblem : public PorousMediumFlowProblem<TypeTag> using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - OnePSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "OneP") - : ParentType(fvGridGeometry, paramGroup) + OnePSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<typename GET_PROP_TYPE(TypeTag, SpatialParams)> spatialParams, + const std::string& paramGroup = "OneP") + : ParentType(fvGridGeometry, spatialParams, paramGroup) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); } diff --git a/test/multidomain/poromechanics/el1p/problem_poroelastic.hh b/test/multidomain/poromechanics/el1p/problem_poroelastic.hh index f486a52b74701e8e1c8db754c218531b6f759214..6b451488172e58cce6c906f97f021ab673c77567 100644 --- a/test/multidomain/poromechanics/el1p/problem_poroelastic.hh +++ b/test/multidomain/poromechanics/el1p/problem_poroelastic.hh @@ -94,8 +94,11 @@ class PoroElasticSubProblem : public GeomechanicsFVProblem<TypeTag> public: //! The constructor - PoroElasticSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "PoroElastic") + PoroElasticSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<CouplingManager> couplingManagerPtr, + const std::string& paramGroup = "PoroElastic") : ParentType(fvGridGeometry, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); } @@ -176,10 +179,6 @@ public: const SubControlVolume& scv) const { return PrimaryVariables(0.0); } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<const CouplingManager> cm) - { couplingManagerPtr_ = cm; } - //! returns reference to the coupling manager. const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } diff --git a/test/multidomain/poromechanics/el1p/spatialparams_1p.hh b/test/multidomain/poromechanics/el1p/spatialparams_1p.hh index 05cd1360a3a14d478f512ab66dd1e9fd62d0a44b..a83e2160ca8dd8398578b37f18a3b4876dcceec4 100644 --- a/test/multidomain/poromechanics/el1p/spatialparams_1p.hh +++ b/test/multidomain/poromechanics/el1p/spatialparams_1p.hh @@ -58,8 +58,10 @@ public: // export permeability type using PermeabilityType = Scalar; - OnePSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + OnePSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<CouplingManager> couplingManagerPtr) : ParentType(fvGridGeometry) + , couplingManagerPtr_(couplingManagerPtr) , permeability_(getParam<Scalar>("SpatialParams.Permeability")) , initPorosity_(getParam<Scalar>("SpatialParams.InitialPorosity")) {} @@ -83,10 +85,6 @@ public: return PorosityDeformation<Scalar>::evaluatePorosity(poroMechGridGeom, element, scv.center(), poroMechElemSol, initPorosity_); } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<const CouplingManager> cm) - { couplingManagerPtr_ = cm; } - //! returns reference to the coupling manager. const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } diff --git a/test/multidomain/poromechanics/el2p/main.cc b/test/multidomain/poromechanics/el2p/main.cc index 99283f58147fa1186d8b1c3a0b65a8124db5fca7..7faac67223574ef6d725d977c82cbda8d6f4c8a9 100644 --- a/test/multidomain/poromechanics/el2p/main.cc +++ b/test/multidomain/poromechanics/el2p/main.cc @@ -114,14 +114,19 @@ int main(int argc, char** argv) try twoPFvGridGeometry->update(); poroMechFvGridGeometry->update(); + // the coupling manager + using Traits = MultiDomainTraits<TwoPTypeTag, PoroMechTypeTag>; + using CouplingManager = PoroMechanicsCouplingManager<Traits>; + auto couplingManager = std::make_shared<CouplingManager>(); + // the problems (boundary conditions) using TwoPProblem = typename GET_PROP_TYPE(TwoPTypeTag, Problem); using PoroMechProblem = typename GET_PROP_TYPE(PoroMechTypeTag, Problem); - auto twoPProblem = std::make_shared<TwoPProblem>(twoPFvGridGeometry, "TwoP"); - auto poroMechProblem = std::make_shared<PoroMechProblem>(poroMechFvGridGeometry, "PoroElastic"); + auto twoPSpatialParams = std::make_shared<typename TwoPProblem::SpatialParams>(twoPFvGridGeometry, couplingManager); + auto twoPProblem = std::make_shared<TwoPProblem>(twoPFvGridGeometry, twoPSpatialParams, "TwoP"); + auto poroMechProblem = std::make_shared<PoroMechProblem>(poroMechFvGridGeometry, couplingManager, "PoroElastic"); // the solution vectors - using Traits = MultiDomainTraits<TwoPTypeTag, PoroMechTypeTag>; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; @@ -133,16 +138,9 @@ int main(int argc, char** argv) try poroMechProblem->applyInitialSolution(x[poroMechId]); SolutionVector xOld = x; - // the coupling manager - using CouplingManager = PoroMechanicsCouplingManager<Traits>; - auto couplingManager = std::make_shared<CouplingManager>(); + // initialize the coupling manager couplingManager->init(twoPProblem, poroMechProblem, x); - // set coupling manager pointer in sub-problems - // (in 1p problem the coupling enters in the parameters) - twoPProblem->spatialParams().setCouplingManager(couplingManager); - poroMechProblem->setCouplingManager(couplingManager); - // the grid variables using TwoPGridVariables = typename GET_PROP_TYPE(TwoPTypeTag, GridVariables); using PoroMechGridVariables = typename GET_PROP_TYPE(PoroMechTypeTag, GridVariables); diff --git a/test/multidomain/poromechanics/el2p/problem_2p.hh b/test/multidomain/poromechanics/el2p/problem_2p.hh index 27e9ead2a697628addb5f0ca7bf77211dc49a959..fd6f019cbf92cb4e7c69f9176c9a86086f2bf8da 100644 --- a/test/multidomain/poromechanics/el2p/problem_2p.hh +++ b/test/multidomain/poromechanics/el2p/problem_2p.hh @@ -102,8 +102,10 @@ class TwoPSubProblem : public PorousMediumFlowProblem<TypeTag> using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - TwoPSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "TwoP") - : ParentType(fvGridGeometry, paramGroup) + TwoPSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<typename GET_PROP_TYPE(TypeTag, SpatialParams)> spatialParams, + const std::string& paramGroup = "TwoP") + : ParentType(fvGridGeometry, spatialParams, paramGroup) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); } diff --git a/test/multidomain/poromechanics/el2p/problem_poroelastic.hh b/test/multidomain/poromechanics/el2p/problem_poroelastic.hh index 87da93277ef906cbd8288eef3507d9b668fe5941..e59622d4b1dfd57e471b60997261adc2a6983513 100644 --- a/test/multidomain/poromechanics/el2p/problem_poroelastic.hh +++ b/test/multidomain/poromechanics/el2p/problem_poroelastic.hh @@ -98,8 +98,11 @@ class PoroElasticSubProblem : public GeomechanicsFVProblem<TypeTag> public: //! The constructor - PoroElasticSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "PoroElastic") + PoroElasticSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<CouplingManager> couplingManagerPtr, + const std::string& paramGroup = "PoroElastic") : ParentType(fvGridGeometry, paramGroup) + , couplingManagerPtr_(couplingManagerPtr) { problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); } @@ -191,10 +194,6 @@ public: const SubControlVolume& scv) const { return PrimaryVariables(0.0); } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<const CouplingManager> cm) - { couplingManagerPtr_ = cm; } - //! returns reference to the coupling manager. const CouplingManager& couplingManager() const { return *couplingManagerPtr_; } diff --git a/test/multidomain/poromechanics/el2p/spatialparams_2p.hh b/test/multidomain/poromechanics/el2p/spatialparams_2p.hh index dba8188a7f505a2c45bfc1f9827c0f02f678dbce..b03cbd8bff711de27f8cb3c7a042f1e780db6aac 100644 --- a/test/multidomain/poromechanics/el2p/spatialparams_2p.hh +++ b/test/multidomain/poromechanics/el2p/spatialparams_2p.hh @@ -62,8 +62,10 @@ public: // export permeability type using PermeabilityType = Scalar; - TwoPSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + TwoPSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<CouplingManager> couplingManagerPtr) : ParentType(fvGridGeometry) + , couplingManagerPtr_(couplingManagerPtr) , initPermeability_(getParam<Scalar>("SpatialParams.Permeability")) , initPorosity_(getParam<Scalar>("SpatialParams.InitialPorosity")) { @@ -137,10 +139,6 @@ public: return FluidSystem::phase0Idx; } - //! sets the pointer to the coupling manager. - void setCouplingManager(std::shared_ptr<const CouplingManager> cm) - { couplingManagerPtr_ = cm; } - //! returns reference to the coupling manager. const CouplingManager& couplingManager() const { return *couplingManagerPtr_; }