OGS
ProcessLib::IntegrationPointWriter Struct Referencefinal

Detailed Description

Definition at line 27 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 30 of file IntegrationPointWriter.h.

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

References _callback.

Member Function Documentation

◆ integrationOrder()

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

Definition at line 61 of file IntegrationPointWriter.h.

61 { return _integration_order; }

References _integration_order.

Referenced by addIntegrationPointData().

◆ name()

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

Definition at line 62 of file IntegrationPointWriter.h.

62 { return _name; }

References _name.

Referenced by addIntegrationPointData().

◆ numberOfComponents()

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

Definition at line 60 of file IntegrationPointWriter.h.

60 { return _n_components; }

References _n_components.

Referenced by addIntegrationPointData().

◆ values()

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

Definition at line 63 of file IntegrationPointWriter.h.

63 { 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 69 of file IntegrationPointWriter.h.

Referenced by IntegrationPointWriter(), and values().

◆ _integration_order

int const ProcessLib::IntegrationPointWriter::_integration_order
private

Definition at line 68 of file IntegrationPointWriter.h.

Referenced by integrationOrder().

◆ _n_components

int const ProcessLib::IntegrationPointWriter::_n_components
private

Definition at line 67 of file IntegrationPointWriter.h.

Referenced by numberOfComponents().

◆ _name

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

Definition at line 66 of file IntegrationPointWriter.h.

Referenced by name().


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