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.
literal_expression.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Suneth Warnakulasuriya
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <string>
17 #include <vector>
18 
19 // Project includes
20 #include "expression/expression.h"
21 
22 namespace Kratos {
23 
26 
31 template <class TDataType>
32 class KRATOS_API(KRATOS_CORE) LiteralExpression : public Expression {
33 public:
36 
38  const TDataType& Value,
39  const IndexType NumberOfEntities);
40 
44 
46  const TDataType& Value,
47  const IndexType NumberOfEntities);
48 
49  double Evaluate(
50  const IndexType EntityIndex,
51  const IndexType EntityDataBeginIndex,
52  const IndexType ComponentIndex) const override;
53 
54  const std::vector<IndexType> GetItemShape() const override;
55 
56  IndexType GetMaxDepth() const override { return 1; }
57 
58  std::string Info() const override;
59 
61 private:
64 
65  const TDataType mValue;
66 
67  std::vector<IndexType> mShape;
68 
70 };
71 
72 } // namespace Kratos
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Base class or all the expression types.
Definition: expression.h:38
Kratos::intrusive_ptr< Expression > Pointer
Definition: expression.h:44
std::size_t IndexType
Definition: expression.h:48
Expression to hold a literal value.
Definition: literal_expression.h:32
IndexType GetMaxDepth() const override
Get the Max Depth of the lazy expression tree.
Definition: literal_expression.h:56
std::string GetItemShape(const std::vector< IndexType > &rShape)
Definition: binary_expression.cpp:27
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
double Evaluate(const PolynomialType &rPolynomial, double x)
Definition: polynomial_utilities.cpp:77
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21