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.
Classes | Friends | List of all members
Kratos::Expression Class Referenceabstract

Base class or all the expression types. More...

#include <expression.h>

Inheritance diagram for Kratos::Expression:
Collaboration diagram for Kratos::Expression:

Classes

class  ExpressionIterator
 

Public Types

Type definitions
using Pointer = Kratos::intrusive_ptr< Expression >
 
using ConstPointer = Kratos::intrusive_ptr< const Expression >
 
using IndexType = std::size_t
 
Iterator type definitions
using value_type = double
 
using size_type = IndexType
 
using const_iterator = ExpressionIterator
 

Public Member Functions

Life cycle
 Expression (const IndexType NumberOfEntities)
 
virtual ~Expression ()=default
 
Public operations
virtual double Evaluate (const IndexType EntityIndex, const IndexType EntityDataBeginIndex, const IndexType ComponentIndex) const =0
 Evalute the expression for the given entity data start index and component index and returns the value. More...
 
virtual const std::vector< IndexTypeGetItemShape () const =0
 Get the Shape of the expression. More...
 
IndexType NumberOfEntities () const
 Get the maximum number of entities allowed for this expression. More...
 
IndexType GetItemComponentCount () const
 Get the Local Size of the expression. More...
 
virtual IndexType GetMaxDepth () const =0
 Get the Max Depth of the lazy expression tree. More...
 
Input and output
IndexType size () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
virtual std::string Info () const =0
 

Friends

class ExpressionInput
 
class ExpressionOutput
 

Private operations

void intrusive_ptr_add_ref (const Expression *x)
 
void intrusive_ptr_release (const Expression *x)
 

Detailed Description

Base class or all the expression types.

This is used to represent an expression for arithmetic evaluation

Member Typedef Documentation

◆ const_iterator

◆ ConstPointer

using Kratos::Expression::ConstPointer = Kratos::intrusive_ptr<const Expression>

◆ IndexType

using Kratos::Expression::IndexType = std::size_t

◆ Pointer

using Kratos::Expression::Pointer = Kratos::intrusive_ptr<Expression>

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ Expression()

Kratos::Expression::Expression ( const IndexType  NumberOfEntities)
inline

◆ ~Expression()

virtual Kratos::Expression::~Expression ( )
virtualdefault

Member Function Documentation

◆ begin()

Expression::ExpressionIterator Kratos::Expression::begin ( ) const

◆ cbegin()

Expression::ExpressionIterator Kratos::Expression::cbegin ( ) const

◆ cend()

Expression::ExpressionIterator Kratos::Expression::cend ( ) const

◆ end()

Expression::ExpressionIterator Kratos::Expression::end ( ) const

◆ Evaluate()

virtual double Kratos::Expression::Evaluate ( const IndexType  EntityIndex,
const IndexType  EntityDataBeginIndex,
const IndexType  ComponentIndex 
) const
pure virtual

◆ GetItemComponentCount()

std::size_t Kratos::Expression::GetItemComponentCount ( ) const

Get the Local Size of the expression.

Returns
IndexType

◆ GetItemShape()

virtual const std::vector<IndexType> Kratos::Expression::GetItemShape ( ) const
pure virtual

◆ GetMaxDepth()

virtual IndexType Kratos::Expression::GetMaxDepth ( ) const
pure virtual

Get the Max Depth of the lazy expression tree.

Returns the maximum depth of the lazy expression tree.

Warning
This is a recursive computation, hence this should not be done repeatedly unless necessary.
Returns
IndexType Max depth of the lazy expression tree.

Implemented in Kratos::Python::Detail::ExpressionTrampoline, Kratos::UnaryStatisticsExpression< TOperationType >, Kratos::UnarySliceExpression, Kratos::UnaryReshapeExpression, Kratos::UnaryCombineExpression, Kratos::UnaryAbsExpression, Kratos::LiteralFlatExpression< TRawDataType >, Kratos::LiteralFlatExpression< double >, Kratos::LiteralExpression< TDataType >, and Kratos::BinaryExpression< TOperationType >.

◆ Info()

virtual std::string Kratos::Expression::Info ( ) const
pure virtual

◆ NumberOfEntities()

IndexType Kratos::Expression::NumberOfEntities ( ) const
inline

Get the maximum number of entities allowed for this expression.

Returns
IndexType

◆ size()

std::size_t Kratos::Expression::size ( ) const

Friends And Related Function Documentation

◆ ExpressionInput

friend class ExpressionInput
friend

◆ ExpressionOutput

friend class ExpressionOutput
friend

◆ intrusive_ptr_add_ref

void intrusive_ptr_add_ref ( const Expression x)
friend

◆ intrusive_ptr_release

void intrusive_ptr_release ( const Expression x)
friend

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