ExaDG
Loading...
Searching...
No Matches
create_operator.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_SPATIAL_DISCRETIZATION_CREATE_OPERATOR_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CREATE_OPERATOR_H_
24
25// ExaDG
26#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_coupled.h>
27#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_dual_splitting.h>
28#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_pressure_correction.h>
29#include <exadg/incompressible_navier_stokes/spatial_discretization/spatial_operator_base.h>
30
31namespace ExaDG
32{
33namespace IncNS
34{
38template<int dim, typename Number>
39std::shared_ptr<SpatialOperatorBase<dim, Number>>
40create_operator(std::shared_ptr<Grid<dim> const> grid,
41 std::shared_ptr<dealii::Mapping<dim> const> mapping,
42 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
43 std::shared_ptr<BoundaryDescriptor<dim> const> boundary_descriptor,
44 std::shared_ptr<FieldFunctions<dim> const> field_functions,
45 Parameters const & parameters,
46 std::string const & field,
47 MPI_Comm const & mpi_comm)
48{
49 std::shared_ptr<SpatialOperatorBase<dim, Number>> pde_operator;
50
51 // initialize pde_operator
52 if(parameters.temporal_discretization == TemporalDiscretization::BDFCoupledSolution)
53 {
54 pde_operator = std::make_shared<OperatorCoupled<dim, Number>>(grid,
55 mapping,
56 multigrid_mappings,
57 boundary_descriptor,
58 field_functions,
59 parameters,
60 field,
61 mpi_comm);
62 }
63 else if(parameters.temporal_discretization == TemporalDiscretization::BDFDualSplittingScheme)
64 {
65 pde_operator = std::make_shared<OperatorDualSplitting<dim, Number>>(grid,
66 mapping,
67 multigrid_mappings,
68 boundary_descriptor,
69 field_functions,
70 parameters,
71 field,
72 mpi_comm);
73 }
74 else if(parameters.temporal_discretization == TemporalDiscretization::BDFPressureCorrection)
75 {
76 pde_operator = std::make_shared<OperatorPressureCorrection<dim, Number>>(grid,
77 mapping,
78 multigrid_mappings,
79 boundary_descriptor,
80 field_functions,
81 parameters,
82 field,
83 mpi_comm);
84 }
85 else
86 {
87 AssertThrow(false, dealii::ExcMessage("Not implemented."));
88 }
89
90 return pde_operator;
91}
92
93} // namespace IncNS
94} // namespace ExaDG
95
96
97
98#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CREATE_OPERATOR_H_ */
Definition driver.cpp:33