Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICaseFunction.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* ICaseFunction.h (C) 2000-2023 */
9/* */
10/* Interface of a dataset function. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICASEFUNCTION_H
13#define ARCANE_CORE_ICASEFUNCTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \internal
30 *
31 * \brief Interface of a dataset function.
32 *
33 * \ingroup CaseOption
34 *
35 * A dataset function is a mathematical function f(x)->y where
36 * \c x is the \e parameter and \c y is the \e value.
37 *
38 * In the current version, a function is piecewise described by
39 * a set of (x,y) pairs.
40 *
41 * The methods that allow editing this lookup table are primarily used
42 * by the dataset editor. In any case, they must not be called once the
43 * complete dataset has been read (ICaseMng::readCaseOptions).
44 */
45class ARCANE_CORE_EXPORT ICaseFunction
46{
48
49 public:
50
51 /*!
52 * \brief Type of a function parameter.
53 */
55 {
56 ParamUnknown = 0, //!< Unknown parameter type
57 ParamReal = 1, //!< Real type parameter
58 ParamInteger = 2 //!< Integer type parameter
59 };
60 /*!
61 * \brief Type of a function value
62 */
64 {
65 ValueUnknown = 0, //!< Unknown value type
66 ValueReal = 1, //!< Real type value
67 ValueInteger = 2, //!< Integer type value
68 ValueBool = 3, //!< Boolean type value
69 ValueString = 4, //!< String type value
70 ValueReal3 = 5 //!< 'Real3' type value
71 };
72
73 public:
74
75 // NOTE: Temporarily leave this public destructor until
76 // we call this destructor explicitly, but with the reference
77 // counter, this should normally no longer be the case.
78 virtual ~ICaseFunction() = default; //!< Releases resources
79
80 public:
81
82 /*! @name Function Name */
83 //@{
84 //! function name
85 virtual String name() const = 0;
86
87 //! Sets the function name to \a new_name
88 virtual void setName(const String& new_name) = 0;
89 //@}
90
91 /*! @name Parameter Type */
92 //@{
93 //! Function parameter type
94 virtual eParamType paramType() const = 0;
95
96 //! Sets the function parameter type
97 virtual void setParamType(eParamType type) = 0;
98 //@}
99
100 /*! @name Value Type */
101 //@{
102 //! Function value type
103 virtual eValueType valueType() const = 0;
104
105 //! Sets the function value type
106 virtual void setValueType(eValueType type) = 0;
107 //@}
108
109 /*!
110 * \brief Sets a value transformation function.
111 * For now, this is just a multiplicative coefficient.
112 * The string \a str must be convertible to the value type.
113 */
114 virtual void setTransformValueFunction(const String& str) = 0;
115
116 //! Returns the value transformation function.
117 virtual String transformValueFunction() const = 0;
118
119 /*!
120 * \brief Sets a parameter transformation function.
121 * For now, this is just a multiplicative coefficient.
122 * It is only applied to real parameters.
123 * The string \a str must be convertible to a real number.
124 */
125 virtual void setTransformParamFunction(const String& str) = 0;
126
127 //! Parameter transformation function
128 virtual String transformParamFunction() const = 0;
129
130 /*!
131 * \brief Checks the validity of the function.
132 * \retval true if the function is valid,
133 * \retval false otherwise.
134 */
135 virtual bool checkIfValid() const = 0;
136
137 /*!
138 * \brief Sets the value of the deltat multiplier coefficient.
139 *
140 * This coefficient, 0.0 by default, is used for functions
141 * that take physical time as a parameter. In this case,
142 * the function uses the global current time as a parameter,
143 * to which the global current time step multiplied
144 * by this coefficient is added.
145 */
146 virtual void setDeltatCoef(Real v) = 0;
147
148 //! Value of the deltat multiplier coefficient
149 virtual Real deltatCoef() const = 0;
150
151 public:
152
153 //! Value \a v of the option for parameter \a param.
154 virtual void value(Real param, Real& v) const = 0;
155
156 //! Value \a v of the option for parameter \a param.
157 virtual void value(Real param, Integer& v) const = 0;
158
159 //! Value \a v of the option for parameter \a param.
160 virtual void value(Real param, bool& v) const = 0;
161
162 //! Value \a v of the option for parameter \a param.
163 virtual void value(Real param, String& v) const = 0;
164
165 //! Value \a v of the option for parameter \a param.
166 virtual void value(Real param, Real3& v) const = 0;
167
168 //! Value \a v of the option for parameter \a param.
169 virtual void value(Integer param, Real& v) const = 0;
170
171 //! Value \a v of the option for parameter \a param.
172 virtual void value(Integer param, Integer& v) const = 0;
173
174 // Value \a v of the option for parameter \a param.
175 virtual void value(Integer param, bool& v) const = 0;
176
177 //! Value \a v of the option for parameter \a param.
178 virtual void value(Integer param, String& v) const = 0;
179
180 //! Value \a v of the option for parameter \a param.
181 virtual void value(Integer param, Real3& v) const = 0;
182};
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
186
187} // End namespace Arcane
188
189/*---------------------------------------------------------------------------*/
190/*---------------------------------------------------------------------------*/
191
192#endif
Declarations of Arcane's general types.
#define ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to declare the virtual methods managing reference counters.
virtual void setName(const String &new_name)=0
Sets the function name to new_name.
virtual void value(Integer param, String &v) const =0
Value v of the option for parameter param.
virtual ~ICaseFunction()=default
Releases resources.
virtual void setValueType(eValueType type)=0
Sets the function value type.
virtual Real deltatCoef() const =0
Value of the deltat multiplier coefficient.
virtual void value(Real param, Integer &v) const =0
Value v of the option for parameter param.
eParamType
Type of a function parameter.
@ ParamUnknown
Unknown parameter type.
@ ParamReal
Real type parameter.
@ ParamInteger
Integer type parameter.
eValueType
Type of a function value.
@ ValueReal3
'Real3' type value
@ ValueUnknown
Unknown value type.
@ ValueInteger
Integer type value.
@ ValueString
String type value.
@ ValueReal
Real type value.
@ ValueBool
Boolean type value.
virtual String transformParamFunction() const =0
Parameter transformation function.
virtual void value(Real param, String &v) const =0
Value v of the option for parameter param.
virtual String name() const =0
function name
virtual bool checkIfValid() const =0
Checks the validity of the function.
virtual void setTransformValueFunction(const String &str)=0
Sets a value transformation function. For now, this is just a multiplicative coefficient....
virtual void setDeltatCoef(Real v)=0
Sets the value of the deltat multiplier coefficient.
virtual void value(Real param, Real &v) const =0
Value v of the option for parameter param.
virtual void value(Real param, Real3 &v) const =0
Value v of the option for parameter param.
virtual void value(Integer param, Real3 &v) const =0
Value v of the option for parameter param.
virtual eValueType valueType() const =0
Function value type.
virtual String transformValueFunction() const =0
Returns the value transformation function.
virtual eParamType paramType() const =0
Function parameter type.
virtual void value(Integer param, Real &v) const =0
Value v of the option for parameter param.
virtual void setParamType(eParamType type)=0
Sets the function parameter type.
virtual void value(Real param, bool &v) const =0
Value v of the option for parameter param.
virtual void setTransformParamFunction(const String &str)=0
Sets a parameter transformation function. For now, this is just a multiplicative coefficient....
virtual void value(Integer param, Integer &v) const =0
Value v of the option for parameter param.
Class managing a 3-dimensional real vector.
Definition Real3.h:132
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.