ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
operators
mass_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_OPERATORS_MASS_OPERATOR_H_
23
#define EXADG_OPERATORS_MASS_OPERATOR_H_
24
25
// ExaDG
26
#include <exadg/matrix_free/integrators.h>
27
#include <exadg/operators/mass_kernel.h>
28
#include <exadg/operators/operator_base.h>
29
#include <exadg/operators/variable_coefficients.h>
30
31
namespace
ExaDG
32
{
33
template
<
int
dim,
typename
Number>
34
struct
MassOperatorData :
public
OperatorBaseData
35
{
36
MassOperatorData()
37
: OperatorBaseData(),
38
coefficient_is_variable(
false
),
39
variable_coefficients(
nullptr
),
40
consider_inverse_coefficient(
false
)
41
{
42
}
43
44
// variable coefficients
45
bool
coefficient_is_variable;
46
VariableCoefficients<dealii::VectorizedArray<Number>
>
const
* variable_coefficients;
47
// use the inverse of the coefficients stored in `variable_coefficients`
48
bool
consider_inverse_coefficient;
49
};
50
51
template
<
int
dim,
int
n_components,
typename
Number>
52
class
MassOperator :
public
OperatorBase<dim, Number, n_components>
53
{
54
public
:
55
typedef
Number value_type;
56
57
typedef
OperatorBase<dim, Number, n_components> Base;
58
59
typedef
typename
Base::VectorType VectorType;
60
typedef
typename
Base::IntegratorCell IntegratorCell;
61
62
MassOperator();
63
64
void
65
initialize(dealii::MatrixFree<dim, Number>
const
& matrix_free,
66
dealii::AffineConstraints<Number>
const
& affine_constraints,
67
MassOperatorData<dim, Number>
const
& data);
68
69
void
70
set_scaling_factor(Number
const
& number);
71
72
void
73
apply_scale(VectorType & dst, Number
const
& factor, VectorType
const
& src)
const
;
74
75
void
76
apply_scale_add(VectorType & dst, Number
const
& factor, VectorType
const
& src)
const
;
77
78
private
:
79
void
80
do_cell_integral(IntegratorCell & integrator)
const
final
;
81
82
MassKernel<dim, Number>
kernel;
83
84
mutable
double
scaling_factor;
85
86
// Variable coefficients not managed by this class.
87
MassOperatorData<dim, Number>
operator_data;
88
};
89
90
}
// namespace ExaDG
91
92
#endif
/* EXADG_OPERATORS_MASS_OPERATOR_H_ */
ExaDG::MassKernel
Definition
mass_kernel.h:35
ExaDG::VariableCoefficients
Definition
variable_coefficients.h:40
ExaDG
Definition
driver.cpp:33
ExaDG::MassOperatorData
Definition
mass_operator.h:35
Generated by
1.17.0