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#include <exadg/incompressible_navier_stokes/time_integration/time_int_interpolate_analytical_solution.h>
30
31namespace ExaDG
32{
33namespace IncNS
34{
38template<int dim, typename Number>
39std::shared_ptr<TimeIntBDF<dim, Number>>
40create_time_integrator(std::shared_ptr<SpatialOperatorBase<dim, Number>> pde_operator,
41 std::shared_ptr<HelpersALE<dim, Number> const> helpers_ale,
42 std::shared_ptr<PostProcessorInterface<Number>> postprocessor,
43 Parameters const & parameters,
44 MPI_Comm const & mpi_comm,
45 bool const is_test)
46{
47 std::shared_ptr<TimeIntBDF<dim, Number>> time_integrator;
48
49 if(parameters.temporal_discretization == TemporalDiscretization::BDFCoupledSolution)
50 {
51 std::shared_ptr<OperatorCoupled<dim, Number>> operator_coupled =
52 std::dynamic_pointer_cast<OperatorCoupled<dim, Number>>(pde_operator);
53
54 time_integrator = std::make_shared<IncNS::TimeIntBDFCoupled<dim, Number>>(
55 operator_coupled, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
56 }
57 else if(parameters.temporal_discretization == TemporalDiscretization::BDFDualSplittingScheme)
58 {
59 std::shared_ptr<OperatorDualSplitting<dim, Number>> operator_dual_splitting =
60 std::dynamic_pointer_cast<OperatorDualSplitting<dim, Number>>(pde_operator);
61
62 time_integrator = std::make_shared<IncNS::TimeIntBDFDualSplitting<dim, Number>>(
63 operator_dual_splitting, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
64 }
65 else if(parameters.temporal_discretization == TemporalDiscretization::BDFPressureCorrection)
66 {
67 std::shared_ptr<OperatorPressureCorrection<dim, Number>> operator_pressure_correction =
68 std::dynamic_pointer_cast<OperatorPressureCorrection<dim, Number>>(pde_operator);
69
70 time_integrator = std::make_shared<IncNS::TimeIntBDFPressureCorrection<dim, Number>>(
71 operator_pressure_correction, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
72 }
73 else if(parameters.temporal_discretization ==
74 TemporalDiscretization::InterpolateAnalyticalSolution)
75 {
76 time_integrator = std::make_shared<IncNS::TimeIntInterpolateAnalyticalSolution<dim, Number>>(
77 pde_operator, helpers_ale, postprocessor, parameters, mpi_comm, is_test);
78 }
79 else
80 {
81 AssertThrow(false, dealii::ExcMessage("Not implemented."));
82 }
83
84 return time_integrator;
85}
86
87} // namespace IncNS
88} // namespace ExaDG
89
90#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_CREATE_TIME_INTEGRATOR_H_ */
Definition parameters.h:46
Definition postprocessor_interface.h:34
Definition spatial_operator_base.h:68
Definition driver.cpp:33