ExaDG
Loading...
Searching...
No Matches
create_time_integrator.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_CREATE_TIME_INTEGRATOR_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_CREATE_TIME_INTEGRATOR_H_
24
25#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf.h>
26#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf_coupled_solver.h>
27#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf_dual_splitting.h>
28#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf_pressure_correction.h>
29
30namespace ExaDG
31{
32namespace IncNS
33{
37template<int dim, typename Number>
38std::shared_ptr<TimeIntBDF<dim, Number>>
39create_time_integrator(std::shared_ptr<SpatialOperatorBase<dim, Number>> pde_operator,
40 std::shared_ptr<HelpersALE<dim, Number> const> helpers_ale,
41 std::shared_ptr<PostProcessorInterface<Number>> postprocessor,
42 Parameters const & parameters,
43 MPI_Comm const & mpi_comm,
44 bool const is_test)
45{
46 std::shared_ptr<TimeIntBDF<dim, Number>> time_integrator;
47
48 if(parameters.temporal_discretization == TemporalDiscretization::BDFCoupledSolution)
49 {
50 std::shared_ptr<OperatorCoupled<dim, Number>> operator_coupled =
51 std::dynamic_pointer_cast<OperatorCoupled<dim, Number>>(pde_operator);
52
53 time_integrator = std::make_shared<IncNS::TimeIntBDFCoupled<dim, Number>>(
54 operator_coupled, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
55 }
56 else if(parameters.temporal_discretization == TemporalDiscretization::BDFDualSplittingScheme)
57 {
58 std::shared_ptr<OperatorDualSplitting<dim, Number>> operator_dual_splitting =
59 std::dynamic_pointer_cast<OperatorDualSplitting<dim, Number>>(pde_operator);
60
61 time_integrator = std::make_shared<IncNS::TimeIntBDFDualSplitting<dim, Number>>(
62 operator_dual_splitting, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
63 }
64 else if(parameters.temporal_discretization == TemporalDiscretization::BDFPressureCorrection)
65 {
66 std::shared_ptr<OperatorPressureCorrection<dim, Number>> operator_pressure_correction =
67 std::dynamic_pointer_cast<OperatorPressureCorrection<dim, Number>>(pde_operator);
68
69 time_integrator = std::make_shared<IncNS::TimeIntBDFPressureCorrection<dim, Number>>(
70 operator_pressure_correction, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
71 }
72 else
73 {
74 AssertThrow(false, dealii::ExcMessage("Not implemented."));
75 }
76
77 return time_integrator;
78}
79
80} // namespace IncNS
81} // namespace ExaDG
82
83#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_CREATE_TIME_INTEGRATOR_H_ */
Definition driver.cpp:33