ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
structure
spatial_discretization
operators
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 EXADG_STRUCTURE_SPATIAL_DISCRETIZATION_OPERATORS_BODY_FORCE_OPERATOR_H_
23
#define EXADG_STRUCTURE_SPATIAL_DISCRETIZATION_OPERATORS_BODY_FORCE_OPERATOR_H_
24
25
// ExaDG
26
#include <exadg/matrix_free/integrators.h>
27
#include <exadg/operators/mapping_flags.h>
28
29
namespace
ExaDG
30
{
31
namespace
Structure
32
{
33
template
<
int
dim>
34
struct
BodyForceData
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
48
template
<
int
dim,
typename
Number>
49
class
BodyForceOperator
50
{
51
private
:
52
typedef
dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
53
54
typedef
BodyForceOperator<dim, Number> This;
55
56
typedef
std::pair<unsigned int, unsigned int> Range;
57
58
typedef
CellIntegrator<dim, dim, Number> IntegratorCell;
59
60
public
:
61
/*
62
* Constructor.
63
*/
64
BodyForceOperator();
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
81
private
:
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
90
BodyForceData<dim>
data;
91
92
double
mutable
time;
93
};
94
95
}
// namespace Structure
96
}
// namespace ExaDG
97
98
#endif
/* EXADG_STRUCTURE_SPATIAL_DISCRETIZATION_OPERATORS_BODY_FORCE_OPERATOR_H_ */
ExaDG
Definition
driver.cpp:33
ExaDG::MappingFlags
Definition
mapping_flags.h:31
ExaDG::Structure::BodyForceData
Definition
body_force_operator.h:35
Generated by
1.17.0