Skip to content
Snippets Groups Projects
Commit a406436e authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[PL] addapted to changed parameter interface

parent 380c4e7c
No related branches found
No related tags found
No related merge requests found
...@@ -38,8 +38,7 @@ std::unique_ptr<Process> createGroundwaterFlowProcess( ...@@ -38,8 +38,7 @@ std::unique_ptr<Process> createGroundwaterFlowProcess(
"process_variable"}); "process_variable"});
// Hydraulic conductivity parameter. // Hydraulic conductivity parameter.
auto& hydraulic_conductivity = findParameter<double, auto& hydraulic_conductivity = findParameter<double>(
MeshLib::Element const&>(
config, config,
//! \ogs_file_param_special{process__GROUNDWATER_FLOW__hydraulic_conductivity} //! \ogs_file_param_special{process__GROUNDWATER_FLOW__hydraulic_conductivity}
"hydraulic_conductivity", "hydraulic_conductivity",
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
} }
void assembleConcrete( 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, NumLib::LocalToGlobalIndexMap::RowColumnIndices const& indices,
GlobalMatrix& /*M*/, GlobalMatrix& K, GlobalVector& b) override GlobalMatrix& /*M*/, GlobalMatrix& K, GlobalVector& b) override
{ {
...@@ -91,11 +91,15 @@ public: ...@@ -91,11 +91,15 @@ public:
IntegrationMethod integration_method(_integration_order); IntegrationMethod integration_method(_integration_order);
unsigned const n_integration_points = integration_method.getNumberOfPoints(); 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& sm = _shape_matrices[ip];
auto const& wp = integration_method.getWeightedPoint(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 * _localA.noalias() += sm.dNdx.transpose() * k * sm.dNdx *
sm.detJ * wp.getWeight(); sm.detJ * wp.getWeight();
......
...@@ -19,7 +19,7 @@ namespace MeshLib ...@@ -19,7 +19,7 @@ namespace MeshLib
namespace ProcessLib namespace ProcessLib
{ {
template <typename ReturnType, typename... Args> template <typename T>
struct Parameter; struct Parameter;
namespace GroundwaterFlow namespace GroundwaterFlow
...@@ -28,9 +28,7 @@ namespace GroundwaterFlow ...@@ -28,9 +28,7 @@ namespace GroundwaterFlow
struct GroundwaterFlowProcessData struct GroundwaterFlowProcessData
{ {
GroundwaterFlowProcessData( GroundwaterFlowProcessData(
ProcessLib::Parameter<double, MeshLib::Element const&> const& Parameter<double> const& hydraulic_conductivity_)
hydraulic_conductivity_
)
: hydraulic_conductivity(hydraulic_conductivity_) : hydraulic_conductivity(hydraulic_conductivity_)
{} {}
...@@ -47,7 +45,7 @@ struct GroundwaterFlowProcessData ...@@ -47,7 +45,7 @@ struct GroundwaterFlowProcessData
//! Assignments are not needed. //! Assignments are not needed.
void operator=(GroundwaterFlowProcessData&&) = delete; void operator=(GroundwaterFlowProcessData&&) = delete;
Parameter<double, MeshLib::Element const&> const& hydraulic_conductivity; Parameter<double> const& hydraulic_conductivity;
}; };
} // namespace GroundwaterFlow } // namespace GroundwaterFlow
......
...@@ -226,8 +226,8 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( ...@@ -226,8 +226,8 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables(
/// \endcode /// \endcode
/// and return a reference to that parameter. Additionally it checks for the /// and return a reference to that parameter. Additionally it checks for the
/// type of the found parameter. /// type of the found parameter.
template <typename... ParameterArgs> template <typename ParameterDataType>
Parameter<ParameterArgs...>& findParameter( Parameter<ParameterDataType>& findParameter(
BaseLib::ConfigTree const& process_config, std::string const& tag, BaseLib::ConfigTree const& process_config, std::string const& tag,
std::vector<std::unique_ptr<ParameterBase>> const& parameters) std::vector<std::unique_ptr<ParameterBase>> const& parameters)
{ {
...@@ -252,7 +252,7 @@ Parameter<ParameterArgs...>& findParameter( ...@@ -252,7 +252,7 @@ Parameter<ParameterArgs...>& findParameter(
// Check the type correctness of the found parameter. // Check the type correctness of the found parameter.
auto* const parameter = auto* const parameter =
dynamic_cast<Parameter<ParameterArgs...>*>(parameter_it->get()); dynamic_cast<Parameter<ParameterDataType>*>(parameter_it->get());
if (!parameter) { if (!parameter) {
OGS_FATAL("The read parameter is of incompatible type."); OGS_FATAL("The read parameter is of incompatible type.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment