diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 174b8a3e052032cc690e28927efdf55ee45e552d..ce3f4abc772c26f882c970da5575dac19b181267 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -33,7 +33,7 @@ #include "UncoupledProcessesTimeLoop.h" -#include "ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h" +#include "ProcessLib/GroundwaterFlow/CreateGroundwaterFlowProcess.h" #include "ProcessLib/TES/TESProcess.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 d4b67a6628ab3201be2fce5e5826cc2dc7b986de..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<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 +} // namespace GroundwaterFlow +} // namespace ProcessLib diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h index 10171019bedf04d324663abb905bba1fa7d9465e..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<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 +} // namespace GroundwaterFlow +} // namespace ProcessLib #endif // PROCESS_LIB_GROUNDWATERFLOWPROCESS_H_