diff --git a/MaterialLib/MPL/CreateComponent.h b/MaterialLib/MPL/CreateComponent.h index ab092b8dc2023ac6abf451c0ffdf86d2921cba4f..74c10d06ca6771322042bc4734464f34253e3d69 100644 --- a/MaterialLib/MPL/CreateComponent.h +++ b/MaterialLib/MPL/CreateComponent.h @@ -25,7 +25,6 @@ namespace ParameterLib struct ParameterBase; } - namespace MaterialPropertyLib { /// The method creates components based on config subtree. diff --git a/MaterialLib/MPL/CreateMedium.h b/MaterialLib/MPL/CreateMedium.h index ebb36255d4f971afab68402193cd85a8b32b9a7e..2ac2904026087ca3b4420652a623e2b04a16f6c7 100644 --- a/MaterialLib/MPL/CreateMedium.h +++ b/MaterialLib/MPL/CreateMedium.h @@ -35,5 +35,6 @@ namespace MaterialPropertyLib /// assigned. std::unique_ptr<Medium> createMedium( BaseLib::ConfigTree const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters); + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& + parameters); } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/CreateProperty.h b/MaterialLib/MPL/CreateProperty.h index 8db96040da8f98748c0f248d3394bdc82d370ee6..ddc72c39bbbf10e31b522770ec5b458baa137efe 100644 --- a/MaterialLib/MPL/CreateProperty.h +++ b/MaterialLib/MPL/CreateProperty.h @@ -25,7 +25,6 @@ namespace ParameterLib struct ParameterBase; } - namespace MaterialPropertyLib { class Property; diff --git a/MaterialLib/MPL/Properties/CreateConstant.h b/MaterialLib/MPL/Properties/CreateConstant.h index 5919cdb472d41ea5bfa485b649dd9d5117d0c3c7..60f5b81e2875dc2b162804aec2c7f39aad16cc39 100644 --- a/MaterialLib/MPL/Properties/CreateConstant.h +++ b/MaterialLib/MPL/Properties/CreateConstant.h @@ -25,6 +25,5 @@ class Constant; namespace MaterialPropertyLib { -std::unique_ptr<Constant> createConstant( - BaseLib::ConfigTree const& config); +std::unique_ptr<Constant> createConstant(BaseLib::ConfigTree const& config); } // namespace MaterialPropertyLib \ No newline at end of file diff --git a/MaterialLib/MPL/Properties/CreateExponentialProperty.cpp b/MaterialLib/MPL/Properties/CreateExponentialProperty.cpp index 262bf0b702b73f9ca5736dae6be3ebcfb40e1f7b..4aead81523ef891c27488b490e30d940d0e0acda 100644 --- a/MaterialLib/MPL/Properties/CreateExponentialProperty.cpp +++ b/MaterialLib/MPL/Properties/CreateExponentialProperty.cpp @@ -21,34 +21,31 @@ std::unique_ptr<ExponentialProperty> createExponentialProperty( { config.checkConfigParameter("type", "Exponential"); DBUG("Create Exponential property"); - auto const reference_value = - //! \ogs_file_param{properties__property__ExponentialProperty__reference_value} - config.getConfigParameter<double>("reference_value"); - - auto const& exponent_data_config = - //! \ogs_file_param{properties__property__ExponentialProperty__exponent} - config.getConfigSubtree("exponent"); - - auto const& variable_name = - //! \ogs_file_param{properties__property__ExponentialProperty__exponent__variable_name} - exponent_data_config.getConfigParameter<std::string>( - "variable_name"); - auto const reference_condition = - //! \ogs_file_param{properties__property__ExponentialProperty__exponent__reference_condition} - exponent_data_config.getConfigParameter<double>( - "reference_condition"); - auto const factor = - //! \ogs_file_param{properties__property__ExponentialProperty__exponent__factor} - exponent_data_config.getConfigParameter<double>("factor"); - - MaterialPropertyLib::Variable exp_data_type = - MaterialPropertyLib::convertStringToVariable(variable_name); - - MaterialPropertyLib::ExponentData const exp_data{ - exp_data_type, reference_condition, factor}; - - return std::make_unique<MaterialPropertyLib::ExponentialProperty>( - reference_value, exp_data); - + auto const reference_value = + //! \ogs_file_param{properties__property__ExponentialProperty__reference_value} + config.getConfigParameter<double>("reference_value"); + + auto const& exponent_data_config = + //! \ogs_file_param{properties__property__ExponentialProperty__exponent} + config.getConfigSubtree("exponent"); + + auto const& variable_name = + //! \ogs_file_param{properties__property__ExponentialProperty__exponent__variable_name} + exponent_data_config.getConfigParameter<std::string>("variable_name"); + auto const reference_condition = + //! \ogs_file_param{properties__property__ExponentialProperty__exponent__reference_condition} + exponent_data_config.getConfigParameter<double>("reference_condition"); + auto const factor = + //! \ogs_file_param{properties__property__ExponentialProperty__exponent__factor} + exponent_data_config.getConfigParameter<double>("factor"); + + MaterialPropertyLib::Variable exp_data_type = + MaterialPropertyLib::convertStringToVariable(variable_name); + + MaterialPropertyLib::ExponentData const exp_data{ + exp_data_type, reference_condition, factor}; + + return std::make_unique<MaterialPropertyLib::ExponentialProperty>( + reference_value, exp_data); } } // namespace MaterialPropertyLib \ No newline at end of file diff --git a/MaterialLib/MPL/Properties/ExponentialProperty.h b/MaterialLib/MPL/Properties/ExponentialProperty.h index 9c2c9a53432750030272fe682990c8d0c3f0a992..73693dcc305b2362935bddf3c69f97353f089a37 100644 --- a/MaterialLib/MPL/Properties/ExponentialProperty.h +++ b/MaterialLib/MPL/Properties/ExponentialProperty.h @@ -15,7 +15,6 @@ namespace MaterialPropertyLib { - struct ExponentData { Variable type; diff --git a/MaterialLib/MPL/Properties/LinearProperty.cpp b/MaterialLib/MPL/Properties/LinearProperty.cpp index 39e157a406aca35a493babc3e683ae2523ab85e7..dddfe08823320f942f533628d23bc4b62951a2fb 100644 --- a/MaterialLib/MPL/Properties/LinearProperty.cpp +++ b/MaterialLib/MPL/Properties/LinearProperty.cpp @@ -27,15 +27,15 @@ PropertyDataType LinearProperty::value( ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/) const { - auto calculate_linearized_ratio = - [&variable_array](double const initial_linearized_ratio, - auto const& iv) { - return initial_linearized_ratio + - std::get<double>(iv.slope) * - (std::get<double>( - variable_array[static_cast<int>(iv.type)]) - - std::get<double>(iv.reference_condition)); - }; + auto calculate_linearized_ratio = [&variable_array]( + double const initial_linearized_ratio, + auto const& iv) { + return initial_linearized_ratio + + std::get<double>(iv.slope) * + (std::get<double>( + variable_array[static_cast<int>(iv.type)]) - + std::get<double>(iv.reference_condition)); + }; double const linearized_ratio_to_reference_value = std::accumulate(_independent_variables.begin(), diff --git a/MaterialLib/MPL/Properties/Properties.h b/MaterialLib/MPL/Properties/Properties.h index ff42aea9ca8812234617e6eed6221040a8e3d804..f8ca051af51b98fed3182f812161212dcb057abf 100644 --- a/MaterialLib/MPL/Properties/Properties.h +++ b/MaterialLib/MPL/Properties/Properties.h @@ -13,7 +13,7 @@ #pragma once #include "Constant.h" +#include "ExponentialProperty.h" #include "IdealGasLaw.h" #include "LinearProperty.h" -#include "ExponentialProperty.h" #include "ParameterProperty.h" diff --git a/MaterialLib/MPL/Property.cpp b/MaterialLib/MPL/Property.cpp index e6fcfaf4df2a34eb32312284c0c5e925d58005d3..a3db05f4cab567f81feaec1520dc60c0eba1064d 100644 --- a/MaterialLib/MPL/Property.cpp +++ b/MaterialLib/MPL/Property.cpp @@ -17,7 +17,6 @@ namespace MaterialPropertyLib { - PropertyDataType Property::value() const { return _value;