diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 174b8a3e052032cc690e28927efdf55ee45e552d..01a1bf9faff01d8f13956aeab9177247db7ba1b6 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -33,8 +33,8 @@ #include "UncoupledProcessesTimeLoop.h" -#include "ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h" -#include "ProcessLib/TES/TESProcess.h" +#include "ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.h" +#include "ProcessLib/TES/CreateTESProcess.h" namespace detail { diff --git a/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp b/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp new file mode 100644 index 0000000000000000000000000000000000000000..599cb76eb09a6ffb07a27a9d09745f973ac93ee1 --- /dev/null +++ b/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.cpp @@ -0,0 +1,73 @@ +/** + * \copyright + * Copyright (c) 2012-2016, 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 "CreateGroundwaterFlowProcess.h" + +#include "GroundwaterFlowProcess.h" +#include "GroundwaterFlowProcessData.h" + +namespace ProcessLib +{ +namespace GroundwaterFlow +{ +std::unique_ptr<Process> createGroundwaterFlowProcess( + 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) +{ + //! \ogs_file_param{process__type} + config.checkConfigParameter("type", "GROUNDWATER_FLOW"); + + DBUG("Create GroundwaterFlowProcess."); + + // Process variable. + auto process_variables = findProcessVariables( + variables, config, + {//! \ogs_file_param_special{process__GROUNDWATER_FLOW__process_variables__process_variable} + "process_variable"}); + + // Hydraulic conductivity parameter. + auto& hydraulic_conductivity = findParameter<double, + MeshLib::Element const&>( + config, + //! \ogs_file_param_special{process__GROUNDWATER_FLOW__hydraulic_conductivity} + "hydraulic_conductivity", + parameters); + + DBUG("Use \'%s\' as hydraulic conductivity parameter.", + hydraulic_conductivity.name.c_str()); + + GroundwaterFlowProcessData process_data{hydraulic_conductivity}; + + SecondaryVariableCollection secondary_variables{ + //! \ogs_file_param{process__secondary_variables} + config.getConfigSubtreeOptional("secondary_variables"), + {//! \ogs_file_param_special{process__GROUNDWATER_FLOW__secondary_variables__darcy_velocity_x} + "darcy_velocity_x", + //! \ogs_file_param_special{process__GROUNDWATER_FLOW__secondary_variables__darcy_velocity_y} + "darcy_velocity_y", + //! \ogs_file_param_special{process__GROUNDWATER_FLOW__secondary_variables__darcy_velocity_z} + "darcy_velocity_z"}}; + + ProcessOutput + //! \ogs_file_param{process__output} + process_output{config.getConfigSubtree("output"), process_variables, + secondary_variables}; + + return std::unique_ptr<Process>{new GroundwaterFlowProcess{ + mesh, nonlinear_solver, std::move(time_discretization), + std::move(process_variables), std::move(process_data), + std::move(secondary_variables), std::move(process_output)}}; +} + +} // namespace GroundwaterFlow +} // namespace ProcessLib diff --git a/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.h new file mode 100644 index 0000000000000000000000000000000000000000..0434c1e35379ea15bb961015b70aa07cc5b7adaf --- /dev/null +++ b/ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.h @@ -0,0 +1,34 @@ +/** + * \copyright + * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#ifndef PROCESS_LIB_CREATE_GROUNDWATERFLOWPROCESS_H_ +#define PROCESS_LIB_CREATE_GROUNDWATERFLOWPROCESS_H_ + +#include <memory> +#include "ProcessLib/Process.h" + + +namespace ProcessLib +{ +namespace GroundwaterFlow +{ + +std::unique_ptr<Process> +createGroundwaterFlowProcess( + 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); + +} // namespace GroundwaterFlow +} // namespace ProcessLib + +#endif // PROCESS_LIB_CREATE_GROUNDWATERFLOWPROCESS_H_ diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp index e8174eb088efb41fb0859466fd4e1180789b8b93..71448c9c25d7aea0876899c3ff0447f0ad52d4ef 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.cpp @@ -96,58 +96,5 @@ void GroundwaterFlowProcess::assembleConcreteProcess(const double t, _local_assemblers, t, x, M, K, b); } -std::unique_ptr<GroundwaterFlowProcess> createGroundwaterFlowProcess( - 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) -{ - //! \ogs_file_param{process__type} - config.checkConfigParameter("type", "GROUNDWATER_FLOW"); - - DBUG("Create GroundwaterFlowProcess."); - - // Process variable. - auto process_variables = findProcessVariables( - variables, config, - {//! \ogs_file_param_special{process__GROUNDWATER_FLOW__process_variables__process_variable} - "process_variable"}); - - // Hydraulic conductivity parameter. - auto& hydraulic_conductivity = findParameter<double, - MeshLib::Element const&>( - config, - //! \ogs_file_param_special{process__GROUNDWATER_FLOW__hydraulic_conductivity} - "hydraulic_conductivity", - parameters); - - DBUG("Use \'%s\' as hydraulic conductivity parameter.", - hydraulic_conductivity.name.c_str()); - - GroundwaterFlowProcessData process_data{hydraulic_conductivity}; - - SecondaryVariableCollection secondary_variables{ - //! \ogs_file_param{process__secondary_variables} - config.getConfigSubtreeOptional("secondary_variables"), - {//! \ogs_file_param_special{process__GROUNDWATER_FLOW__secondary_variables__darcy_velocity_x} - "darcy_velocity_x", - //! \ogs_file_param_special{process__GROUNDWATER_FLOW__secondary_variables__darcy_velocity_y} - "darcy_velocity_y", - //! \ogs_file_param_special{process__GROUNDWATER_FLOW__secondary_variables__darcy_velocity_z} - "darcy_velocity_z"}}; - - ProcessOutput - //! \ogs_file_param{process__output} - process_output{config.getConfigSubtree("output"), process_variables, - secondary_variables}; - - return std::unique_ptr<GroundwaterFlowProcess>{new GroundwaterFlowProcess{ - mesh, nonlinear_solver, std::move(time_discretization), - std::move(process_variables), std::move(process_data), - std::move(secondary_variables), std::move(process_output)}}; -} - -} // namespace GroundwaterFlow -} // namespace ProcessLib +} // namespace GroundwaterFlow +} // namespace ProcessLib diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h index 67185747530a7c6a1accf143668b1b96961f88cc..d4b84bac2b6ba13ed9b20569b1ed6170178d88c2 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h @@ -71,15 +71,7 @@ private: std::unique_ptr<ExtrapolatorInterface> _extrapolator; }; -std::unique_ptr<GroundwaterFlowProcess> createGroundwaterFlowProcess( - 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); - -} // namespace GroundwaterFlow -} // namespace ProcessLib +} // namespace GroundwaterFlow +} // namespace ProcessLib #endif // PROCESS_LIB_GROUNDWATERFLOWPROCESS_H_ diff --git a/ProcessLib/TES/CreateTESProcess.cpp b/ProcessLib/TES/CreateTESProcess.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e672c02d84c2abb0c579192fca0bbbc01eb825bd --- /dev/null +++ b/ProcessLib/TES/CreateTESProcess.cpp @@ -0,0 +1,52 @@ +/** + * \copyright + * Copyright (c) 2012-2016, 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 "CreateTESProcess.h" + +#include "TESProcess.h" + +namespace ProcessLib +{ +namespace TES +{ + +std::unique_ptr<Process> 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<Process>{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/CreateTESProcess.h b/ProcessLib/TES/CreateTESProcess.h new file mode 100644 index 0000000000000000000000000000000000000000..d45c8d06d761fb4b8702a580f04964dce516e425 --- /dev/null +++ b/ProcessLib/TES/CreateTESProcess.h @@ -0,0 +1,33 @@ +/** + * \copyright + * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#ifndef PROCESS_LIB_CREATE_TESPROCESS_H_ +#define PROCESS_LIB_CREATE_TESPROCESS_H_ + +#include <memory> +#include "ProcessLib/Process.h" + +namespace ProcessLib +{ +namespace TES +{ + +std::unique_ptr<Process> 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); + +} // namespace TES +} // namespace ProcessLib + +#endif // PROCESS_LIB_CREATE_TESPROCESS_H_ diff --git a/ProcessLib/TES/TESProcess.cpp b/ProcessLib/TES/TESProcess.cpp index b9b259585b5da434fff63993417c310234bdda27..bad81dea24a0c135bf61a78ff95f77b1a880ea6c 100644 --- a/ProcessLib/TES/TESProcess.cpp +++ b/ProcessLib/TES/TESProcess.cpp @@ -445,38 +445,6 @@ 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 250791b5131c3cd7c1099e1563e4ab4d1eaa9759..b039058f14f5ac4287cfe8a5038a5129954fee97 100644 --- a/ProcessLib/TES/TESProcess.h +++ b/ProcessLib/TES/TESProcess.h @@ -99,15 +99,6 @@ private: std::unique_ptr<GlobalVector> _x_previous_timestep; }; -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); - } // namespace TES } // namespace ProcessLib