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 27 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.
 

Private Attributes

std::unique_ptr< NumLib::Extrapolator_extrapolator
 Extrapolator managed by the ExtrapolatorData instance.
 
NumLib::LocalToGlobalIndexMap const * _dof_table_single_component = nullptr
 D.o.f. table used by the extrapolator.
 
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 41 of file ExtrapolatorData.h.

45 : _extrapolator(std::move(extrapolator)),
46 _dof_table_single_component(dof_table_single_component),
47 _manage_storage(manage_storage)
48 {
49 }
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 51 of file ExtrapolatorData.h.

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 }

◆ ~ExtrapolatorData()

ProcessLib::ExtrapolatorData::~ExtrapolatorData ( )
inline

Definition at line 77 of file ExtrapolatorData.h.

77{ 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 81 of file ExtrapolatorData.h.

82 {
84 {
87 }
88 }

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 71 of file ExtrapolatorData.h.

72 {
74 }

References _dof_table_single_component.

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

◆ getExtrapolator()

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

Definition at line 75 of file ExtrapolatorData.h.

75{ return *_extrapolator; }

References _extrapolator.

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

◆ operator=()

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

Definition at line 60 of file ExtrapolatorData.h.

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 }

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 94 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 91 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 98 of file ExtrapolatorData.h.

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


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