Skip to content
Snippets Groups Projects
Commit 16c49202 authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[PL] Check 'do flux-calc.' outside of create flux.

parent 3fa71668
No related branches found
No related tags found
No related merge requests found
......@@ -46,28 +46,21 @@ struct Balance
output_mesh_file_name.c_str());
}
static std::unique_ptr<Balance> createBalance(
BaseLib::ConfigTree const& config,
static std::unique_ptr<ProcessLib::Balance> createBalance(
BaseLib::ConfigTree const& calculatesurfaceflux_config,
std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes,
std::string const& output_directory)
{
auto calculatesurfaceflux_config =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux}
config.getConfigSubtreeOptional("calculatesurfaceflux");
if (!calculatesurfaceflux_config)
return std::unique_ptr<Balance>(nullptr);
std::string mesh_name =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux__mesh}
calculatesurfaceflux_config->getConfigParameter<std::string>(
"mesh");
calculatesurfaceflux_config.getConfigParameter<std::string>("mesh");
std::string balance_pv_name =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux__property_name}
calculatesurfaceflux_config->getConfigParameter<std::string>(
calculatesurfaceflux_config.getConfigParameter<std::string>(
"property_name");
std::string balance_out_fname =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux__output_mesh}
calculatesurfaceflux_config->getConfigParameter<std::string>(
calculatesurfaceflux_config.getConfigParameter<std::string>(
"output_mesh");
if (mesh_name.empty())
......
......@@ -69,8 +69,15 @@ std::unique_ptr<Process> createGroundwaterFlowProcess(
ProcessLib::createSecondaryVariables(config, secondary_variables,
named_function_caller);
std::unique_ptr<ProcessLib::Balance> balance =
ProcessLib::Balance::createBalance(config, meshes, output_directory);
std::unique_ptr<ProcessLib::Balance> balance;
auto calculatesurfaceflux_config =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux}
config.getConfigSubtreeOptional("calculatesurfaceflux");
if (calculatesurfaceflux_config)
{
balance = ProcessLib::Balance::createBalance(
*calculatesurfaceflux_config, meshes, output_directory);
}
return std::make_unique<GroundwaterFlowProcess>(
mesh, std::move(jacobian_assembler), parameters, integration_order,
......
......@@ -199,8 +199,15 @@ std::unique_ptr<Process> createHTProcess(
DBUG("Use \'%s\' as Biot's constant.", biot_constant->name.c_str());
}
std::unique_ptr<ProcessLib::Balance> balance =
ProcessLib::Balance::createBalance(config, meshes, output_directory);
std::unique_ptr<ProcessLib::Balance> balance;
auto calculatesurfaceflux_config =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux}
config.getConfigSubtreeOptional("calculatesurfaceflux");
if (calculatesurfaceflux_config)
{
balance = ProcessLib::Balance::createBalance(
*calculatesurfaceflux_config, meshes, output_directory);
}
std::unique_ptr<HTMaterialProperties> material_properties =
std::make_unique<HTMaterialProperties>(
......
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