Revision 16558738af3c3ff9870c884e246a23ab4651cccc authored by Thomas Fischer on 14 June 2021, 14:59:51 UTC, committed by Thomas Fischer on 18 June 2021, 09:20:16 UTC
1 parent 24fc8f5
CreateSecondaryVariables.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 "CreateSecondaryVariables.h"
#include "BaseLib/ConfigTree.h"
#include "SecondaryVariable.h"
namespace ProcessLib
{
void createSecondaryVariables(BaseLib::ConfigTree const& config,
SecondaryVariableCollection& secondary_variables)
{
auto sec_vars_config =
//! \ogs_file_param{prj__processes__process__secondary_variables}
config.getConfigSubtreeOptional("secondary_variables");
if (!sec_vars_config)
{
return;
}
for (
auto sec_var_config :
//! \ogs_file_param{prj__processes__process__secondary_variables__secondary_variable}
sec_vars_config->getConfigSubtreeList("secondary_variable"))
{
auto const type =
//! \ogs_file_attr{prj__processes__process__secondary_variables__secondary_variable__type}
sec_var_config.getConfigAttributeOptional<std::string>("type");
if (type)
{
WARN(
"Secondary variable type specification is deprecated and is "
"ignored. All secondary variable types are 'static'.");
}
auto const internal_name =
//! \ogs_file_attr{prj__processes__process__secondary_variables__secondary_variable__internal_name}
sec_var_config.getConfigAttribute<std::string>("internal_name");
auto const output_name =
//! \ogs_file_attr{prj__processes__process__secondary_variables__secondary_variable__output_name}
sec_var_config.getConfigAttribute<std::string>("output_name");
secondary_variables.addNameMapping(internal_name, output_name);
}
}
} // namespace ProcessLib
Computing file changes ...