OGS
ParameterLib::FunctionEvaluation::PerThreadData Struct Reference

Detailed Description

Symbol table storage and compiled expressions for one OpenMP thread. Each thread receives its own instance so that concurrent evaluations do not race on the exprtk symbol table variables.

Definition at line 68 of file FunctionEvaluation.h.

Collaboration diagram for ParameterLib::FunctionEvaluation::PerThreadData:
[legend]

Public Member Functions

 PerThreadData (std::vector< std::string > const &variables, bool spatial_position_is_required, std::vector< std::string > const &used_curve_names, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< std::string > const &expression_strings)
 PerThreadData (PerThreadData &&other)
PerThreadDataoperator= (PerThreadData &&other) noexcept=delete
 PerThreadData (PerThreadData const &)=delete
PerThreadDataoperator= (PerThreadData const &)=delete

Public Attributes

std::map< std::string, CurveWrappercurve_wrappers
 Curve wrappers owned by this thread; must outlive symbol_table.
SymbolTable symbol_table
std::vector< Expressionvalue_expressions
 Compiled value expressions. Must be destroyed before symbol_table.
SymbolTableCache symbol_table_cache
 Cached pointers to t, x, y, z inside symbol_table.

Constructor & Destructor Documentation

◆ PerThreadData() [1/3]

ParameterLib::FunctionEvaluation::PerThreadData::PerThreadData ( std::vector< std::string > const & variables,
bool spatial_position_is_required,
std::vector< std::string > const & used_curve_names,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< std::string > const & expression_strings )

Definition at line 67 of file FunctionEvaluation.cpp.

75 : symbol_table(createSymbolTable(variables, spatial_position_is_required,
76 used_curve_names, curves, curve_wrappers)),
78 symbol_table_cache(symbol_table, spatial_position_is_required)
79{
80}
std::vector< exprtk::expression< T > > compileExpressions(exprtk::symbol_table< T > &symbol_table, std::vector< std::string > const &string_expressions)
Definition ExprtkUtils.h:74
static FunctionEvaluation::SymbolTable createSymbolTable(std::vector< std::string > const &variables, bool const spatial_position_is_required, std::vector< std::string > const &used_curve_names, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::map< std::string, CurveWrapper > &curve_wrappers)
std::map< std::string, CurveWrapper > curve_wrappers
Curve wrappers owned by this thread; must outlive symbol_table.
SymbolTableCache symbol_table_cache
Cached pointers to t, x, y, z inside symbol_table.
std::vector< Expression > value_expressions
Compiled value expressions. Must be destroyed before symbol_table.

References ParameterLib::compileExpressions(), ParameterLib::createSymbolTable(), curve_wrappers, symbol_table, symbol_table_cache, and value_expressions.

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

◆ PerThreadData() [2/3]

ParameterLib::FunctionEvaluation::PerThreadData::PerThreadData ( PerThreadData && other)

Definition at line 82 of file FunctionEvaluation.cpp.

83{
85 "Function parameter: The internal PerThreadData is not "
86 "move-constructible.");
87}
#define OGS_FATAL(...)
Definition Error.h:10

References PerThreadData(), and OGS_FATAL.

◆ PerThreadData() [3/3]

ParameterLib::FunctionEvaluation::PerThreadData::PerThreadData ( PerThreadData const & )
delete

References PerThreadData().

Member Function Documentation

◆ operator=() [1/2]

PerThreadData & ParameterLib::FunctionEvaluation::PerThreadData::operator= ( PerThreadData && other)
deletenoexcept

References PerThreadData().

◆ operator=() [2/2]

PerThreadData & ParameterLib::FunctionEvaluation::PerThreadData::operator= ( PerThreadData const & )
delete

References PerThreadData().

Member Data Documentation

◆ curve_wrappers

std::map<std::string, CurveWrapper> ParameterLib::FunctionEvaluation::PerThreadData::curve_wrappers

Curve wrappers owned by this thread; must outlive symbol_table.

Definition at line 86 of file FunctionEvaluation.h.

Referenced by PerThreadData().

◆ symbol_table

SymbolTable ParameterLib::FunctionEvaluation::PerThreadData::symbol_table

Symbol table holding variable storage. Must be destroyed after value_expressions (exprtk requirement) and after curve_wrappers.

Definition at line 89 of file FunctionEvaluation.h.

Referenced by PerThreadData().

◆ symbol_table_cache

SymbolTableCache ParameterLib::FunctionEvaluation::PerThreadData::symbol_table_cache

Cached pointers to t, x, y, z inside symbol_table.

Definition at line 93 of file FunctionEvaluation.h.

Referenced by PerThreadData().

◆ value_expressions

std::vector<Expression> ParameterLib::FunctionEvaluation::PerThreadData::value_expressions

Compiled value expressions. Must be destroyed before symbol_table.

Definition at line 91 of file FunctionEvaluation.h.

Referenced by PerThreadData().


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