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 or
75 // we can not instantiate the base class and instantiate an arbitrary deriving
76 // class for InterpolateAnalyticalSolution.
77 parameters.temporal_discretization ==
78 TemporalDiscretization::InterpolateAnalyticalSolution)
79 {
80 pde_operator = std::make_shared<OperatorPressureCorrection<dim, Number>>(grid,
81 mapping,
82 multigrid_mappings,
83 boundary_descriptor,
84 field_functions,
85 parameters,
86 field,
87 mpi_comm);
88 }
89 else
90 {
91 AssertThrow(false, dealii::ExcMessage("Not implemented."));
92 }
93
94 return pde_operator;
95}
96
97} // namespace IncNS
98} // namespace ExaDG
99
100
101
102#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CREATE_OPERATOR_H_ */
Definition parameters.h:46
Definition driver.cpp:33
Definition boundary_descriptor.h:240
Definition field_functions.h:31