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