ExaDG
Loading...
Searching...
No Matches
body_force_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_STRUCTURE_SPATIAL_DISCRETIZATION_RHS_OPERATOR_H_
23#define INCLUDE_STRUCTURE_SPATIAL_DISCRETIZATION_RHS_OPERATOR_H_
24
25// ExaDG
26#include <exadg/matrix_free/integrators.h>
27#include <exadg/operators/mapping_flags.h>
28
29namespace ExaDG
30{
31namespace Structure
32{
33template<int dim>
35{
36 BodyForceData() : dof_index(0), quad_index(0), pull_back_body_force(false)
37 {
38 }
39
40 unsigned int dof_index;
41 unsigned int quad_index;
42
43 std::shared_ptr<dealii::Function<dim>> function;
44
45 bool pull_back_body_force;
46};
47
48template<int dim, typename Number>
50{
51private:
52 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
53
55
56 typedef std::pair<unsigned int, unsigned int> Range;
57
58 typedef CellIntegrator<dim, dim, Number> IntegratorCell;
59
60public:
61 /*
62 * Constructor.
63 */
65
66 /*
67 * Initialization.
68 */
69 void
70 initialize(dealii::MatrixFree<dim, Number> const & matrix_free, BodyForceData<dim> const & data);
71
72 static MappingFlags
73 get_mapping_flags();
74
75 /*
76 * Evaluate operator and add to dst-vector.
77 */
78 void
79 evaluate_add(VectorType & dst, VectorType const & src, double const time) const;
80
81private:
82 void
83 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
84 VectorType & dst,
85 VectorType const & src,
86 Range const & cell_range) const;
87
88 dealii::MatrixFree<dim, Number> const * matrix_free;
89
91
92 double mutable time;
93};
94
95} // namespace Structure
96} // namespace ExaDG
97
98#endif
Definition body_force_operator.h:50
Definition driver.cpp:33
Definition mapping_flags.h:31
Definition body_force_operator.h:35