diff --git a/ProcessLib/CreateTimeLoop.cpp b/ProcessLib/CreateTimeLoop.cpp index 2e3bd214184bf8cf18d9eea6af9114efb3b3dda6..1c9944eb6926138b4cc94bb8ad40ef93efb9da96 100644 --- a/ProcessLib/CreateTimeLoop.cpp +++ b/ProcessLib/CreateTimeLoop.cpp @@ -16,6 +16,7 @@ #include "ProcessLib/CreateProcessData.h" #include "ProcessLib/Output/CreateOutput.h" #include "ProcessLib/Output/Output.h" +#include "ProcessLib/Output/SubmeshResiduumOutputConfig.h" #include "TimeLoop.h" namespace ProcessLib @@ -70,6 +71,37 @@ std::unique_ptr<TimeLoop> createTimeLoop( : createOutputs(config.getConfigSubtree("outputs"), output_directory, meshes); + if (auto const submesh_residuum_output_config_tree = + //! \ogs_file_param{prj__time_loop__submesh_residuum_output} + config.getConfigSubtreeOptional("submesh_residuum_output"); + submesh_residuum_output_config_tree) + { + auto smroc = createSubmeshResiduumOutputConfig( + *submesh_residuum_output_config_tree, output_directory, meshes); + + for (auto& process : processes) + { + auto const& residuum_vector_names = + process->initializeAssemblyOnSubmeshes(smroc.meshes); + + for (auto& name : residuum_vector_names) + { + smroc.output.doNotProjectFromBulkMeshToSubmeshes( + name, MeshLib::MeshItemType::Node); + } + } + + outputs.push_back(std::move(smroc.output)); + } + else + { + // Submesh assembly must always be initialized. + for (auto& process : processes) + { + process->initializeAssemblyOnSubmeshes({}); + } + } + auto per_process_data = createPerProcessData( //! \ogs_file_param{prj__time_loop__processes} config.getConfigSubtree("processes"), processes, nonlinear_solvers, diff --git a/ProcessLib/CreateTimeLoop.h b/ProcessLib/CreateTimeLoop.h index 2e4e86ae472764cc74b1867debc1d45fd4f108a4..130afb61b0d03ceb02bc1f5f93405514e448de7b 100644 --- a/ProcessLib/CreateTimeLoop.h +++ b/ProcessLib/CreateTimeLoop.h @@ -34,7 +34,7 @@ namespace ProcessLib { class TimeLoop; class Process; -} +} // namespace ProcessLib namespace ProcessLib {