Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICaseMng.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/* ICaseMng.h (C) 2000-2025 */
9/* */
10/* Interface for the class managing the dataset. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICASEMNG_H
13#define ARCANE_CORE_ICASEMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28class ICaseMngInternal;
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33/*!
34 * \brief Types of events supported by ICaseMng.
35 *
36 * It is possible to register for these events via the ICaseMng::observable() method.
37 */
39{
40 //! Event generated before reading options in phase 1
42 //! Event generated before reading options in phase 2.
44};
45
46/*---------------------------------------------------------------------------*/
47/*---------------------------------------------------------------------------*/
48
49/*!
50 * \ingroup CaseOption
51 * \brief Case manager interface.
52 *
53 * This interface is managed by a reference counter and should not
54 * be explicitly destroyed.
55 */
57{
59
60 public:
61
62 // TODO: make private (start 2024)
63 virtual ~ICaseMng() = default; //!< Frees resources
64
65 public:
66
67 //! Associated application
68 virtual IApplication* application() = 0;
69
70 //! Trace manager
71 virtual ITraceMng* traceMng() = 0;
72
73 //! Associated mesh manager
74 virtual IMeshMng* meshMng() const = 0;
75
76 //! Sub-domain manager.
77 virtual ISubDomain* subDomain() = 0;
78
79 //! XML document of the dataset (can be null if no dataset)
81
82 //! Fragment of the XML Document associated with the dataset (can be null if no dataset)
84
85 //! Associated unit system.
87
88 //! Reads the XML document of the dataset.
89 virtual ICaseDocument* readCaseDocument(const String& filename, ByteConstArrayView bytes) = 0;
90
91 //! Reads the dataset options corresponding to the used modules
92 virtual void readOptions(bool is_phase1) = 0;
93
94 //! Prints the option values
95 virtual void printOptions() = 0;
96
97 //! Reads the dataset tables.
98 virtual void readFunctions() = 0;
99
100 public:
101
102 //! Registers a list of dataset options
103 virtual void registerOptions(ICaseOptions*) = 0;
104
105 //! Unregisters a list of dataset options
106 virtual void unregisterOptions(ICaseOptions*) = 0;
107
108 //! Collection of option blocks.
109 virtual CaseOptionsCollection blocks() const = 0;
110
111 public:
112
113 //! Returns the function by name \a name or \a nullptr if none exists.
114 virtual ICaseFunction* findFunction(const String& name) const = 0;
115
116 /*!
117 * \brief Returns the list of tables.
118 *
119 * The returned pointer is no longer valid as soon as the list of tables changes.
120 */
121 virtual CaseFunctionCollection functions() = 0;
122
123 /*!
124 * \brief Deletes a function.
125 *
126 * Deletes the function \a func. If this function is not in this list,
127 * nothing is done.
128 * If \a dofree is true, the delete operator is called on this function.
129 */
130 ARCCORE_DEPRECATED_2019("Use removeFunction(ICaseFunction*) instead.")
131 virtual void removeFunction(ICaseFunction* func, bool dofree) = 0;
132
133 /*!
134 * \brief Deletes a function.
135 *
136 * Deletes the function \a func. If this function is not in this list,
137 * nothing is done.
138 */
139 virtual void removeFunction(ICaseFunction* func) = 0;
140
141 /*!
142 * \brief Adds the function \a func.
143 *
144 * Addition can only be done during initialization. The caller remains
145 * the owner of the \a func instance and must remove it via removeFunction().
146 */
147 ARCCORE_DEPRECATED_2019("Use addFunction(Ref<ICaseFunction>) instead.")
148 virtual void addFunction(ICaseFunction* func) = 0;
149
150 /*!
151 * \brief Adds the function \a func.
152 *
153 * Addition can only be done during initialization.
154 */
155 virtual void addFunction(Ref<ICaseFunction> func) = 0;
156
157 /*!
158 * \brief Updates the options based on a time-marching table.
159 *
160 * For each option dependent on a marching table, updates its value
161 * using the \a current_time parameter if it is a marching table with a real parameter,
162 * or \a current_iteration if it is a marching table with an integer parameter.
163 * If the option function has a non-zero coefficient ICaseFunction::deltatCoef(),
164 * the time used is equal to current_time + coef*current_deltat.
165 *
166 * \param current_time time used as parameter for the function
167 * \param current_deltat deltat used as parameter for the function
168 * \param current_iteration iteration used as parameter for the function
169 */
170 virtual void updateOptions(Real current_time, Real current_deltat, Integer current_iteration) = 0;
171
172 /*!
173 * \brief Sets the way warnings are treated.
174 * \sa isTreatWarningAsError().
175 */
176 virtual void setTreatWarningAsError(bool v) = 0;
177
178 /*!
179 * \brief Indicates whether warnings in the dataset should be treated
180 * as errors and cause the code to stop.
181 */
182 virtual bool isTreatWarningAsError() const = 0;
183
184 //! Sets the permission for unknown elements at the document root.
185 virtual void setAllowUnkownRootElelement(bool v) = 0;
186
187 //! Indicates whether unknown elements at the document root are allowed
188 virtual bool isAllowUnkownRootElelement() const = 0;
189
190 /*!
191 * \brief Observable on the instance.
192 *
193 * The type of the observable is given by \a type
194 */
196
197 public:
198
199 virtual Ref<ICaseMng> toReference() = 0;
200
201 public:
202
203 //! Internal implementation
204 virtual ICaseMngInternal* _internalImpl() = 0;
205};
206
207/*---------------------------------------------------------------------------*/
208/*---------------------------------------------------------------------------*/
209
210} // End namespace Arcane
211
212/*---------------------------------------------------------------------------*/
213/*---------------------------------------------------------------------------*/
214
215#endif
Declarations of Arcane's general types.
#define ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to declare the virtual methods managing reference counters.
Application interface.
Case manager interface.
Definition ICaseMng.h:57
virtual void addFunction(ICaseFunction *func)=0
Adds the function func.
virtual IPhysicalUnitSystem * physicalUnitSystem() const =0
Associated unit system.
virtual ~ICaseMng()=default
Frees resources.
virtual ICaseMngInternal * _internalImpl()=0
Internal implementation.
virtual IMeshMng * meshMng() const =0
Associated mesh manager.
virtual ITraceMng * traceMng()=0
Trace manager.
virtual void setTreatWarningAsError(bool v)=0
Sets the way warnings are treated.
virtual bool isTreatWarningAsError() const =0
Indicates whether warnings in the dataset should be treated as errors and cause the code to stop.
virtual void printOptions()=0
Prints the option values.
virtual void removeFunction(ICaseFunction *func, bool dofree)=0
Deletes a function.
virtual void readFunctions()=0
Reads the dataset tables.
virtual ISubDomain * subDomain()=0
Sub-domain manager.
virtual ICaseDocument * readCaseDocument(const String &filename, ByteConstArrayView bytes)=0
Reads the XML document of the dataset.
virtual IApplication * application()=0
Associated application.
virtual IObservable * observable(eCaseMngEventType type)=0
Observable on the instance.
virtual CaseOptionsCollection blocks() const =0
Collection of option blocks.
virtual ICaseDocumentFragment * caseDocumentFragment()=0
Fragment of the XML Document associated with the dataset (can be null if no dataset).
virtual void readOptions(bool is_phase1)=0
Reads the dataset options corresponding to the used modules.
virtual void unregisterOptions(ICaseOptions *)=0
Unregisters a list of dataset options.
virtual CaseFunctionCollection functions()=0
Returns the list of tables.
virtual void setAllowUnkownRootElelement(bool v)=0
Sets the permission for unknown elements at the document root.
virtual void updateOptions(Real current_time, Real current_deltat, Integer current_iteration)=0
Updates the options based on a time-marching table.
virtual bool isAllowUnkownRootElelement() const =0
Indicates whether unknown elements at the document root are allowed.
virtual ICaseDocument * caseDocument()=0
XML document of the dataset (can be null if no dataset).
virtual ICaseFunction * findFunction(const String &name) const =0
Returns the function by name name or nullptr if none exists.
virtual void registerOptions(ICaseOptions *)=0
Registers a list of dataset options.
Mesh manager interface.
Definition IMeshMng.h:41
Interface of the subdomain manager.
Definition ISubDomain.h:75
Reference to an instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eCaseMngEventType
Types of events supported by ICaseMng.
Definition ICaseMng.h:39
@ BeginReadOptionsPhase2
Event generated before reading options in phase 2.
Definition ICaseMng.h:43
@ BeginReadOptionsPhase1
Event generated before reading options in phase 1.
Definition ICaseMng.h:41
Int32 Integer
Type representing an integer.
Collection< ICaseOptions * > CaseOptionsCollection
Collection of dataset options.
double Real
Type representing a real number.
ConstArrayView< Byte > ByteConstArrayView
C equivalent of a 1D array of characters.
Definition UtilsTypes.h:476