OGS
ExtrapolatorData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7
10
11namespace ProcessLib
12{
21{
22public:
23 ExtrapolatorData() = default;
24
35 std::unique_ptr<NumLib::Extrapolator>&& extrapolator,
36 NumLib::LocalToGlobalIndexMap const* const dof_table_single_component,
37 bool const manage_storage)
38 : _extrapolator(std::move(extrapolator)),
39 _dof_table_single_component(dof_table_single_component),
40 _manage_storage(manage_storage)
41 {
42 }
43
45 : _extrapolator(std::move(other._extrapolator)),
48 {
49 other._manage_storage = false;
50 other._dof_table_single_component = nullptr;
51 }
52
54 {
55 cleanup();
56 _manage_storage = other._manage_storage;
57 _dof_table_single_component = other._dof_table_single_component;
58 _extrapolator = std::move(other._extrapolator);
59 other._dof_table_single_component = nullptr;
60 other._manage_storage = false;
61 return *this;
62 }
63
69
71
72private:
74 void cleanup()
75 {
77 {
80 }
81 }
82
84 std::unique_ptr<NumLib::Extrapolator> _extrapolator;
85
88
91 bool _manage_storage = false;
92};
93
94} // namespace ProcessLib
ExtrapolatorData & operator=(ExtrapolatorData &&other)
std::unique_ptr< NumLib::Extrapolator > _extrapolator
Extrapolator managed by the ExtrapolatorData instance.
NumLib::LocalToGlobalIndexMap const & getDOFTable() const
NumLib::Extrapolator & getExtrapolator() const
ExtrapolatorData(std::unique_ptr< NumLib::Extrapolator > &&extrapolator, NumLib::LocalToGlobalIndexMap const *const dof_table_single_component, bool const manage_storage)
NumLib::LocalToGlobalIndexMap const * _dof_table_single_component
D.o.f. table used by the extrapolator.
void cleanup()
Deletes the d.o.f table if it is allowed to do so.
ExtrapolatorData(ExtrapolatorData &&other)