Skip to content
Snippets Groups Projects
Commit 0deca8c8 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[PL] Pass curves down to deactivated subdomains.

parent 0b8d7c14
No related branches found
No related tags found
No related merge requests found
...@@ -385,7 +385,7 @@ void ProjectData::parseProcessVariables( ...@@ -385,7 +385,7 @@ void ProjectData::parseProcessVariables(
"Expected to find a mesh named " + mesh_name + "."); "Expected to find a mesh named " + mesh_name + ".");
auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec, auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
_parameters}; _parameters, _curves};
if (!names.insert(pv.getName()).second) if (!names.insert(pv.getName()).second)
{ {
OGS_FATAL("A process variable with name `{:s}' already exists.", OGS_FATAL("A process variable with name `{:s}' already exists.",
......
...@@ -110,7 +110,10 @@ static std::unique_ptr<DeactivatedSubdomainMesh> createDeactivatedSubdomainMesh( ...@@ -110,7 +110,10 @@ static std::unique_ptr<DeactivatedSubdomainMesh> createDeactivatedSubdomainMesh(
} }
std::unique_ptr<DeactivatedSubdomain const> createDeactivatedSubdomain( std::unique_ptr<DeactivatedSubdomain const> createDeactivatedSubdomain(
BaseLib::ConfigTree const& config, MeshLib::Mesh const& mesh) BaseLib::ConfigTree const& config, MeshLib::Mesh const& mesh,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves)
{ {
//! \ogs_file_param{prj__process_variables__process_variable__deactivated_subdomains__deactivated_subdomain__time_interval} //! \ogs_file_param{prj__process_variables__process_variable__deactivated_subdomains__deactivated_subdomain__time_interval}
auto const& time_interval_config = config.getConfigSubtree("time_interval"); auto const& time_interval_config = config.getConfigSubtree("time_interval");
...@@ -165,8 +168,12 @@ std::unique_ptr<DeactivatedSubdomain const> createDeactivatedSubdomain( ...@@ -165,8 +168,12 @@ std::unique_ptr<DeactivatedSubdomain const> createDeactivatedSubdomain(
} }
std::vector<std::unique_ptr<DeactivatedSubdomain const>> std::vector<std::unique_ptr<DeactivatedSubdomain const>>
createDeactivatedSubdomains(BaseLib::ConfigTree const& config, createDeactivatedSubdomains(
MeshLib::Mesh const& mesh) BaseLib::ConfigTree const& config,
MeshLib::Mesh const& mesh,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves)
{ {
std::vector<std::unique_ptr<DeactivatedSubdomain const>> std::vector<std::unique_ptr<DeactivatedSubdomain const>>
deactivated_subdomains; deactivated_subdomains;
...@@ -183,7 +190,7 @@ createDeactivatedSubdomains(BaseLib::ConfigTree const& config, ...@@ -183,7 +190,7 @@ createDeactivatedSubdomains(BaseLib::ConfigTree const& config,
subdomains_config->getConfigSubtreeList("deactivated_subdomain")) subdomains_config->getConfigSubtreeList("deactivated_subdomain"))
{ {
deactivated_subdomains.emplace_back( deactivated_subdomains.emplace_back(
createDeactivatedSubdomain(subdomain_config, mesh)); createDeactivatedSubdomain(subdomain_config, mesh, curves));
} }
} }
return deactivated_subdomains; return deactivated_subdomains;
......
...@@ -64,7 +64,11 @@ struct DeactivatedSubdomain ...@@ -64,7 +64,11 @@ struct DeactivatedSubdomain
}; };
std::vector<std::unique_ptr<DeactivatedSubdomain const>> std::vector<std::unique_ptr<DeactivatedSubdomain const>>
createDeactivatedSubdomains(BaseLib::ConfigTree const& config, createDeactivatedSubdomains(
MeshLib::Mesh const& mesh); BaseLib::ConfigTree const& config,
MeshLib::Mesh const& mesh,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves);
} // namespace ProcessLib } // namespace ProcessLib
...@@ -92,7 +92,10 @@ ProcessVariable::ProcessVariable( ...@@ -92,7 +92,10 @@ ProcessVariable::ProcessVariable(
BaseLib::ConfigTree const& config, BaseLib::ConfigTree const& config,
MeshLib::Mesh& mesh, MeshLib::Mesh& mesh,
std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes,
std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves)
: //! \ogs_file_param{prj__process_variables__process_variable__name} : //! \ogs_file_param{prj__process_variables__process_variable__name}
_name(config.getConfigParameter<std::string>("name")), _name(config.getConfigParameter<std::string>("name")),
_mesh(mesh), _mesh(mesh),
...@@ -100,7 +103,8 @@ ProcessVariable::ProcessVariable( ...@@ -100,7 +103,8 @@ ProcessVariable::ProcessVariable(
_n_components(config.getConfigParameter<int>("components")), _n_components(config.getConfigParameter<int>("components")),
//! \ogs_file_param{prj__process_variables__process_variable__order} //! \ogs_file_param{prj__process_variables__process_variable__order}
_shapefunction_order(config.getConfigParameter<unsigned>("order")), _shapefunction_order(config.getConfigParameter<unsigned>("order")),
_deactivated_subdomains(createDeactivatedSubdomains(config, mesh)), _deactivated_subdomains(
createDeactivatedSubdomains(config, mesh, curves)),
_initial_condition(ParameterLib::findParameter<double>( _initial_condition(ParameterLib::findParameter<double>(
//! \ogs_file_param{prj__process_variables__process_variable__initial_condition} //! \ogs_file_param{prj__process_variables__process_variable__initial_condition}
config.getConfigParameter<std::string>("initial_condition"), config.getConfigParameter<std::string>("initial_condition"),
......
...@@ -50,7 +50,10 @@ public: ...@@ -50,7 +50,10 @@ public:
BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh, BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh,
std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes,
std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const&
parameters); parameters,
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves);
ProcessVariable(ProcessVariable&& other); ProcessVariable(ProcessVariable&& other);
......
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