Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Expression.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Expression.h (C) 2000-2014 */
9/* */
10/* Référence à une expression. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_EXPR_EXPRESSION_H
13#define ARCANE_EXPR_EXPRESSION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17
18#include "arcane/datatype/ScalarVariant.h"
19
20#include "arcane/expr/IExpressionImpl.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25ARCANE_BEGIN_NAMESPACE
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30class IExpressionImpl;
31class ExpressionResult;
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
42class ARCANE_EXPR_EXPORT Expression
43{
44 public:
45
47 Expression();
48
50
51 explicit Expression(Real v);
52
58
59 void operator=(const Expression& expr);
60 virtual ~Expression();
61
62 public:
63
64 void assign(const Expression& expr);
65 void assign(const Expression& expr,const Array<Integer>& indices);
66 void assign(Real val);
67
68 void apply(ExpressionResult* result);
69
70 void dumpIf(const Expression& test_expr,Array<Expression>& exprs);
71 void dumpIf(const Expression& test_expr);
72
73 IExpressionImpl* operator->() const;
74
75 Expression operator-();
76 Expression inverse();
77
78 Expression acos();
79 Expression asin();
80 Expression atan();
81 Expression ceil();
82 Expression cos();
83 Expression cosh();
84 Expression exp();
85 Expression fabs();
86 Expression floor();
87 Expression log();
88 Expression log10();
89 Expression sin();
90 Expression sinh();
91 Expression sqrt();
92 Expression tan();
93 Expression tanh();
94
95 Expression operator+(Expression ex1);
96 Expression operator-(Expression ex1);
97 Expression operator*(Expression ex1);
99
105
108
109 Expression operator+(Real a)
110 { return this->operator+(literal(a)); }
111 Expression operator-(Real a)
112 { return this->operator-(literal(a)); }
113 Expression operator*(Real a)
114 { return this->operator*(literal(a)); }
115 Expression operator/(Real a)
116 { return this->operator/(literal(a)); }
117
118 Expression eq(Real a)
119 { return this->eq(literal(a)); }
120 Expression lt(Real a)
121 { return this->lt(literal(a)); }
122 Expression gt(Real a)
123 { return this->gt(literal(a)); }
124 Expression lte(Real a)
125 { return this->lte(literal(a)); }
126 Expression gte(Real a)
127 { return this->gte(literal(a)); }
128
129 Expression eand(Real a)
130 { return this->eand(literal(a)); }
131 Expression eor(Real a)
132 { return this->eor(literal(a)); }
133
135 Expression ifelse(Real ex1, Real ex2)
136 { return this->ifelse(literal(ex1), literal(ex2)); }
137 Expression ifelse(Expression ex1, Real ex2)
138 { return this->ifelse(ex1, literal(ex2)); }
139 Expression ifelse(Real ex1, Expression ex2)
140 { return this->ifelse(literal(ex1), ex2); }
141
142 Expression minimum(Expression v);
143 Expression minimum(Real v)
144 { return this->minimum(literal(v)); }
145
146 Expression maximum(Expression v);
147 Expression maximum(Real v)
148 { return this->maximum(literal(v)); }
149
150 Expression pow(Expression v);
151 Expression pow(Real v)
152 { return this->pow(literal(v)); }
153
154 Expression literal(Real v);
155
156 void setTrace(bool v);
157
158 unsigned long vectorSize();
159
160 private:
161 IExpressionImpl* m_expression;
162};
163
164/*---------------------------------------------------------------------------*/
165/*---------------------------------------------------------------------------*/
166
167ARCANE_END_NAMESPACE
168
169/*---------------------------------------------------------------------------*/
170/*---------------------------------------------------------------------------*/
171
172#endif
Type de base polymorphe d'une expression.
Référence à une expression.
Definition Expression.h:43
Interface pour les différentes implémentations d'une expression.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Real2 operator/(const Real2Proxy &vec, Real sca)
Division par un scalaire.
Definition Real2Proxy.h:263