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(
"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",
......
......@@ -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();
......
......@@ -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
......
......@@ -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.");
}
......
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