diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 8911920b780cc1b771615f30d467b463e9508e11..d995718043a40a508a712c0fac17c2836757987c 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -465,7 +465,7 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config, ProcessLib::ComponentTransport::createComponentTransportProcess( *_mesh_vec[0], std::move(jacobian_assembler), _process_variables, _parameters, integration_order, - process_config, project_directory, output_directory); + process_config, _mesh_vec, output_directory); } else #endif diff --git a/ProcessLib/ComponentTransport/ComponentTransportProcess.h b/ProcessLib/ComponentTransport/ComponentTransportProcess.h index 9bf42b2c8f529a36282c341a766157d14aaeeeb2..9b805dc8c51b6df229bc7538c51c91b413eb1c71 100644 --- a/ProcessLib/ComponentTransport/ComponentTransportProcess.h +++ b/ProcessLib/ComponentTransport/ComponentTransportProcess.h @@ -16,6 +16,7 @@ namespace ProcessLib { + namespace ComponentTransport { /** diff --git a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp index bbedc8956f2b24071fa0ae6188124653af48da98..0c1bdf1443146c2c4821b3099cceb1ce91b9af92 100644 --- a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp +++ b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp @@ -33,7 +33,7 @@ std::unique_ptr<Process> createComponentTransportProcess( std::vector<std::unique_ptr<ParameterBase>> const& parameters, unsigned const integration_order, BaseLib::ConfigTree const& config, - std::string const& project_directory, + std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::string const& output_directory) { //! \ogs_file_param{prj__processes__process__type} @@ -171,26 +171,31 @@ std::unique_ptr<Process> createComponentTransportProcess( named_function_caller); // for the balance - std::string mesh_name; // surface mesh the balance will computed on + std::string balance_mesh_name; // surface mesh the balance will computed on std::string balance_pv_name; std::string balance_out_fname; std::unique_ptr<MeshLib::Mesh> surface_mesh; ProcessLib::parseCalculateSurfaceFluxData( - config, mesh_name, balance_pv_name, balance_out_fname); + config, balance_mesh_name, balance_pv_name, balance_out_fname); if (!mesh_name.empty()) // balance is optional { - mesh_name = BaseLib::copyPathToFileName(mesh_name, project_directory); + // find the mesh for the specified mesh_name + auto balance_mesh = BaseLib::findElementOrError( + meshes.begin(), meshes.end(), + [&balance_mesh_name](auto const& m) { + return balance_mesh_name == m->getName(); + }, + "Expected to find o mesh named " + balance_mesh_name + + " for balance calculation."); balance_out_fname = BaseLib::copyPathToFileName(balance_out_fname, output_directory); - surface_mesh.reset(MeshLib::IO::readMeshFromFile(mesh_name)); - DBUG( "read balance meta data:\n\tbalance mesh:\"%s\"\n\tproperty name: " "\"%s\"\n\toutput to: \"%s\"", - mesh_name.c_str(), balance_pv_name.c_str(), + balance_mesh_name.c_str(), balance_pv_name.c_str(), balance_out_fname.c_str()); // Surface mesh and bulk mesh must have equal axial symmetry flags! diff --git a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.h b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.h index 30c666a93568c27c90215a792698bcb953ab8db8..8249620bb7ab71c4e57902d67f9428c54bdf0a74 100644 --- a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.h +++ b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.h @@ -23,7 +23,7 @@ std::unique_ptr<Process> createComponentTransportProcess( std::vector<std::unique_ptr<ParameterBase>> const& parameters, unsigned const integration_order, BaseLib::ConfigTree const& config, - std::string const& project_directory, + std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::string const& output_directory); } // namespace ComponentTransport