diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index a21b5af26b3d1f3f3ebfd7d76ef88c6ef2af808b..66691e128ec13ff9feeeeee529befa4b9431627e 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -428,7 +428,7 @@ std::vector<std::string> ProjectData::parseParameters( } void ProjectData::parseMedia( - boost::optional<BaseLib::ConfigTree> const& media_config) + boost::optional<BaseLib::ConfigTree> const& media_config) { if (!media_config) { @@ -488,10 +488,13 @@ void ProjectData::parseMedia( id); } - _media[id] = (id == material_ids[0]) - ? MaterialPropertyLib::createMedium(medium_config, - _parameters) - : _media[material_ids[0]]; + _media[id] = + (id == material_ids[0]) + ? MaterialPropertyLib::createMedium( + medium_config, _parameters, + _local_coordinate_system ? &*_local_coordinate_system + : nullptr) + : _media[material_ids[0]]; } } diff --git a/MaterialLib/MPL/CreateComponent.cpp b/MaterialLib/MPL/CreateComponent.cpp index 6992dbcfe3f7ba782348a0cd6675a97b9ee17c8f..34d213f4a904e1cb6b14c09536f96c5116f72a29 100644 --- a/MaterialLib/MPL/CreateComponent.cpp +++ b/MaterialLib/MPL/CreateComponent.cpp @@ -22,7 +22,8 @@ namespace { std::unique_ptr<MaterialPropertyLib::Component> createComponent( BaseLib::ConfigTree const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { using namespace MaterialPropertyLib; // Parsing the component name @@ -42,7 +43,7 @@ std::unique_ptr<MaterialPropertyLib::Component> createComponent( std::unique_ptr<PropertyArray> properties = //! \ogs_file_param{prj__media__medium__phases__phase__components__component__properties} createProperties(config.getConfigSubtreeOptional("properties"), - parameters); + parameters, local_coordinate_system); // If a name is given, it must conform with one of the derived component // names in the following list: @@ -67,7 +68,8 @@ namespace MaterialPropertyLib { std::vector<std::unique_ptr<Component>> createComponents( boost::optional<BaseLib::ConfigTree> const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { if (!config) { @@ -80,7 +82,8 @@ std::vector<std::unique_ptr<Component>> createComponents( //! \ogs_file_param{prj__media__medium__phases__phase__components__component} config->getConfigSubtreeList("component")) { - auto component = createComponent(component_config, parameters); + auto component = createComponent(component_config, parameters, + local_coordinate_system); if (std::find_if(components.begin(), components.end(), diff --git a/MaterialLib/MPL/CreateComponent.h b/MaterialLib/MPL/CreateComponent.h index baba5f96fb43e9af82b8474bbd4f602bfba8e27c..6141aac70fe4d651ca8119022077044772caab1f 100644 --- a/MaterialLib/MPL/CreateComponent.h +++ b/MaterialLib/MPL/CreateComponent.h @@ -22,6 +22,7 @@ class ConfigTree; namespace ParameterLib { struct ParameterBase; +struct CoordinateSystem; } namespace MaterialPropertyLib @@ -36,7 +37,7 @@ namespace MaterialPropertyLib /// without predefined properties is created. std::vector<std::unique_ptr<Component>> createComponents( boost::optional<BaseLib::ConfigTree> const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& - parameters); + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system); } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/CreateMedium.cpp b/MaterialLib/MPL/CreateMedium.cpp index d477ef162be32a23395103ec681a67690bee6eb3..685741dc79a6c13dfd1954d211362167e2990ee4 100644 --- a/MaterialLib/MPL/CreateMedium.cpp +++ b/MaterialLib/MPL/CreateMedium.cpp @@ -25,19 +25,22 @@ namespace MaterialPropertyLib { 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, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { // Parsing the phases // Properties of phases may be not required in all the cases. auto&& phases = //! \ogs_file_param{prj__media__medium__phases} - createPhases(config.getConfigSubtreeOptional("phases"), parameters); + createPhases(config.getConfigSubtreeOptional("phases"), + parameters, + local_coordinate_system); // Parsing medium properties, overwriting the defaults. auto&& properties = //! \ogs_file_param{prj__media__medium__properties} createProperties(config.getConfigSubtreeOptional("properties"), - parameters); + parameters, local_coordinate_system); if (phases.empty() && !properties) { diff --git a/MaterialLib/MPL/CreateMedium.h b/MaterialLib/MPL/CreateMedium.h index 5e5aaf4c8fcc216c81793f198995041d7ccc616d..51e1c65b07a3c54c143eeb7caccaa46845d3d055 100644 --- a/MaterialLib/MPL/CreateMedium.h +++ b/MaterialLib/MPL/CreateMedium.h @@ -24,6 +24,7 @@ class Medium; namespace ParameterLib { struct ParameterBase; +struct CoordinateSystem; } namespace MaterialPropertyLib @@ -34,6 +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, + ParameterLib::CoordinateSystem const* const local_coordinate_system); } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/CreatePhase.cpp b/MaterialLib/MPL/CreatePhase.cpp index 86b7d5044b754a2b8dc5dce83ce37d538081143f..34cd803b7d0c37219310690a1d5ff8424a03fc04 100644 --- a/MaterialLib/MPL/CreatePhase.cpp +++ b/MaterialLib/MPL/CreatePhase.cpp @@ -26,7 +26,8 @@ namespace { std::unique_ptr<MaterialPropertyLib::Phase> createPhase( BaseLib::ConfigTree const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { using namespace MaterialPropertyLib; @@ -59,13 +60,13 @@ std::unique_ptr<MaterialPropertyLib::Phase> createPhase( auto components = //! \ogs_file_param{prj__media__medium__phases__phase__components} createComponents(config.getConfigSubtreeOptional("components"), - parameters); + parameters, local_coordinate_system); // Properties of optional properties. auto properties = //! \ogs_file_param{prj__media__medium__phases__phase__properties} createProperties(config.getConfigSubtreeOptional("properties"), - parameters); + parameters, local_coordinate_system); if (components.empty() && !properties) { @@ -84,7 +85,8 @@ namespace MaterialPropertyLib { std::vector<std::unique_ptr<Phase>> createPhases( boost::optional<BaseLib::ConfigTree> const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { if (!config) { @@ -97,7 +99,8 @@ std::vector<std::unique_ptr<Phase>> createPhases( //! \ogs_file_param{prj__media__medium__phases__phase} config->getConfigSubtreeList("phase")) { - auto phase = createPhase(phase_config, parameters); + auto phase = + createPhase(phase_config, parameters, local_coordinate_system); if (std::find_if(phases.begin(), phases.end(), diff --git a/MaterialLib/MPL/CreatePhase.h b/MaterialLib/MPL/CreatePhase.h index dce10756fd71de3affb9507b6d4bc20a18b1074b..b91b35e5c660a7101451f4d27c35465defa3825f 100644 --- a/MaterialLib/MPL/CreatePhase.h +++ b/MaterialLib/MPL/CreatePhase.h @@ -21,6 +21,7 @@ class ConfigTree; namespace ParameterLib { struct ParameterBase; +struct CoordinateSystem; } namespace MaterialPropertyLib { @@ -41,6 +42,6 @@ namespace MaterialPropertyLib /// weighted by mole fraction. std::vector<std::unique_ptr<Phase>> createPhases( boost::optional<BaseLib::ConfigTree> const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& - parameters); + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system); } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/CreateProperty.cpp b/MaterialLib/MPL/CreateProperty.cpp index 57918da8e198884528fda3302be06f648df39d03..8455f1822bd5adaeef7200e83444f1047208b818 100644 --- a/MaterialLib/MPL/CreateProperty.cpp +++ b/MaterialLib/MPL/CreateProperty.cpp @@ -28,7 +28,8 @@ namespace { std::unique_ptr<MaterialPropertyLib::Property> createProperty( BaseLib::ConfigTree const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { using namespace MaterialPropertyLib; // Parsing the property type: @@ -109,7 +110,8 @@ namespace MaterialPropertyLib { std::unique_ptr<PropertyArray> createProperties( boost::optional<BaseLib::ConfigTree> const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system) { if (!config) { @@ -132,7 +134,8 @@ std::unique_ptr<PropertyArray> createProperties( //! \ogs_file_param{properties__property__name} property_config.getConfigParameter<std::string>("name"); // Create a new property based on the configuration subtree: - auto property = createProperty(property_config, parameters); + auto property = createProperty( + property_config, parameters, local_coordinate_system); // Insert the new property at the right position into the components // private PropertyArray: diff --git a/MaterialLib/MPL/CreateProperty.h b/MaterialLib/MPL/CreateProperty.h index 68bf8e24f22856de3eabc47ffefe5745972fe9fd..c9c252ea532f5ab4c49989a446b9d0fb01631f7c 100644 --- a/MaterialLib/MPL/CreateProperty.h +++ b/MaterialLib/MPL/CreateProperty.h @@ -22,6 +22,7 @@ class ConfigTree; namespace ParameterLib { struct ParameterBase; +struct CoordinateSystem; } namespace MaterialPropertyLib @@ -42,7 +43,7 @@ using PropertyArray = /// properties array. std::unique_ptr<PropertyArray> createProperties( boost::optional<BaseLib::ConfigTree> const& config, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& - parameters); + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters, + ParameterLib::CoordinateSystem const* const local_coordinate_system); } // namespace MaterialPropertyLib diff --git a/Tests/MaterialLib/TestMPL.cpp b/Tests/MaterialLib/TestMPL.cpp index da0429ca4562e96514170b7c126b370c9dbbc086..c27f367a889e4309e6db5f8c6fbffe3eb352dba0 100644 --- a/Tests/MaterialLib/TestMPL.cpp +++ b/Tests/MaterialLib/TestMPL.cpp @@ -26,5 +26,5 @@ std::unique_ptr<MPL::Medium> createTestMaterial(std::string const& xml) auto const& config = conf.getConfigSubtree("medium"); std::vector<std::unique_ptr<ParameterLib::ParameterBase>> parameters; - return MPL::createMedium(config, parameters); + return MPL::createMedium(config, parameters, nullptr); }