diff --git a/ProcessLib/BoundaryCondition/DeactivatedSubdomainDirichlet.cpp b/ProcessLib/BoundaryCondition/DeactivatedSubdomainDirichlet.cpp index 1157f26d47e9fa384c57c64315449dce891d27b4..8848b9d6116ed1efe7ad3e66fab17f6a18393e99 100644 --- a/ProcessLib/BoundaryCondition/DeactivatedSubdomainDirichlet.cpp +++ b/ProcessLib/BoundaryCondition/DeactivatedSubdomainDirichlet.cpp @@ -28,7 +28,7 @@ DeactivatedSubdomainDirichlet::DeactivatedSubdomainDirichlet( _subdomain(subdomain), _variable_id(variable_id), _component_id(component_id), - _time_interval(time_interval), + _time_interval(std::move(time_interval)), _active_element_ids(active_element_ids) { config(dof_table_bulk); diff --git a/ProcessLib/CreateDeactivatedSubdomain.cpp b/ProcessLib/CreateDeactivatedSubdomain.cpp index 3e6a80d99c679933b8743155e66526b038a3a387..74fb1ef0429cc44d6cb5101bbda80d63d4611ab2 100644 --- a/ProcessLib/CreateDeactivatedSubdomain.cpp +++ b/ProcessLib/CreateDeactivatedSubdomain.cpp @@ -119,6 +119,8 @@ static MathLib::PiecewiseLinearInterpolation parseTimeIntervalOrCurve( if (curve_name) { DBUG("Using curve '{:s}'", *curve_name); + // Return a copy of the curve because the time interval in the other + // branch returns a temporary. return *BaseLib::getOrError(curves, *curve_name, "Could not find curve."); } @@ -174,7 +176,7 @@ std::unique_ptr<DeactivatedSubdomain const> createDeactivatedSubdomain( auto const& curve_name = //! \ogs_file_param{prj__process_variables__process_variable__deactivated_subdomains__deactivated_subdomain__time_curve} config.getConfigParameterOptional<std::string>("time_curve"); - auto const time_interval = + auto time_interval = parseTimeIntervalOrCurve(time_interval_config, curve_name, curves); auto const line_segment_config =