OGS
ProcessLib::Assembly::CumulativeStats< Data > Class Template Reference

Detailed Description

template<typename Data>
class ProcessLib::Assembly::CumulativeStats< Data >

Definition at line 75 of file MatrixAssemblyStats.h.

#include <MatrixAssemblyStats.h>

Inheritance diagram for ProcessLib::Assembly::CumulativeStats< Data >:
[legend]
Collaboration diagram for ProcessLib::Assembly::CumulativeStats< Data >:
[legend]

Public Member Functions

std::shared_ptr< CumulativeStats< Data > > clone ()
 
 CumulativeStats (CumulativeStats< Data > const &other)=delete
 
 CumulativeStats (CumulativeStats< Data > &other)
 
 CumulativeStats (CumulativeStats< Data > &&other)
 
 ~CumulativeStats ()
 
void print () const
 

Static Public Member Functions

static std::shared_ptr< CumulativeStats< Data > > create ()
 

Public Attributes

Data data
 

Private Types

using Base = std::enable_shared_from_this<CumulativeStats<Data>>
 

Private Member Functions

 CumulativeStats ()
 

Private Attributes

std::shared_ptr< CumulativeStats< Data > > parent_
 
std::shared_ptr< std::mutex > parent_mutex_
 

Member Typedef Documentation

◆ Base

template<typename Data >
using ProcessLib::Assembly::CumulativeStats< Data >::Base = std::enable_shared_from_this<CumulativeStats<Data>>
private

Definition at line 78 of file MatrixAssemblyStats.h.

Constructor & Destructor Documentation

◆ CumulativeStats() [1/4]

template<typename Data >
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( CumulativeStats< Data > const & other)
delete

◆ CumulativeStats() [2/4]

template<typename Data >
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( CumulativeStats< Data > & other)
inline

Definition at line 98 of file MatrixAssemblyStats.h.

99 : Base{other},
100 data{},
101 parent_{other.parent_ ? other.parent_ : other.shared_from_this()},
102 parent_mutex_{other.parent_mutex_}
103 {
104 }
std::shared_ptr< std::mutex > parent_mutex_
std::enable_shared_from_this< CumulativeStats< Data > > Base
std::shared_ptr< CumulativeStats< Data > > parent_

◆ CumulativeStats() [3/4]

template<typename Data >
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( CumulativeStats< Data > && other)
inline

Definition at line 106 of file MatrixAssemblyStats.h.

107 : parent_{std::move(other.parent_)},
108 parent_mutex_{std::move(other.parent_mutex_)}
109 {
110 std::swap(data, other.data);
111 }

References ProcessLib::Assembly::CumulativeStats< Data >::data.

◆ ~CumulativeStats()

template<typename Data >
ProcessLib::Assembly::CumulativeStats< Data >::~CumulativeStats ( )
inline

Definition at line 113 of file MatrixAssemblyStats.h.

114 {
115 if (!parent_)
116 {
117 return;
118 }
119
120 std::lock_guard<std::mutex> const lock(*parent_mutex_);
121
122 DBUG("Adding cumulative stats to parent.");
123
124 parent_->data += data;
125 }
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30

References ProcessLib::Assembly::CumulativeStats< Data >::data, DBUG(), ProcessLib::Assembly::CumulativeStats< Data >::parent_, and ProcessLib::Assembly::CumulativeStats< Data >::parent_mutex_.

◆ CumulativeStats() [4/4]

template<typename Data >
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( )
inlineprivate

Definition at line 130 of file MatrixAssemblyStats.h.

130: parent_mutex_{std::make_shared<std::mutex>()} {}

Member Function Documentation

◆ clone()

template<typename Data >
std::shared_ptr< CumulativeStats< Data > > ProcessLib::Assembly::CumulativeStats< Data >::clone ( )
inline

Definition at line 91 of file MatrixAssemblyStats.h.

92 {
93 return std::make_shared<CumulativeStats<Data>>(*this);
94 }

◆ create()

template<typename Data >
static std::shared_ptr< CumulativeStats< Data > > ProcessLib::Assembly::CumulativeStats< Data >::create ( )
inlinestatic

Definition at line 83 of file MatrixAssemblyStats.h.

84 {
85 return std::shared_ptr<CumulativeStats<Data>>(
86 new CumulativeStats<Data>());
87 }

Referenced by ProcessLib::Assembly::ParallelVectorMatrixAssembler::assembleWithJacobian().

◆ print()

template<typename Data >
void ProcessLib::Assembly::CumulativeStats< Data >::print ( ) const
inline

Definition at line 127 of file MatrixAssemblyStats.h.

127{ data.print(); }

References ProcessLib::Assembly::CumulativeStats< Data >::data.

Member Data Documentation

◆ data

◆ parent_

template<typename Data >
std::shared_ptr<CumulativeStats<Data> > ProcessLib::Assembly::CumulativeStats< Data >::parent_
private

◆ parent_mutex_

template<typename Data >
std::shared_ptr<std::mutex> ProcessLib::Assembly::CumulativeStats< Data >::parent_mutex_
private

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