Arcane  4.2.1.0
Developer documentation
Loading...
Searching...
No Matches
TimeHistoryMngInternal.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/* TimeHistoryMngInternal.h (C) 2000-2026 */
9/* */
10/* Internal class managing a history of values. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_IMPL_INTERNAL_TIMEHISTORYMNGINTERNAL_H
13#define ARCANE_IMPL_INTERNAL_TIMEHISTORYMNGINTERNAL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Iostream.h"
18#include "arcane/utils/Iterator.h"
19#include "arcane/utils/ScopedPtr.h"
20#include "arcane/utils/ITraceMng.h"
21#include "arcane/utils/PlatformUtils.h"
22#include "arcane/utils/OStringStream.h"
23#include "arcane/utils/Convert.h"
24
25#include "arcane/core/IIOMng.h"
26#include "arcane/core/CommonVariables.h"
27#include "arcane/core/Directory.h"
28#include "arcane/core/ObserverPool.h"
29#include "arcane/core/IVariableMng.h"
30#include "arcane/core/IParallelMng.h"
31#include "arcane/core/ITimeHistoryCurveWriter2.h"
32#include "arcane/core/ITimeHistoryTransformer.h"
33#include "arcane/core/XmlNode.h"
34#include "arcane/core/XmlNodeList.h"
35#include "arcane/core/IXmlDocumentHolder.h"
36#include "arcane/core/ServiceBuilder.h"
37#include "arcane/core/Properties.h"
38#include "arcane/core/IParallelReplication.h"
39
40#include "arcane/datatype/DataTypeTraits.h"
41
42#include "arcane/core/internal/ITimeHistoryMngInternal.h"
43
44#include <map>
45#include <set>
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
50namespace Arcane
51{
52
59class TimeHistoryValue
60{
61 public:
62
63 TimeHistoryValue(const TimeHistoryAddValueArgInternal& thpi, eDataType dt, Integer index, Integer sub_size)
64 : m_data_type(dt)
65 , m_index(index)
66 , m_sub_size(sub_size)
67 , m_thpi(thpi)
68 {}
69
70 virtual ~TimeHistoryValue() = default;
71
72 public:
73
81 virtual void fromOldToNewVariables(IVariableMng* vm, IMesh* default_mesh) = 0;
82
84 virtual void dumpValues(ITraceMng* msg,
86 const TimeHistoryCurveWriterInfo& infos) const = 0;
87
95 virtual void arrayToWrite(UniqueArray<Int32>& iterations,
96 UniqueArray<Real>& values,
97 const TimeHistoryCurveWriterInfo& infos) const = 0;
98
108
114 virtual Integer size() const = 0;
115
121 virtual void removeAfterIteration(Integer last_iteration) = 0;
122
124 const String& name() const { return m_thpi.timeHistoryAddValueArg().name(); }
125
127 eDataType dataType() const { return m_data_type; }
128
130 Integer index() const { return m_index; }
131
132 Integer subSize() const { return m_sub_size; }
133
141 const MeshHandle& meshHandle() const { return m_thpi.meshHandle(); }
142
149 bool isLocal() const { return m_thpi.timeHistoryAddValueArg().isLocal(); }
150
156 Integer localSubDomainId() const { return m_thpi.timeHistoryAddValueArg().localSubDomainId(); }
157
158 private:
159
162 Integer m_sub_size;
164};
165
166/*---------------------------------------------------------------------------*/
167/*---------------------------------------------------------------------------*/
168
180template <typename DataType>
182: public TimeHistoryValue
183{
184 /*
185 * WARNING: WHAT IS DESCRIBED IN THIS COMMENT IS NOT YET OPERATIONAL
186 * When there are many curves and the number of iterations
187 * becomes significant, storage consumes memory. To avoid
188 * this, it is possible to compress the array of iterations.
189 * If this is the case and the iterations are consecutive, only the first
190 * and the last are kept. In this case,
191 * m_iterations has 3 values: [0] = COMPRESSED_TAG, [1] = first
192 * and [2] = last.
193 */
194 public:
195
196 typedef VariableRefArrayT<DataType> ValueList;
197 typedef VariableRefArrayT<Int32> IterationList;
198 static const Integer COMPRESSED_TAG = -15;
199
200 public:
201
203
204 public:
205
216 : TimeHistoryValue(thpi, DataTypeTraitsT<DataType>::type(), index, nb_element)
217 , m_values(VariableBuildInfo(vm, String("TimeHistoryMngValues") + index, VAR_BUILD_FLAGS))
218 , m_iterations(VariableBuildInfo(vm, String("TimeHistoryMngIterations") + index, VAR_BUILD_FLAGS))
219 , m_use_compression(false)
220 , m_shrink_history(shrink)
221 {
222 }
223
233 : TimeHistoryValue(thpi, DataTypeTraitsT<DataType>::type(), index, nb_element)
234 , m_values(VariableBuildInfo(thpi.meshHandle(), String("TimeHistoryMngValues") + index, VAR_BUILD_FLAGS))
235 , m_iterations(VariableBuildInfo(thpi.meshHandle(), String("TimeHistoryMngIterations") + index, VAR_BUILD_FLAGS))
236 , m_use_compression(false)
237 , m_shrink_history(shrink)
238 {
239 }
240
241 public:
242
243 void fromOldToNewVariables(IVariableMng* vm, IMesh* default_mesh) override
244 {
245 IVariable* ptr_old_values = vm->findMeshVariable(default_mesh, String("TimeHistory_Values_") + index());
246 IVariable* ptr_old_iterations = vm->findMeshVariable(default_mesh, String("TimeHistory_Iterations_") + index());
247 if (ptr_old_values == nullptr || ptr_old_iterations == nullptr)
248 ARCANE_FATAL("Unknown old variable");
249
250 ValueList old_values(ptr_old_values);
251 IterationList old_iterations(ptr_old_iterations);
252
253 m_values.resize(old_values.size());
254 m_values.copy(old_values);
255
256 m_iterations.resize(old_iterations.size());
257 m_iterations.copy(old_iterations);
258
259 old_values.resize(0);
260 old_iterations.resize(0);
261 }
262
263 Integer size() const override
264 {
265 return m_iterations.size();
266 }
267
275 {
276 Integer nb_iteration = m_iterations.size();
277 Integer nb_value = m_values.size();
278 Integer sub_size = values.size();
279 if (nb_iteration != 0)
280 if (m_iterations[nb_iteration - 1] == iteration) {
281 // Replace the value
282 for (Integer i = 0; i < sub_size; ++i)
283 m_values[nb_value - sub_size + i] = values[i];
284 return;
285 }
286 Integer add_nb_iter = math::max(128, nb_iteration / 20);
287 Integer add_nb_value = math::max(1024, nb_value / 20);
288 m_iterations.resizeWithReserve(nb_iteration + 1, add_nb_iter);
289 m_values.resizeWithReserve(nb_value + sub_size, add_nb_value);
290 m_iterations[nb_iteration] = iteration;
291 for (Integer i = 0; i < sub_size; ++i)
292 m_values[nb_value + i] = values[i];
293 }
294
295 void removeAfterIteration(Integer last_iteration) override
296 {
297 Integer size = m_iterations.size();
298 Integer last_elem = size;
299 for (Integer i = 0; i < size; ++i)
300 if (m_iterations[i] >= last_iteration) {
301 last_elem = i;
302 break;
303 }
304 if (last_elem != size) {
305 m_iterations.resize(last_elem);
306 m_values.resize(last_elem * subSize());
307 }
308 }
309
310 // Writing a curve for writers version 2.
313 const TimeHistoryCurveWriterInfo& infos) const override
314 {
315 ARCANE_UNUSED(msg);
316
317 // For now, we do nothing
318 if (m_shrink_history)
319 return;
320
321 UniqueArray<Real> values_to_write;
322 UniqueArray<Int32> iterations_to_write;
323
324 arrayToWrite(iterations_to_write, values_to_write, infos);
325
327 if (!meshHandle().isNull()) {
328 TimeHistoryCurveInfo curve_info(name(), meshHandle().meshName(), iterations_to_write, values_to_write, subSize(), sd);
329 writer->writeCurve(curve_info);
330 }
331 else {
332 TimeHistoryCurveInfo curve_info(name(), iterations_to_write, values_to_write, subSize(), sd);
333 writer->writeCurve(curve_info);
334 }
335 }
336
338 {
340 ci.name = name();
341 SharedArray<Int32> iterations(m_iterations.asArray());
342 ci.iterations = iterations;
343 Integer sub_size = subSize();
344 ci.sub_size = subSize();
345
346 SharedArray<DataType> values(m_values.asArray());
347
348 v->transform(ci, values);
349
350 Integer nb_iteration = iterations.size();
351 Integer nb_value = values.size();
352 if (nb_iteration * sub_size != nb_value) {
353 msg->warning() << "Bad size after history transformation";
354 return;
355 }
356
357 m_iterations.resize(nb_iteration);
358 for (Integer i = 0; i < nb_iteration; ++i)
359 m_iterations[i] = iterations[i];
360
361 m_values.resize(nb_value);
362 for (Integer i = 0; i < nb_value; ++i)
363 m_values[i] = values[i];
364 }
365
366 void arrayToWrite(UniqueArray<Int32>& iterations, UniqueArray<Real>& values, const TimeHistoryCurveWriterInfo& infos) const override
367 {
368 // To check that we do not save more iterations than there are
369 // currently (which can happen in case of rollback).
370 Integer max_iter = infos.times().size();
371 Integer nb_iteration = m_iterations.size();
372 Integer sub_size = subSize();
373 iterations.clear();
374 iterations.reserve(nb_iteration);
375 values.clear();
376 values.reserve(nb_iteration * sub_size);
377 for (Integer i = 0, is = nb_iteration; i < is; ++i) {
378 Integer iter = m_iterations[i];
379 if (iter < max_iter) {
380 for (Integer z = 0; z < sub_size; ++z) {
381 values.add(Convert::toReal(m_values[(i * sub_size) + z]));
382 }
383 iterations.add(iter);
384 }
385 }
386 }
387
388 const ValueList& values() const { return m_values; }
389 const IterationList& iterations() const { return m_iterations; }
390
391 private:
392
393 ValueList m_values;
394 IterationList m_iterations;
395 bool m_use_compression;
396 bool m_shrink_history;
397};
398
399/*---------------------------------------------------------------------------*/
400/*---------------------------------------------------------------------------*/
401
402class TimeHistoryMngInternal
404{
405 public:
406
407 explicit TimeHistoryMngInternal(IVariableMng* vm, const Ref<Properties>& properties)
408 : m_variable_mng(vm)
409 , m_trace_mng(m_variable_mng->traceMng())
410 , m_parallel_mng(m_variable_mng->parallelMng())
411 , m_common_variables(m_variable_mng)
412 , m_is_active(true)
413 , m_is_shrink_active(false)
414 , m_is_dump_active(true)
416 , m_need_comm(false)
417 , m_th_meta_data(VariableBuildInfo(m_variable_mng, "TimeHistoryMngMetaData"))
418 , m_th_global_time(VariableBuildInfo(m_variable_mng, "TimeHistoryMngGlobalTime"))
419 , m_properties(properties)
420 , m_version(2)
421 {
422 // TODO AH: With the new API, this variable should always be true
423 // (thanks to m_need_comm). Keep for IFPEN.
424 m_enable_non_io_master_curves = !platform::getEnvironmentVariable("ARCANE_ENABLE_NON_IO_MASTER_CURVES").null();
425
426 bool enable_all_replicats_write = !platform::getEnvironmentVariable("ARCANE_ENABLE_ALL_REPLICATS_WRITE_CURVES").null();
427
428 // Only the IO master subdomain activates time history.
429 IParallelReplication* pr = m_parallel_mng->replication();
430 if (pr->hasReplication()) {
431 m_is_master_io = (pr->isMasterRank() && m_parallel_mng->isMasterIO());
432 m_is_master_io_of_sd = (enable_all_replicats_write || pr->isMasterRank());
433 }
434 else {
435 m_is_master_io = m_parallel_mng->isMasterIO();
437 }
438 }
439
440 ~TimeHistoryMngInternal() override
441 {
443
444 m_curve_writers2.clear();
445 m_history_list.clear();
446 }
447
448 typedef std::map<String, TimeHistoryValue*> HistoryList;
449 typedef std::set<Ref<ITimeHistoryCurveWriter2>> CurveWriter2List;
450 typedef HistoryList::value_type HistoryValueType;
451
452 public:
453
454 void addValue(const TimeHistoryAddValueArgInternal& thpi, Real value) override
455 {
456 RealConstArrayView values(1, &value);
457 _addHistoryValue(thpi, values);
458 }
459 void addValue(const TimeHistoryAddValueArgInternal& thpi, Int64 value) override
460 {
461 Int64ConstArrayView values(1, &value);
462 _addHistoryValue(thpi, values);
463 }
464 void addValue(const TimeHistoryAddValueArgInternal& thpi, Int32 value) override
465 {
466 Int32ConstArrayView values(1, &value);
467 _addHistoryValue(thpi, values);
468 }
470 {
471 _addHistoryValue(thpi, values);
472 }
474 {
475 _addHistoryValue(thpi, values);
476 }
478 {
479 _addHistoryValue(thpi, values);
480 }
481
482 public:
483
484 void addNowInGlobalTime() override;
485 void updateGlobalTimeCurve() override;
486 void resizeArrayAfterRestore() override;
487 void dumpCurves(ITimeHistoryCurveWriter2* writer) override;
488 void dumpHistory() override;
489 void updateMetaData() override;
490 void readVariables(IMeshMng* mesh_mng, IMesh* default_mesh) override;
491
492 void addCurveWriter(Ref<ITimeHistoryCurveWriter2> writer) override;
493 void removeCurveWriter(const String& name) override;
495
496 void addObservers(IPropertyMng* prop_mng) override;
497 void editOutputPath(const Directory& directory) override;
498 void iterationsAndValues(const TimeHistoryAddValueArgInternal& thpi, UniqueArray<Int32>& iterations, UniqueArray<Real>& values) override;
499
500 public:
501
502 bool isShrinkActive() const override { return m_is_shrink_active; }
503 void setShrinkActive(bool is_active) override { m_is_shrink_active = is_active; }
504 bool active() const override { return m_is_active; }
505 void setActive(bool is_active) override { m_is_active = is_active; }
506 bool isDumpActive() const override { return m_is_dump_active; }
507 void setDumpActive(bool is_active) override { m_is_dump_active = is_active; }
508 bool isMasterIO() override { return m_is_master_io; }
509 bool isMasterIOOfSubDomain() override { return m_is_master_io_of_sd; }
511 bool isIOMasterWriteOnly() override { return m_io_master_write_only; }
512 void setIOMasterWriteOnly(bool is_active) override { m_io_master_write_only = is_active; }
513
514 private:
515
523 template <class DataType>
525
529 void _destroyAll();
530
535
541
548
554 void _fromLegacyFormat(IMesh* default_mesh);
555
559 void _saveProperties();
560
566
567 private:
568
569 IVariableMng* m_variable_mng;
570 ITraceMng* m_trace_mng;
571 IParallelMng* m_parallel_mng;
572 CommonVariables m_common_variables;
573 Directory m_directory;
574
583
584 String m_output_path;
585 ObserverPool m_observer_pool;
586 HistoryList m_history_list;
590 CurveWriter2List m_curve_writers2;
591 Ref<Properties> m_properties;
592 Integer m_version;
593};
594
595/*---------------------------------------------------------------------------*/
596/*---------------------------------------------------------------------------*/
597
598} // End namespace Arcane
599
600/*---------------------------------------------------------------------------*/
601/*---------------------------------------------------------------------------*/
602
603#endif
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
constexpr Integer size() const noexcept
Returns the size of the array.
Common variables of a case.
Constant view of an array of type T.
constexpr Integer size() const noexcept
Number of elements in the array.
Class managing a directory.
Definition Directory.h:36
Mesh manager interface.
Definition IMeshMng.h:41
Interface of the parallelism manager for a subdomain.
Brief information on parallel subdomain replication.
virtual bool hasReplication() const =0
Indicates if replication is active.
virtual bool isMasterRank() const =0
Indicates if this replication rank is the master.
Interface of the property manager.
virtual void writeCurve(const TimeHistoryCurveInfo &infos)=0
Write a curve.
Interface for the internal part of a value history manager.
Integer sub_size
Number of values per curve.
Int32SharedArray iterations
List of iterations.
Interface of an object transforming history curves.
virtual void transform(CommonInfo &infos, RealSharedArray values)=0
Applies the transformation for a curve with Real values.
virtual TraceMessage warning()=0
Stream for a warning message.
Variable manager interface.
virtual IVariable * findMeshVariable(IMesh *mesh, const String &name)=0
Returns the mesh variable named name or 0 if no such name exists.
Interface of a variable.
Definition IVariable.h:40
@ PNoReplicaSync
Indicates that the variable does not necessarily have the same value across replicas.
Definition IVariable.h:147
@ PExecutionDepend
Indicates that the variable value is dependent on the execution.
Definition IVariable.h:96
@ PNoRestore
Indicates that the variable should not be restored.
Definition IVariable.h:120
Handle on a mesh.
Definition MeshHandle.h:48
List of observers.
Reference to an instance.
1D vector of data with reference semantics.
bool null() const
Returns true if the string is null.
Definition String.cc:306
Class extending the arguments when adding a value to a value history.
Information for writing a curve.
Information about writing curves.
RealConstArrayView times() const
List of times.
void setIOMasterWriteOnly(bool is_active) override
Method allowing to define if only the master process calls the writers.
bool isShrinkActive() const override
Returns a boolean indicating if the history is compressed.
void updateMetaData() override
Method allowing the curve metadata to be updated.
bool m_is_master_io
True if I am the IO manager.
bool m_is_shrink_active
Indicates if history compression is active.
void addNowInGlobalTime() override
Method allowing the current GlobalTime to be added to the GlobalTimes array.
bool isMasterIO() override
Method allowing to know if our process is the writer.
void addValue(const TimeHistoryAddValueArgInternal &thpi, Real value) override
Method allowing a value to be added to a history.
void _dumpSummaryOfCurves()
Method allowing a JSON file to be dumped with the name of each curve output in GNUPLOT format as well...
void addValue(const TimeHistoryAddValueArgInternal &thpi, Int32 value) override
Method allowing a value to be added to a history.
bool m_is_master_io_of_sd
True if I am the IO manager for my subdomain.
void _removeCurveWriter(const Ref< ITimeHistoryCurveWriter2 > &writer)
Method allowing removal of a writer.
void updateGlobalTimeCurve() override
Method allowing the GlobalTime array to be copied into the global GlobalTime variable.
void resizeArrayAfterRestore() override
Method allowing the value arrays to be resized after a restart.
void addObservers(IPropertyMng *prop_mng) override
Method allowing observers saving the history before a checkpoint to be added.
bool isMasterIOOfSubDomain() override
Method allowing to know if our process is the writer for our subdomain. In the case where replication...
bool isDumpActive() const override
Indicates the output activation status.
bool m_is_dump_active
Indicates if dumps are active.
void removeCurveWriter(const String &name) override
Method allowing a writer to be removed.
void readVariables(IMeshMng *mesh_mng, IMesh *default_mesh) override
Method allowing previously written curves to be retrieved during a restart.
void setDumpActive(bool is_active) override
Sets the output activation status.
void addValue(const TimeHistoryAddValueArgInternal &thpi, Int32ConstArrayView values) override
Method allowing values to be added to a history.
void dumpHistory() override
Method allowing all curves to be written using all registered writers.
void _dumpSummaryOfCurvesLegacy()
Method allowing an XML file to be dumped with the name of each curve output in GNUPLOT format.
void addValue(const TimeHistoryAddValueArgInternal &thpi, Int64ConstArrayView values) override
Method allowing values to be added to a history.
HistoryList m_history_list
List of histories.
void _addHistoryValue(const TimeHistoryAddValueArgInternal &thpi, ConstArrayView< DataType > values)
Method allowing values to be added to a value history.
VariableArrayReal m_th_global_time
Array of time instants.
bool isNonIOMasterCurvesEnabled() override
Method allowing to know if all processes can have a value history.
bool m_enable_non_io_master_curves
Indicates if curve writing by non-io_master procs is possible.
void _dumpCurvesAllWriters()
Method allowing all curves to be dumped with all writers.
void setActive(bool is_active) override
Sets the activation status.
void applyTransformation(ITimeHistoryTransformer *v) override
Applies the transformation v to all curves.
void iterationsAndValues(const TimeHistoryAddValueArgInternal &thpi, UniqueArray< Int32 > &iterations, UniqueArray< Real > &values) override
Method allowing the iterations and values of a history to be outputted.
void dumpCurves(ITimeHistoryCurveWriter2 *writer) override
Method allowing curves to be written using the provided writer.
bool m_io_master_write_only
Indicates if writers must be called by all processes.
bool isIOMasterWriteOnly() override
Method allowing to know if only the master process calls the writers.
bool active() const override
Indicates the activation status.
void addValue(const TimeHistoryAddValueArgInternal &thpi, RealConstArrayView values) override
Method allowing values to be added to a history.
void _saveProperties()
Method allowing saving the properties of the metadata.
void addValue(const TimeHistoryAddValueArgInternal &thpi, Int64 value) override
Method allowing a value to be added to a history.
void setShrinkActive(bool is_active) override
Sets the boolean indicating if the history is compressed.
VariableScalarString m_th_meta_data
History info.
void _fromLegacyFormat(IMesh *default_mesh)
Method allowing conversion from the old format to the new.
void editOutputPath(const Directory &directory) override
Method allowing the curve output directory to be changed.
RealUniqueArray m_global_times
List of global times.
bool m_need_comm
Indicates if at least one curve is non-local (thus requiring communications).
bool m_is_active
Indicates if the service is active.
void addCurveWriter(Ref< ITimeHistoryCurveWriter2 > writer) override
Method allowing a writer to be added for curve output.
TimeHistoryValueT(const TimeHistoryAddValueArgInternal &thpi, Integer index, Integer nb_element, bool shrink)
Constructor for building a value history linked to a mesh.
void applyTransformation(ITraceMng *msg, ITimeHistoryTransformer *v) override
Method allowing the application of a transformation on the values of the value history.
Integer size() const override
Method allowing the retrieval of the number of recorded values.
void dumpValues(ITraceMng *msg, ITimeHistoryCurveWriter2 *writer, const TimeHistoryCurveWriterInfo &infos) const override
Prints the history values using the writer writer.
void addValue(ConstArrayView< DataType > values, Integer iteration)
Method allowing the addition of values to an iteration.
void removeAfterIteration(Integer last_iteration) override
Method allowing the removal of all values after a certain iteration.
void arrayToWrite(UniqueArray< Int32 > &iterations, UniqueArray< Real > &values, const TimeHistoryCurveWriterInfo &infos) const override
Method allowing the retrieval of iterations and values from a value history.
TimeHistoryValueT(IVariableMng *vm, const TimeHistoryAddValueArgInternal &thpi, Integer index, Integer nb_element, bool shrink)
Constructor for building a value history not linked to a mesh.
void fromOldToNewVariables(IVariableMng *vm, IMesh *default_mesh) override
Method allowing the conversion of variables from old saves to the new format.
Integer index() const
History index in the list.
virtual Integer size() const =0
Method allowing the retrieval of the number of recorded values.
const MeshHandle & meshHandle() const
Method allowing the retrieval of the registered MeshHandle.
virtual void removeAfterIteration(Integer last_iteration)=0
Method allowing the removal of all values after a certain iteration.
const String & name() const
History name.
eDataType dataType() const
History data type.
virtual void applyTransformation(ITraceMng *msg, ITimeHistoryTransformer *v)=0
Method allowing the application of a transformation on the values of the value history.
Integer m_index
History index in the list.
virtual void fromOldToNewVariables(IVariableMng *vm, IMesh *default_mesh)=0
Method allowing the conversion of variables from old saves to the new format.
virtual ~TimeHistoryValue()=default
Frees resources.
Integer localSubDomainId() const
Method allowing the retrieval of the subdomain ID to which this history belongs.
virtual void arrayToWrite(UniqueArray< Int32 > &iterations, UniqueArray< Real > &values, const TimeHistoryCurveWriterInfo &infos) const =0
Method allowing the retrieval of iterations and values from a value history.
bool isLocal() const
Method allowing determination if it is a global history or local to a subdomain.
virtual void dumpValues(ITraceMng *msg, ITimeHistoryCurveWriter2 *writer, const TimeHistoryCurveWriterInfo &infos) const =0
Prints the history values using the writer writer.
1D data vector with value semantics (STL style).
Parameters necessary for building a variable.
virtual void resize(Integer new_size)
Resizes the array to contain new_size elements.
T max(const T &a, const T &b, const T &c)
Returns the maximum of three elements.
Definition MathUtils.h:407
VariableRefArrayT< Real > VariableArrayReal
Array variable of real type.
VariableRefScalarT< String > VariableScalarString
Scalar variable of character string type.
Real toReal(Real r)
Converts r to a Real.
String getEnvironmentVariable(const String &name)
Environment variable named name.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:476
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:474
Integer arcaneCallFunctionAndCatchException(std::function< void()> function)
Calls the function function while catching potential exceptions.
UniqueArray< Real > RealUniqueArray
Dynamic 1D array of reals.
Definition UtilsTypes.h:343
double Real
Type representing a real number.
eDataType
Data type.
Definition DataTypes.h:41
std::int32_t Int32
Signed integer type of 32 bits.
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:482