From d55dd7b8d9d56c5092809ced8eae9839362261c8 Mon Sep 17 00:00:00 2001 From: Norihiro Watanabe <norihiro.watanabe@ufz.de> Date: Tue, 21 Jun 2016 11:13:17 +0200 Subject: [PATCH] move to cpp: TESProcess --- ProcessLib/TES/TESProcess.cpp | 34 +++++++++++++++++++++++++++++++++- ProcessLib/TES/TESProcess.h | 30 ++---------------------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/ProcessLib/TES/TESProcess.cpp b/ProcessLib/TES/TESProcess.cpp index b2cb343218f..b9b259585b5 100644 --- a/ProcessLib/TES/TESProcess.cpp +++ b/ProcessLib/TES/TESProcess.cpp @@ -9,7 +9,7 @@ #include "TESProcess.h" -#include "Utils/CreateLocalAssemblers.h" +#include "ProcessLib/Utils/CreateLocalAssemblers.h" // TODO Copied from VectorMatrixAssembler. Could be provided by the DOF table. inline NumLib::LocalToGlobalIndexMap::RowColumnIndices @@ -445,6 +445,38 @@ TESProcess::computeEquilibriumLoading( return *result_cache; } +std::unique_ptr<TESProcess> createTESProcess( + MeshLib::Mesh& mesh, + Process::NonlinearSolver& nonlinear_solver, + std::unique_ptr<Process::TimeDiscretization>&& time_discretization, + std::vector<ProcessVariable> const& variables, + std::vector<std::unique_ptr<ParameterBase>> const& /*parameters*/, + BaseLib::ConfigTree const& config) +{ + config.checkConfigParameter("type", "TES"); + + DBUG("Create TESProcess."); + + auto process_variables = findProcessVariables( + variables, config, + {"fluid_pressure", "temperature", "vapour_mass_fraction"}); + + SecondaryVariableCollection secondary_variables{ + config.getConfigSubtreeOptional("secondary_variables"), + {"solid_density", "reaction_rate", "velocity_x", "velocity_y", + "velocity_z", "loading", "reaction_damping_factor", + "vapour_partial_pressure", "relative_humidity", + "equilibrium_loading"}}; + + ProcessOutput process_output{config.getConfigSubtree("output"), + process_variables, secondary_variables}; + + return std::unique_ptr<TESProcess>{new TESProcess{ + mesh, nonlinear_solver, std::move(time_discretization), + std::move(process_variables), std::move(secondary_variables), + std::move(process_output), config}}; +} + } // namespace TES } // namespace ProcessLib diff --git a/ProcessLib/TES/TESProcess.h b/ProcessLib/TES/TESProcess.h index 58a0e617c5d..250791b5131 100644 --- a/ProcessLib/TES/TESProcess.h +++ b/ProcessLib/TES/TESProcess.h @@ -99,40 +99,14 @@ private: std::unique_ptr<GlobalVector> _x_previous_timestep; }; -inline std::unique_ptr<TESProcess> createTESProcess( +std::unique_ptr<TESProcess> createTESProcess( MeshLib::Mesh& mesh, Process::NonlinearSolver& nonlinear_solver, std::unique_ptr<Process::TimeDiscretization>&& time_discretization, std::vector<ProcessVariable> const& variables, std::vector<std::unique_ptr<ParameterBase>> const& /*parameters*/, - BaseLib::ConfigTree const& config) -{ - config.checkConfigParameter("type", "TES"); - - DBUG("Create TESProcess."); - - auto process_variables = findProcessVariables( - variables, config, - {"fluid_pressure", "temperature", "vapour_mass_fraction"}); - - SecondaryVariableCollection - secondary_variables{ - config.getConfigSubtreeOptional("secondary_variables"), - {"solid_density", "reaction_rate", "velocity_x", "velocity_y", - "velocity_z", "loading", "reaction_damping_factor", - "vapour_partial_pressure", "relative_humidity", - "equilibrium_loading"}}; - - ProcessOutput process_output{ - config.getConfigSubtree("output"), process_variables, - secondary_variables}; - - return std::unique_ptr<TESProcess>{new TESProcess{ - mesh, nonlinear_solver, std::move(time_discretization), - std::move(process_variables), std::move(secondary_variables), - std::move(process_output), config}}; -} + BaseLib::ConfigTree const& config); } // namespace TES -- GitLab