OGS
ExtrapolatorData.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#include <memory>
14
15
#include "
NumLib/DOF/LocalToGlobalIndexMap.h
"
16
#include "
NumLib/Extrapolation/Extrapolator.h
"
17
18
namespace
ProcessLib
19
{
27
class
ExtrapolatorData
28
{
29
public
:
30
ExtrapolatorData
() =
default
;
31
41
ExtrapolatorData
(
42
std::unique_ptr<NumLib::Extrapolator>&& extrapolator,
43
NumLib::LocalToGlobalIndexMap
const
*
const
dof_table_single_component,
44
bool
const
manage_storage)
45
:
_extrapolator
(std::move(extrapolator)),
46
_dof_table_single_component
(dof_table_single_component),
47
_manage_storage
(manage_storage)
48
{
49
}
50
51
ExtrapolatorData
(
ExtrapolatorData
&& other)
52
:
_extrapolator
(std::move(other.
_extrapolator
)),
53
_dof_table_single_component
(other.
_dof_table_single_component
),
54
_manage_storage
(other.
_manage_storage
)
55
{
56
other._manage_storage =
false
;
57
other._dof_table_single_component =
nullptr
;
58
}
59
60
ExtrapolatorData
&
operator=
(
ExtrapolatorData
&& other)
61
{
62
cleanup
();
63
_manage_storage
= other._manage_storage;
64
_dof_table_single_component
= other._dof_table_single_component;
65
_extrapolator
= std::move(other._extrapolator);
66
other._dof_table_single_component =
nullptr
;
67
other._manage_storage =
false
;
68
return
*
this
;
69
}
70
71
NumLib::LocalToGlobalIndexMap
const
&
getDOFTable
()
const
72
{
73
return
*
_dof_table_single_component
;
74
}
75
NumLib::Extrapolator
&
getExtrapolator
()
const
{
return
*
_extrapolator
; }
76
77
~ExtrapolatorData
() {
cleanup
(); }
78
79
private
:
81
void
cleanup
()
82
{
83
if
(
_manage_storage
)
84
{
85
delete
_dof_table_single_component
;
86
_dof_table_single_component
=
nullptr
;
87
}
88
}
89
91
std::unique_ptr<NumLib::Extrapolator>
_extrapolator
;
92
94
NumLib::LocalToGlobalIndexMap
const
*
_dof_table_single_component
=
nullptr
;
95
98
bool
_manage_storage
=
false
;
99
};
100
101
}
// namespace ProcessLib
Extrapolator.h
LocalToGlobalIndexMap.h
NumLib::Extrapolator
Definition
Extrapolator.h:26
NumLib::LocalToGlobalIndexMap
Definition
LocalToGlobalIndexMap.h:41
ProcessLib::ExtrapolatorData
Definition
ExtrapolatorData.h:28
ProcessLib::ExtrapolatorData::operator=
ExtrapolatorData & operator=(ExtrapolatorData &&other)
Definition
ExtrapolatorData.h:60
ProcessLib::ExtrapolatorData::_extrapolator
std::unique_ptr< NumLib::Extrapolator > _extrapolator
Extrapolator managed by the ExtrapolatorData instance.
Definition
ExtrapolatorData.h:91
ProcessLib::ExtrapolatorData::getDOFTable
NumLib::LocalToGlobalIndexMap const & getDOFTable() const
Definition
ExtrapolatorData.h:71
ProcessLib::ExtrapolatorData::_manage_storage
bool _manage_storage
Definition
ExtrapolatorData.h:98
ProcessLib::ExtrapolatorData::~ExtrapolatorData
~ExtrapolatorData()
Definition
ExtrapolatorData.h:77
ProcessLib::ExtrapolatorData::getExtrapolator
NumLib::Extrapolator & getExtrapolator() const
Definition
ExtrapolatorData.h:75
ProcessLib::ExtrapolatorData::ExtrapolatorData
ExtrapolatorData(std::unique_ptr< NumLib::Extrapolator > &&extrapolator, NumLib::LocalToGlobalIndexMap const *const dof_table_single_component, bool const manage_storage)
Definition
ExtrapolatorData.h:41
ProcessLib::ExtrapolatorData::ExtrapolatorData
ExtrapolatorData()=default
ProcessLib::ExtrapolatorData::_dof_table_single_component
NumLib::LocalToGlobalIndexMap const * _dof_table_single_component
D.o.f. table used by the extrapolator.
Definition
ExtrapolatorData.h:94
ProcessLib::ExtrapolatorData::cleanup
void cleanup()
Deletes the d.o.f table if it is allowed to do so.
Definition
ExtrapolatorData.h:81
ProcessLib::ExtrapolatorData::ExtrapolatorData
ExtrapolatorData(ExtrapolatorData &&other)
Definition
ExtrapolatorData.h:51
ProcessLib
Definition
ProjectData.h:51
ProcessLib
Output
ExtrapolatorData.h
Generated by
1.12.0