Revision e5fbe5fa1fc33ad948556e4f395f02fa09818127 authored by Thomas Fischer on 19 May 2021, 14:07:31 UTC, committed by Thomas Fischer on 31 May 2021, 04:21:07 UTC
The node polygon is managed externally.
1 parent 760886f
CurveScaledParameter.cpp
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "CurveScaledParameter.h"
#include "Utils.h"
namespace ParameterLib
{
std::unique_ptr<ParameterBase> createCurveScaledParameter(
std::string const& name,
BaseLib::ConfigTree const& config,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves)
{
//! \ogs_file_param{prj__parameters__parameter__type}
config.checkConfigParameter("type", "CurveScaled");
//! \ogs_file_param{prj__parameters__parameter__CurveScaled__curve}
auto curve_name = config.getConfigParameter<std::string>("curve");
DBUG("Using curve {:s}", curve_name);
auto const curve_it = curves.find(curve_name);
if (curve_it == curves.end())
{
OGS_FATAL("Curve `{:s}' does not exists.", curve_name);
}
auto referenced_parameter_name =
//! \ogs_file_param{prj__parameters__parameter__CurveScaled__parameter}
config.getConfigParameter<std::string>("parameter");
DBUG("Using parameter {:s}", referenced_parameter_name);
// TODO other data types than only double
return std::make_unique<CurveScaledParameter<double>>(
name, *curve_it->second, referenced_parameter_name);
}
} // namespace ParameterLib
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...