KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Construct class to read into expressions from templated data values and write in to templated data values. More...
#include <variable_expression_data_io.h>
Public Types | |
Type definitions | |
using | Pointer = std::shared_ptr< VariableExpressionDataIO< TDataType > > |
using | IndexType = std::size_t |
using | RawType = std::conditional_t< std::disjunction_v< std::is_same< TDataType, int >, std::is_same< TDataType, std::vector< int > > >, int, double > |
using | RawLiteralFlatExpression = LiteralFlatExpression< RawType > |
Public Member Functions | |
void | Assign (int &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Assign (std::vector< int > &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const int &Value) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const std::vector< int > &Value) const |
void | Assign (double &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Assign (std::vector< double > &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const double &Value) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const std::vector< double > &Value) const |
void | Assign (Vector &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Assign (std::vector< Vector > &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const Vector &Value) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const std::vector< Vector > &Value) const |
void | Assign (Matrix &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Assign (std::vector< Matrix > &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const Matrix &Value) const |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const std::vector< Matrix > &Value) const |
Life cycle | |
VariableExpressionDataIO (const TDataType &SampleValue) | |
Construct a new Variable Expression Data IO object from a given SampleValue. More... | |
VariableExpressionDataIO (const std::vector< IndexType > &rShape) | |
Construct a new Variable Expression Data IO object from a given shape. More... | |
Public operations | |
void | Assign (TDataType &rOutput, const Expression &rExpression, const IndexType EntityIndex) const |
Evaluate the expression and assign the values to rOutput at the given index. More... | |
void | Read (RawLiteralFlatExpression &rExpression, const IndexType EntityIndex, const TDataType &Value) const |
Read into expression the values from given value. More... | |
const std::vector< IndexType > | GetItemShape () const |
Get the shape of the data type. More... | |
static Pointer | Create (const TDataType &SampleValue) |
Create a VariableExpressionDataIO from a given Sample value. More... | |
static Pointer | Create (const std::vector< IndexType > &rShape) |
Create a VariableExpressionDataIO from a given shape. More... | |
Construct class to read into expressions from templated data values and write in to templated data values.
TDataType |
using Kratos::VariableExpressionDataIO< TDataType >::IndexType = std::size_t |
using Kratos::VariableExpressionDataIO< TDataType >::Pointer = std::shared_ptr<VariableExpressionDataIO<TDataType> > |
using Kratos::VariableExpressionDataIO< TDataType >::RawLiteralFlatExpression = LiteralFlatExpression<RawType> |
using Kratos::VariableExpressionDataIO< TDataType >::RawType = std::conditional_t< std::disjunction_v< std::is_same<TDataType, int>, std::is_same<TDataType, std::vector<int> > >, int, double> |
Kratos::VariableExpressionDataIO< TDataType >::VariableExpressionDataIO | ( | const TDataType & | SampleValue | ) |
Construct a new Variable Expression Data IO object from a given SampleValue.
This will assign correct shape information for static data types. For dynamic data types, it is required to have the correct shape in the provided SampleValue.
SampleValue | Sample value to provide the shape information. |
Kratos::VariableExpressionDataIO< TDataType >::VariableExpressionDataIO | ( | const std::vector< IndexType > & | rShape | ) |
Construct a new Variable Expression Data IO object from a given shape.
rShape | Shape of the data to be transferred. |
void Kratos::VariableExpressionDataIO< double >::Assign | ( | double & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< int >::Assign | ( | int & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< Matrix >::Assign | ( | Matrix & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< double > >::Assign | ( | std::vector< double > & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< int > >::Assign | ( | std::vector< int > & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< Matrix > >::Assign | ( | std::vector< Matrix > & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< Vector > >::Assign | ( | std::vector< Vector > & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
void Kratos::VariableExpressionDataIO< TDataType >::Assign | ( | TDataType & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
Evaluate the expression and assign the values to rOutput at the given index.
This assigns the evaluated expression values to passed rOutput. The shape of the rExpression and rOutput should be checked before using this method.
If | the expression item shape and output shape mismatches in full debug. |
rOutput | Output containing evaluated rExpression values. |
rExpression | Expression to be evaluated. |
EntityIndex | Entity index at which the expression will be evaluated. |
void Kratos::VariableExpressionDataIO< Vector >::Assign | ( | Vector & | rOutput, |
const Expression & | rExpression, | ||
const IndexType | EntityIndex | ||
) | const |
|
static |
Create a VariableExpressionDataIO from a given shape.
rShape | Shape of the data type. |
|
static |
Create a VariableExpressionDataIO from a given Sample value.
SampleValue | Sample value. |
|
inline |
Get the shape of the data type.
void Kratos::VariableExpressionDataIO< double >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const double & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< int >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const int & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< Matrix >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const Matrix & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< double > >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const std::vector< double > & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< int > >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const std::vector< int > & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< Matrix > >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const std::vector< Matrix > & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< std::vector< Vector > >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const std::vector< Vector > & | Value | ||
) | const |
void Kratos::VariableExpressionDataIO< TDataType >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const TDataType & | Value | ||
) | const |
Read into expression the values from given value.
This assigns values at the given EntityIndex with the values from Value. The shape of the rExpression and Value should be checked before using this method.
If | the expression item shape and output shape mismatches if full debug. |
rExpression | Expression to be assigned. |
EntityIndex | Entity of the expression to be assigned. |
Value | Value to be assigned to expression. |
void Kratos::VariableExpressionDataIO< Vector >::Read | ( | RawLiteralFlatExpression & | rExpression, |
const IndexType | EntityIndex, | ||
const Vector & | Value | ||
) | const |