OGS
ProcessLib::ExtrapolatorData Class Reference

Detailed Description

Helper struct containing an extrapolator and a single component DOF table.

Storage for the DOF table is managed optionally.

Todo:
Later on this struct shall be moved, e.g., be merged with the process output class.

Definition at line 26 of file ExtrapolatorData.h.

#include <ExtrapolatorData.h>

Collaboration diagram for ProcessLib::ExtrapolatorData:
[legend]

Public Member Functions

 ExtrapolatorData ()=default
 
 ExtrapolatorData (std::unique_ptr< NumLib::Extrapolator > &&extrapolator, NumLib::LocalToGlobalIndexMap const *const dof_table_single_component, bool const manage_storage)
 
 ExtrapolatorData (ExtrapolatorData &&other)
 
ExtrapolatorDataoperator= (ExtrapolatorData &&other)
 
NumLib::LocalToGlobalIndexMap const & getDOFTable () const
 
NumLib::ExtrapolatorgetExtrapolator () const
 
 ~ExtrapolatorData ()
 

Private Member Functions

void cleanup ()
 Deletes the d.o.f table if it is allowed to do so. More...
 

Private Attributes

std::unique_ptr< NumLib::Extrapolator_extrapolator
 Extrapolator managed by the ExtrapolatorData instance. More...
 
NumLib::LocalToGlobalIndexMap const * _dof_table_single_component = nullptr
 D.o.f. table used by the extrapolator. More...
 
bool _manage_storage = false
 

Constructor & Destructor Documentation

◆ ExtrapolatorData() [1/3]

ProcessLib::ExtrapolatorData::ExtrapolatorData ( )
default

◆ ExtrapolatorData() [2/3]

ProcessLib::ExtrapolatorData::ExtrapolatorData ( std::unique_ptr< NumLib::Extrapolator > &&  extrapolator,
NumLib::LocalToGlobalIndexMap const *const  dof_table_single_component,
bool const  manage_storage 
)
inline

Constructs a new instance.

Parameters
extrapolatorthe extrapolator managed by the instance being created
dof_table_single_componentthe d.o.f. table used by the extrapolator
manage_storageIf true the memory of dof_table_single_component will be freed by the destructor of this class.

Definition at line 40 of file ExtrapolatorData.h.

44  : _extrapolator(std::move(extrapolator)),
45  _dof_table_single_component(dof_table_single_component),
46  _manage_storage(manage_storage)
47  {
48  }
std::unique_ptr< NumLib::Extrapolator > _extrapolator
Extrapolator managed by the ExtrapolatorData instance.
NumLib::LocalToGlobalIndexMap const * _dof_table_single_component
D.o.f. table used by the extrapolator.

◆ ExtrapolatorData() [3/3]

ProcessLib::ExtrapolatorData::ExtrapolatorData ( ExtrapolatorData &&  other)
inline

Definition at line 50 of file ExtrapolatorData.h.

51  : _extrapolator(std::move(other._extrapolator)),
52  _dof_table_single_component(other._dof_table_single_component),
53  _manage_storage(other._manage_storage)
54  {
55  other._manage_storage = false;
56  other._dof_table_single_component = nullptr;
57  }

◆ ~ExtrapolatorData()

ProcessLib::ExtrapolatorData::~ExtrapolatorData ( )
inline

Definition at line 76 of file ExtrapolatorData.h.

76 { cleanup(); }
void cleanup()
Deletes the d.o.f table if it is allowed to do so.

References cleanup().

Member Function Documentation

◆ cleanup()

void ProcessLib::ExtrapolatorData::cleanup ( )
inlineprivate

Deletes the d.o.f table if it is allowed to do so.

Definition at line 80 of file ExtrapolatorData.h.

81  {
82  if (_manage_storage)
83  {
86  }
87  }

References _dof_table_single_component, and _manage_storage.

Referenced by ~ExtrapolatorData(), and operator=().

◆ getDOFTable()

NumLib::LocalToGlobalIndexMap const& ProcessLib::ExtrapolatorData::getDOFTable ( ) const
inline

Definition at line 70 of file ExtrapolatorData.h.

71  {
73  }

References _dof_table_single_component.

Referenced by ProcessLib::Process::getSingleComponentDOFTable().

◆ getExtrapolator()

NumLib::Extrapolator& ProcessLib::ExtrapolatorData::getExtrapolator ( ) const
inline

Definition at line 74 of file ExtrapolatorData.h.

74 { return *_extrapolator; }

References _extrapolator.

Referenced by ProcessLib::Process::getExtrapolator().

◆ operator=()

ExtrapolatorData& ProcessLib::ExtrapolatorData::operator= ( ExtrapolatorData &&  other)
inline

Definition at line 59 of file ExtrapolatorData.h.

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  }

References _dof_table_single_component, _extrapolator, _manage_storage, and cleanup().

Member Data Documentation

◆ _dof_table_single_component

NumLib::LocalToGlobalIndexMap const* ProcessLib::ExtrapolatorData::_dof_table_single_component = nullptr
private

D.o.f. table used by the extrapolator.

Definition at line 93 of file ExtrapolatorData.h.

Referenced by cleanup(), getDOFTable(), and operator=().

◆ _extrapolator

std::unique_ptr<NumLib::Extrapolator> ProcessLib::ExtrapolatorData::_extrapolator
private

Extrapolator managed by the ExtrapolatorData instance.

Definition at line 90 of file ExtrapolatorData.h.

Referenced by getExtrapolator(), and operator=().

◆ _manage_storage

bool ProcessLib::ExtrapolatorData::_manage_storage = false
private

If true, free storage of the d.o.f. table in the ExtrapolatorData destructor.

Definition at line 97 of file ExtrapolatorData.h.

Referenced by cleanup(), and operator=().


The documentation for this class was generated from the following file: