diff --git a/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp b/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp index 13f816c95d1535b9b631e1a337b2d98dc3017019..ad1043992692b30dfb70f798d16dd8a107ff151c 100644 --- a/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp +++ b/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp @@ -38,8 +38,7 @@ std::unique_ptr<Process> createGroundwaterFlowProcess( "process_variable"}); // Hydraulic conductivity parameter. - auto& hydraulic_conductivity = findParameter<double, - MeshLib::Element const&>( + auto& hydraulic_conductivity = findParameter<double>( config, //! \ogs_file_param_special{process__GROUNDWATER_FLOW__hydraulic_conductivity} "hydraulic_conductivity", diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h index 8f1f8b3be89b2748b60273af3ba362b91b0b4d5e..ad3e99e587a542a1164af86ed785defdd7e90bc0 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h @@ -81,7 +81,7 @@ public: } void assembleConcrete( - double const /*t*/, std::vector<double> const& local_x, + double const t, std::vector<double> const& local_x, NumLib::LocalToGlobalIndexMap::RowColumnIndices const& indices, GlobalMatrix& /*M*/, GlobalMatrix& K, GlobalVector& b) override { @@ -91,11 +91,15 @@ public: IntegrationMethod integration_method(_integration_order); unsigned const n_integration_points = integration_method.getNumberOfPoints(); - for (std::size_t ip(0); ip < n_integration_points; ip++) + SpatialPosition pos; + pos.setElementID(_element.getID()); + + for (unsigned ip = 0; ip < n_integration_points; ip++) { + pos.setIntegrationPoint(ip); auto const& sm = _shape_matrices[ip]; auto const& wp = integration_method.getWeightedPoint(ip); - auto const k = _process_data.hydraulic_conductivity(_element); + auto const k = _process_data.hydraulic_conductivity.getTuple(t, pos).front(); _localA.noalias() += sm.dNdx.transpose() * k * sm.dNdx * sm.detJ * wp.getWeight(); diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcessData.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcessData.h index d148011b142446a696354961f6ee882072d94659..e289867d5ca9481c483dafd17d4083f792f72bd2 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcessData.h +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcessData.h @@ -19,7 +19,7 @@ namespace MeshLib namespace ProcessLib { -template <typename ReturnType, typename... Args> +template <typename T> struct Parameter; namespace GroundwaterFlow @@ -28,9 +28,7 @@ namespace GroundwaterFlow struct GroundwaterFlowProcessData { GroundwaterFlowProcessData( - ProcessLib::Parameter<double, MeshLib::Element const&> const& - hydraulic_conductivity_ - ) + Parameter<double> const& hydraulic_conductivity_) : hydraulic_conductivity(hydraulic_conductivity_) {} @@ -47,7 +45,7 @@ struct GroundwaterFlowProcessData //! Assignments are not needed. void operator=(GroundwaterFlowProcessData&&) = delete; - Parameter<double, MeshLib::Element const&> const& hydraulic_conductivity; + Parameter<double> const& hydraulic_conductivity; }; } // namespace GroundwaterFlow diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h index b3ca1c3479d98ccf693dfcda5c20b114531aa5df..37aebe503ed970ec987019a60659a0c08478a858 100644 --- a/ProcessLib/Process.h +++ b/ProcessLib/Process.h @@ -226,8 +226,8 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( /// \endcode /// and return a reference to that parameter. Additionally it checks for the /// type of the found parameter. -template <typename... ParameterArgs> -Parameter<ParameterArgs...>& findParameter( +template <typename ParameterDataType> +Parameter<ParameterDataType>& findParameter( BaseLib::ConfigTree const& process_config, std::string const& tag, std::vector<std::unique_ptr<ParameterBase>> const& parameters) { @@ -252,7 +252,7 @@ Parameter<ParameterArgs...>& findParameter( // Check the type correctness of the found parameter. auto* const parameter = - dynamic_cast<Parameter<ParameterArgs...>*>(parameter_it->get()); + dynamic_cast<Parameter<ParameterDataType>*>(parameter_it->get()); if (!parameter) { OGS_FATAL("The read parameter is of incompatible type."); }