OGS
ProcessLib::IntegrationPointWriter Struct Referencefinal

Detailed Description

Definition at line 24 of file IntegrationPointWriter.h.

#include <IntegrationPointWriter.h>

Public Member Functions

template<typename LocalAssemblerInterface , typename... Args>
 IntegrationPointWriter (std::string const &name, int const n_components, int const integration_order, std::vector< std::unique_ptr< LocalAssemblerInterface >> const &local_assemblers, std::vector< double >(LocalAssemblerInterface::*getIpData)(Args...) const, Args &&... args)
 
int numberOfComponents () const
 
int integrationOrder () const
 
std::string name () const
 
std::vector< std::vector< double > > values () const
 

Private Attributes

std::string const _name
 
int const _n_components
 
int const _integration_order
 
std::function< std::vector< std::vector< double > >)> _callback
 

Constructor & Destructor Documentation

◆ IntegrationPointWriter()

template<typename LocalAssemblerInterface , typename... Args>
ProcessLib::IntegrationPointWriter::IntegrationPointWriter ( std::string const &  name,
int const  n_components,
int const  integration_order,
std::vector< std::unique_ptr< LocalAssemblerInterface >> const &  local_assemblers,
std::vector< double >(LocalAssemblerInterface::*)(Args...) const  getIpData,
Args &&...  args 
)
inline

Definition at line 27 of file IntegrationPointWriter.h.

36  : _name(name),
37  _n_components(n_components),
38  _integration_order(integration_order)
39  {
40  _callback = [&local_assemblers,
41  getIpData,
42  ... f_args = std::forward<Args>(args)]
43  {
44  // Result containing integration point data for each local
45  // assembler.
46  std::vector<std::vector<double>> result;
47  result.reserve(local_assemblers.size());
48 
49  std::transform(begin(local_assemblers), end(local_assemblers),
50  std::back_inserter(result),
51  [&](auto const& la)
52  { return (*la.*getIpData)(f_args...); });
53 
54  return result;
55  };
56  }
std::function< std::vector< std::vector< double > >)> _callback

References _callback.

Member Function Documentation

◆ integrationOrder()

int ProcessLib::IntegrationPointWriter::integrationOrder ( ) const
inline

Definition at line 58 of file IntegrationPointWriter.h.

58 { return _integration_order; }

References _integration_order.

Referenced by addIntegrationPointData().

◆ name()

std::string ProcessLib::IntegrationPointWriter::name ( ) const
inline

Definition at line 59 of file IntegrationPointWriter.h.

59 { return _name; }

References _name.

Referenced by addIntegrationPointData().

◆ numberOfComponents()

int ProcessLib::IntegrationPointWriter::numberOfComponents ( ) const
inline

Definition at line 57 of file IntegrationPointWriter.h.

57 { return _n_components; }

References _n_components.

Referenced by addIntegrationPointData().

◆ values()

std::vector<std::vector<double> > ProcessLib::IntegrationPointWriter::values ( ) const
inline

Definition at line 60 of file IntegrationPointWriter.h.

60 { return _callback(); }

References _callback.

Referenced by addIntegrationPointData().

Member Data Documentation

◆ _callback

std::function<std::vector<std::vector<double> >)> ProcessLib::IntegrationPointWriter::_callback
private

Definition at line 66 of file IntegrationPointWriter.h.

Referenced by IntegrationPointWriter(), and values().

◆ _integration_order

int const ProcessLib::IntegrationPointWriter::_integration_order
private

Definition at line 65 of file IntegrationPointWriter.h.

Referenced by integrationOrder().

◆ _n_components

int const ProcessLib::IntegrationPointWriter::_n_components
private

Definition at line 64 of file IntegrationPointWriter.h.

Referenced by numberOfComponents().

◆ _name

std::string const ProcessLib::IntegrationPointWriter::_name
private

Definition at line 63 of file IntegrationPointWriter.h.

Referenced by name().


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