ExaDG
Loading...
Searching...
No Matches
projection_operator.h
1/*
2 * projection_operator.h
3 *
4 * Created on: Jun 17, 2016
5 * Author: fehn
6 */
7
8#ifndef INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATORS_PROJECTION_OPERATOR_H_
9#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATORS_PROJECTION_OPERATOR_H_
10
11#include <exadg/incompressible_navier_stokes/spatial_discretization/operators/continuity_penalty_operator.h>
12#include <exadg/incompressible_navier_stokes/spatial_discretization/operators/divergence_penalty_operator.h>
13#include <exadg/operators/operator_base.h>
14
15namespace ExaDG
16{
17namespace IncNS
18{
19/*
20 * Combined divergence and continuity penalty operator: applies the operation
21 *
22 * mass operator + dt * divergence penalty operator + dt * continuity penalty operator .
23 *
24 * In detail
25 *
26 * Mass operator: ( v_h , u_h )_Omega^e where
27 *
28 * Divergence penalty operator: ( div(v_h) , tau_div * div(u_h) )_Omega^e
29 *
30 * Continuity penalty operator: ( v_h , tau_conti * jump(u_h) )_dOmega^e, where
31 *
32 * jump(u_h) = u_h^{-} - u_h^{+} or ( (u_h^{-} - u_h^{+})*normal ) * normal
33 *
34 * and
35 *
36 * v_h : test function
37 * u_h : solution
38 */
39
40/*
41 * Operator data.
42 */
43template<int dim>
45{
48 use_divergence_penalty(true),
49 use_continuity_penalty(true),
50 use_boundary_data(false)
51 {
52 }
53
54 // specify which penalty terms are used
55 bool use_divergence_penalty, use_continuity_penalty;
56
57 bool use_boundary_data;
58
59 std::shared_ptr<BoundaryDescriptorU<dim> const> bc;
60};
61
62template<int dim, typename Number>
63class ProjectionOperator : public OperatorBase<dim, Number, dim>
64{
65private:
67
68 typedef dealii::Tensor<1, dim, dealii::VectorizedArray<Number>> vector;
69
70 typedef typename Base::VectorType VectorType;
71 typedef typename Base::IntegratorCell IntegratorCell;
72 typedef typename Base::IntegratorFace IntegratorFace;
73
76
77public:
78 typedef Number value_type;
79
80 ProjectionOperator() : velocity(nullptr), time_step_size(1.0)
81 {
82 }
83
84 void
85 initialize(dealii::MatrixFree<dim, Number> const & matrix_free,
86 dealii::AffineConstraints<Number> const & affine_constraints,
87 ProjectionOperatorData<dim> const & data,
88 Operators::DivergencePenaltyKernelData const & div_kernel_data,
89 Operators::ContinuityPenaltyKernelData const & conti_kernel_data);
90
91 void
92 initialize(dealii::MatrixFree<dim, Number> const & matrix_free,
93 dealii::AffineConstraints<Number> const & affine_constraints,
94 ProjectionOperatorData<dim> const & data,
95 std::shared_ptr<DivKernel> div_penalty_kernel,
96 std::shared_ptr<ContiKernel> conti_penalty_kernel);
97
99 get_data() const;
100
102 get_divergence_kernel_data() const;
103
105 get_continuity_kernel_data() const;
106
107 double
108 get_time_step_size() const;
109
110 dealii::LinearAlgebra::distributed::Vector<Number> const &
111 get_velocity() const;
112
113 void
114 update(VectorType const & velocity, double const & dt);
115
116private:
117 void
118 reinit_cell_derived(IntegratorCell & integrator, unsigned int const cell) const final;
119
120 void
121 reinit_face_derived(IntegratorFace & integrator_m,
122 IntegratorFace & integrator_p,
123 unsigned int const face) const final;
124
125 void
126 reinit_boundary_face_derived(IntegratorFace & integrator_m, unsigned int const face) const final;
127
128 void
129 reinit_face_cell_based_derived(IntegratorFace & integrator_m,
130 IntegratorFace & integrator_p,
131 unsigned int const cell,
132 unsigned int const face,
133 dealii::types::boundary_id const boundary_id) const final;
134
135 void
136 do_cell_integral(IntegratorCell & integrator) const final;
137
138 void
139 do_face_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p) const final;
140
141 void
142 do_face_int_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p) const final;
143
144 void
145 do_face_ext_integral(IntegratorFace & integrator_m, IntegratorFace & integrator_p) const final;
146
147 void
148 do_boundary_integral(IntegratorFace & integrator_m,
149 OperatorType const & operator_type,
150 dealii::types::boundary_id const & boundary_id) const final;
151
152 ProjectionOperatorData<dim> operator_data;
153
154 VectorType const * velocity;
155 double time_step_size;
156
157 std::shared_ptr<Operators::DivergencePenaltyKernel<dim, Number>> div_kernel;
158 std::shared_ptr<Operators::ContinuityPenaltyKernel<dim, Number>> conti_kernel;
159};
160
161} // namespace IncNS
162} // namespace ExaDG
163
164#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATORS_PROJECTION_OPERATOR_H_ \
165 */
Definition continuity_penalty_operator.h:81
Definition divergence_penalty_operator.h:70
Definition projection_operator.h:64
Definition operator_base.h:98
Definition driver.cpp:33
Definition continuity_penalty_operator.h:52
Definition divergence_penalty_operator.h:46
Definition projection_operator.h:45
Definition operator_base.h:59