OGS
ExtrapolatorData.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <memory>
16 
17 namespace ProcessLib
18 {
27 {
28 public:
29  ExtrapolatorData() = default;
30 
41  std::unique_ptr<NumLib::Extrapolator>&& extrapolator,
42  NumLib::LocalToGlobalIndexMap const* const dof_table_single_component,
43  bool const manage_storage)
44  : _extrapolator(std::move(extrapolator)),
45  _dof_table_single_component(dof_table_single_component),
46  _manage_storage(manage_storage)
47  {
48  }
49 
51  : _extrapolator(std::move(other._extrapolator)),
54  {
55  other._manage_storage = false;
56  other._dof_table_single_component = nullptr;
57  }
58 
60  {
61  cleanup();
62  _manage_storage = other._manage_storage;
63  _dof_table_single_component = other._dof_table_single_component;
64  _extrapolator = std::move(other._extrapolator);
65  other._dof_table_single_component = nullptr;
66  other._manage_storage = false;
67  return *this;
68  }
69 
71  {
73  }
75 
77 
78 private:
80  void cleanup()
81  {
82  if (_manage_storage)
83  {
86  }
87  }
88 
90  std::unique_ptr<NumLib::Extrapolator> _extrapolator;
91 
94 
97  bool _manage_storage = false;
98 };
99 
100 } // namespace ProcessLib
NumLib::LocalToGlobalIndexMap const & getDOFTable() const
std::unique_ptr< NumLib::Extrapolator > _extrapolator
Extrapolator managed by the ExtrapolatorData instance.
NumLib::Extrapolator & getExtrapolator() const
ExtrapolatorData & operator=(ExtrapolatorData &&other)
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)