Skip to content
Snippets Groups Projects
Unverified Commit 066e74bb authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #2960 from TomFischer/MPLRenameConstantProperty

[MPL] Rename MPL::XProperty to MPL::X for consistency.
parents 1d2108f1 c42da86b
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 32 deletions
\copydoc MaterialPropertyLib::CurveProperty
\copydoc MaterialPropertyLib::Curve
\copydoc MaterialPropertyLib::CurveProperty::independent_variable_
\copydoc MaterialPropertyLib::Curve::independent_variable_
Definition of a exponential property:
\f$y(x) = y_{\textrm{ref}} \exp(f (x - x_{\textrm{ref}})\f$
\f$y(x) = y_{\textrm{ref}} \exp(m (x - x_{\textrm{ref}}))\f$
where
- \f$y_{\textrm{ref}}\f$ is a reference value, for instance reference viscosity
- \f$m\f$ is a factor influencing the exponent of the exponential relationship
......
Definition of a linear property:
\f$y(x_{i}) = y_{\textrm{ref}} (1 + \sum_{i=1}^{n} m_{i} (x_{i} - x_{i,\textrm{ref}})\f$
\f$y(x_{i}) = y_{\textrm{ref}} \left(1 + \sum_{i=1}^{n} m_{i} (x_{i} - x_{i,\textrm{ref}})\right)\f$
where
- \f$x_{i}\f$ can be a number of dependent variables, for instance temperature, pressure
- \f$y_{\textrm{ref}}\f$ is a reference value, for instance reference density
......
......@@ -45,16 +45,16 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty(
}
if (property_type == "Curve")
{
return createCurveProperty(config, curves);
return createCurve(config, curves);
}
if (property_type == "Linear")
{
return createLinearProperty(config);
return createLinear(config);
}
if (property_type == "Exponential")
{
return createExponentialProperty(config);
return createExponential(config);
}
if (property_type == "Parameter")
......
......@@ -8,17 +8,17 @@
*
*/
#include "CreateCurveProperty.h"
#include "CreateCurve.h"
#include "BaseLib/Algorithm.h"
#include "BaseLib/ConfigTree.h"
#include "CurveProperty.h"
#include "Curve.h"
#include "MaterialLib/MPL/VariableType.h"
#include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h"
namespace MaterialPropertyLib
{
std::unique_ptr<CurveProperty> createCurveProperty(
std::unique_ptr<Curve> createCurve(
BaseLib::ConfigTree const& config,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
......@@ -31,7 +31,7 @@ std::unique_ptr<CurveProperty> createCurveProperty(
//! \ogs_file_param{properties__property__name}
auto property_name = config.peekConfigParameter<std::string>("name");
DBUG("Create CurveProperty {:s}.", property_name);
DBUG("Create Curve {:s}.", property_name);
//! \ogs_file_param{properties__property__Curve__curve}
auto curve_name = config.getConfigParameter<std::string>("curve");
......@@ -48,7 +48,7 @@ std::unique_ptr<CurveProperty> createCurveProperty(
MaterialPropertyLib::convertStringToVariable(
independent_variable_string);
return std::make_unique<CurveProperty>(
return std::make_unique<Curve>(
std::move(property_name), independent_variable, curve);
}
......
......@@ -26,9 +26,9 @@ class PiecewiseLinearInterpolation;
namespace MaterialPropertyLib
{
class CurveProperty;
class Curve;
std::unique_ptr<CurveProperty> createCurveProperty(
std::unique_ptr<Curve> createCurve(
BaseLib::ConfigTree const& config,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
......
......@@ -11,11 +11,11 @@
*/
#include "BaseLib/ConfigTree.h"
#include "ExponentialProperty.h"
#include "Exponential.h"
namespace MaterialPropertyLib
{
std::unique_ptr<ExponentialProperty> createExponentialProperty(
std::unique_ptr<Exponential> createExponential(
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{properties__property__type}
......@@ -27,21 +27,21 @@ std::unique_ptr<ExponentialProperty> createExponentialProperty(
DBUG("Create Exponential property {:s}.", property_name);
auto const reference_value =
//! \ogs_file_param{properties__property__ExponentialProperty__reference_value}
//! \ogs_file_param{properties__property__Exponential__reference_value}
config.getConfigParameter<double>("reference_value");
auto const& exponent_data_config =
//! \ogs_file_param{properties__property__ExponentialProperty__exponent}
//! \ogs_file_param{properties__property__Exponential__exponent}
config.getConfigSubtree("exponent");
auto const& variable_name =
//! \ogs_file_param{properties__property__ExponentialProperty__exponent__variable_name}
//! \ogs_file_param{properties__property__Exponential__exponent__variable_name}
exponent_data_config.getConfigParameter<std::string>("variable_name");
auto const reference_condition =
//! \ogs_file_param{properties__property__ExponentialProperty__exponent__reference_condition}
//! \ogs_file_param{properties__property__Exponential__exponent__reference_condition}
exponent_data_config.getConfigParameter<double>("reference_condition");
auto const factor =
//! \ogs_file_param{properties__property__ExponentialProperty__exponent__factor}
//! \ogs_file_param{properties__property__Exponential__exponent__factor}
exponent_data_config.getConfigParameter<double>("factor");
MaterialPropertyLib::Variable exp_data_type =
......@@ -50,7 +50,7 @@ std::unique_ptr<ExponentialProperty> createExponentialProperty(
MaterialPropertyLib::ExponentData const exp_data{
exp_data_type, reference_condition, factor};
return std::make_unique<MaterialPropertyLib::ExponentialProperty>(
return std::make_unique<MaterialPropertyLib::Exponential>(
std::move(property_name), reference_value, exp_data);
}
} // namespace MaterialPropertyLib
......@@ -21,11 +21,11 @@ class ConfigTree;
namespace MaterialPropertyLib
{
class LinearProperty;
class Exponential;
}
namespace MaterialPropertyLib
{
std::unique_ptr<LinearProperty> createLinearProperty(
std::unique_ptr<Exponential> createExponential(
BaseLib::ConfigTree const& config);
} // namespace MaterialPropertyLib
......@@ -11,11 +11,11 @@
*/
#include "BaseLib/ConfigTree.h"
#include "LinearProperty.h"
#include "Linear.h"
namespace MaterialPropertyLib
{
std::unique_ptr<LinearProperty> createLinearProperty(
std::unique_ptr<Linear> createLinear(
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{properties__property__type}
......@@ -27,25 +27,25 @@ std::unique_ptr<LinearProperty> createLinearProperty(
DBUG("Create Linear property {:s}.", property_name);
auto const reference_value =
//! \ogs_file_param{properties__property__LinearProperty__reference_value}
//! \ogs_file_param{properties__property__Linear__reference_value}
config.getConfigParameter<double>("reference_value");
std::vector<MaterialPropertyLib::IndependentVariable> ivs;
for (
auto const& independent_variable_config :
//! \ogs_file_param{properties__property__LinearProperty__independent_variable}
//! \ogs_file_param{properties__property__Linear__independent_variable}
config.getConfigSubtreeList("independent_variable"))
{
auto const& variable_name =
//! \ogs_file_param{properties__property__LinearProperty__independent_variable__variable_name}
//! \ogs_file_param{properties__property__Linear__independent_variable__variable_name}
independent_variable_config.getConfigParameter<std::string>(
"variable_name");
auto const reference_condition =
//! \ogs_file_param{properties__property__LinearProperty__independent_variable__reference_condition}
//! \ogs_file_param{properties__property__Linear__independent_variable__reference_condition}
independent_variable_config.getConfigParameter<double>(
"reference_condition");
auto const slope =
//! \ogs_file_param{properties__property__LinearProperty__independent_variable__slope}
//! \ogs_file_param{properties__property__Linear__independent_variable__slope}
independent_variable_config.getConfigParameter<double>("slope");
MaterialPropertyLib::Variable ivt =
......@@ -57,7 +57,7 @@ std::unique_ptr<LinearProperty> createLinearProperty(
ivs.push_back(std::move(iv));
}
return std::make_unique<MaterialPropertyLib::LinearProperty>(
return std::make_unique<MaterialPropertyLib::Linear>(
std::move(property_name), reference_value, ivs);
}
} // namespace MaterialPropertyLib
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