14#include "arcane/core/CaseFunction.h"
16#include "arcane/utils/ITraceMng.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/NotImplementedException.h"
19#include "arcane/utils/ValueConvert.h"
20#include "arcane/utils/TraceInfo.h"
24#include "arcane/core/ISubDomain.h"
47: m_trace(info.m_trace_mng)
49, m_param_type(info.m_param_type)
50, m_value_type(info.m_value_type)
51, m_transform_param_func(info.m_transform_param_func)
52, m_transform_value_func(info.m_transform_value_func)
53, m_deltat_coef(info.m_deltat_coef)
85 if (new_type == m_param_type)
87 m_param_type = new_type;
96 if (new_type == m_value_type)
98 m_value_type = new_type;
110 m_transform_value_func = str;
119 m_transform_param_func = str;
135_applyValueComulTransform(
Real v,
Real comul)
const
145_applyValueComulTransform(
Real3 v,
Real3 comul)
const
150_applyValueComulTransform(
const String& v,
const String& comul)
const
153 ARCANE_UNUSED(comul);
157_applyValueComulTransform(
bool v,
bool comul)
const
160 ARCANE_UNUSED(comul);
167template <
typename ValueType>
void CaseFunction::
168_applyValueTransform2(
ValueType& value)
const
172 if (m_transform_value_func.null())
174 ValueType comul = ValueType();
175 bool is_bad = builtInGetValue(comul, m_transform_value_func);
177 ARCANE_FATAL(
"Can not convert 'comul' value '{0}'", m_transform_value_func);
178 value = _applyValueComulTransform(
value, comul);
185_applyValueTransform(
Real& value)
const
187 _applyValueTransform2(
value);
190_applyValueTransform(
Real3& value)
const
192 _applyValueTransform2(
value);
195_applyValueTransform(
Integer& value)
const
197 _applyValueTransform2(
value);
200_applyValueTransform(
String& value)
const
202 _applyValueTransform2(
value);
205_applyValueTransform(
bool& value)
const
207 _applyValueTransform2(
value);
213template <
typename ParamType>
void CaseFunction::
214_applyParamTransform2(ParamType& param)
const
218 if (m_transform_param_func.null())
221 ParamType comul = ParamType();
222 bool is_bad = builtInGetValue(comul, m_transform_param_func);
224 ARCANE_FATAL(
"Can not convert 'comul-x' value '{0}'", m_transform_param_func);
226 ARCANE_FATAL(
"The parameter 'comul-x' can not be zero");
227 param = param / comul;
234_applyParamTransform(
Real& value)
const
236 _applyParamTransform2(
value);
243_applyParamTransform(
Integer& value)
const
245 _applyParamTransform2(
value);
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Various mathematical functions.
Information to build an instance of CaseFunction.
ARCANE_DEPRECATED_260 CaseFunctionBuildInfo(ISubDomain *sd, const String &name)
void setTransformParamFunction(const String &str) override
Sets a parameter transformation function. For now, this is just a multiplicative coefficient....
bool checkIfValid() const override
Checks the validity of the function.
void setParamType(eParamType type) override
Sets the function parameter type.
void setName(const String &new_name) override
Sets the function name to new_name.
CaseFunction(const CaseFunctionBuildInfo &info)
Constructs a dataset function.
void setValueType(eValueType type) override
Sets the function value type.
void setTransformValueFunction(const String &str) override
Sets a value transformation function. For now, this is just a multiplicative coefficient....
eParamType
Type of a function parameter.
eValueType
Type of a function value.
virtual void value(Real param, Real &v) const =0
Value v of the option for parameter param.
Interface of the subdomain manager.
Class managing a 3-dimensional real vector.
Reference to an instance.
Unicode character string.
bool null() const
Returns true if the string is null.
bool isZero(const BuiltInProxy< _Type > &a)
Tests if a value is exactly equal to zero.
-- 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.
Ref< InstanceType > makeRefFromInstance(InstanceType2 *t)
Retrieves a reference on the pointer t.