Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CaseFunction.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/* CaseFunction.h (C) 2000-2025 */
9/* */
10/* Class managing a dataset function. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_CASEFUNCTION_H
13#define ARCANE_CORE_CASEFUNCTION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arccore/base/Ref.h"
19
20#include "arcane/utils/String.h"
21
22#include "arcane/core/ICaseFunction.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30class ISubDomain;
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
80class ARCANE_CORE_EXPORT CaseFunction
81: public ICaseFunction
83{
85
86 public:
87
89 explicit CaseFunction(const CaseFunctionBuildInfo& info);
90 ~CaseFunction() override;
91
92 public:
93
94 String name() const override { return m_name; }
95 void setName(const String& new_name) override;
96
97 eParamType paramType() const override { return m_param_type; }
98 void setParamType(eParamType type) override;
99
100 eValueType valueType() const override { return m_value_type; }
101 void setValueType(eValueType type) override;
102
103 void setTransformValueFunction(const String& str) override;
105
106 void setTransformParamFunction(const String& str) override;
108
109 void setDeltatCoef(Real v) override { m_deltat_coef = v; }
110 Real deltatCoef() const override { return m_deltat_coef; }
111
112 bool checkIfValid() const override;
113
114 Ref<ICaseFunction> toReference();
115 ITraceMng* traceMng() const { return m_trace; }
116
117 public:
118 private:
119
126 Real m_deltat_coef;
127
128 private:
129 protected:
130
131 template <typename ParamType> void _applyParamTransform2(ParamType& param) const;
132 Real _applyValueComulTransform(Real v, Real comul) const;
133 Integer _applyValueComulTransform(Integer v, Integer comul) const;
134 String _applyValueComulTransform(const String& v, const String& comul) const;
135 bool _applyValueComulTransform(bool v, bool comul) const;
136 Real3 _applyValueComulTransform(Real3 v, Real3 comul) const;
137
138 void _applyValueTransform(Real& value) const;
139 void _applyValueTransform(Integer& value) const;
140 void _applyValueTransform(String& value) const;
141 void _applyValueTransform(Real3& value) const;
142 void _applyValueTransform(bool& value) const;
143 template <typename ValueType> void _applyValueTransform2(ValueType& value) const;
144 void _applyParamTransform(Real& value) const;
145 void _applyParamTransform(Integer& value) const;
146};
147
148/*---------------------------------------------------------------------------*/
149/*---------------------------------------------------------------------------*/
150
151} // End namespace Arcane
152
153/*---------------------------------------------------------------------------*/
154/*---------------------------------------------------------------------------*/
155
156#endif
#define ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to define methods managing counters of references.
Management of references to a C++ class.
Information to build an instance of CaseFunction.
ITraceMng * m_trace_mng
Associated trace manager.
String m_name
Name of the function.
String m_transform_value_func
Y transformation function.
Real m_deltat_coef
Multiplier coefficient of deltat for time tables.
ICaseFunction::eValueType m_value_type
Value type (y).
String m_transform_param_func
X transformation function.
ARCANE_DEPRECATED_260 CaseFunctionBuildInfo(ISubDomain *sd, const String &name)
ICaseFunction::eParamType m_param_type
Parameter type (x).
String transformValueFunction() const override
Returns the value transformation function.
void setDeltatCoef(Real v) override
Sets the value of the deltat multiplier coefficient.
eParamType m_param_type
Parameter type (x).
String m_name
Name of the function.
eValueType m_value_type
Value type (y).
String m_transform_param_func
Parameter transformation function.
CaseFunction(const CaseFunctionBuildInfo &info)
Constructs a dataset function.
String name() const override
function name
Real deltatCoef() const override
Value of the deltat multiplier coefficient.
String m_transform_value_func
Value transformation function.
ITraceMng * m_trace
Trace manager.
String transformParamFunction() const override
Parameter transformation function.
eValueType valueType() const override
Function value type.
eParamType paramType() const override
Function parameter type.
Interface of a dataset function.
eParamType
Type of a function parameter.
@ ParamUnknown
Unknown parameter type.
eValueType
Type of a function value.
@ ValueUnknown
Unknown value type.
virtual void value(Real param, Real &v) const =0
Value v of the option for parameter param.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Class managing a 3-dimensional real vector.
Definition Real3.h:132
Reference to an instance.
Thread-safe implementation of a reference counter.
-- 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.