Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshTimeHistoryAdder.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/* MeshTimeHistoryAdder.h (C) 2000-2024 */
9/* */
10/* Class allowing the addition of a value history linked to a mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_MESHTIMEHISTORYADDER_H
13#define ARCANE_CORE_MESHTIMEHISTORYADDER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/ITimeHistoryAdder.h"
18#include "arcane/core/IParallelMng.h"
19#include "arcane/core/MeshHandle.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 * \brief Class allowing the addition of one or more values to a
32 * value history.
33 *
34 * This class will record curves supported by a mesh.
35 * That is, the curves will be linked to a mesh, in addition to being
36 * linked to the entire domain or the requested subdomain.
37 * If the link to the mesh is not desired, the GlobalTimeHistoryAdder
38 * class may be more interesting.
39 *
40 * For a given history name, there may be only one curve of a
41 * or several values per mesh and per subdomain (and one global one for
42 * all subdomains).
43 *
44 * Example: several curves of pressure averages (let's call them
45 * "avg_pressure"), two subdomains (0 and 1) and two meshes (mesh0 and mesh1).
46 * One value per iteration.
47 * - An "avg_pressure" curve linked to subdomain 0 and mesh 0. Each
48 * value is the average of the pressures of each cell of mesh 0 and
49 * of subdomain 0.
50 * - An "avg_pressure" curve linked to subdomain 0 and mesh 1. Each
51 * value is the average of the pressures of each cell of mesh 1 and
52 * of subdomain 0.
53 * - An "avg_pressure" curve linked to subdomain 1 and mesh 0. Each
54 * value is the average of the pressures of each cell of mesh 0 and
55 * of subdomain 1.
56 * - An "avg_pressure" curve linked to subdomain 1 and mesh 1. Each
57 * value is the average of the pressures of each cell of mesh 1 and
58 * of subdomain 1.
59 * - An "avg_pressure" curve linked to the entire domain and mesh 0.
60 * Each value is the average of the pressures of mesh 0 across each
61 * subdomain.
62 * - An "avg_pressure" curve linked to the entire domain and mesh 1.
63 * Each value is the average of the pressures of mesh 1 across each
64 * subdomain.
65 *
66 * It can be noted that it is possible to have several independent curves
67 * with the same name but linked to different meshes and
68 * different subdomains (+1 global curve). It is important to
69 * emphasize that this same name can also be used with the curves of
70 * GlobalTimeHistoryAdder independently, so the example above can be
71 * complementary to the one given in the description of GlobalTimeHistoryAdder!
72 * (meaning potentially 9 independent curves but with the same name!)
73 */
74class ARCANE_CORE_EXPORT MeshTimeHistoryAdder
75: public ITimeHistoryAdder
76{
77 public:
78
79 /*!
80 * \brief Constructor.
81 *
82 * \param time_history_mng A pointer to an instance of ITimeHistoryMng.
83 * \param mesh_handle The mesh to link to the curves.
84 */
85 MeshTimeHistoryAdder(ITimeHistoryMng* time_history_mng, const MeshHandle& mesh_handle);
86 ~MeshTimeHistoryAdder() override = default;
87
88 public:
89
90 void addValue(const TimeHistoryAddValueArg& thp, Real value) override;
91 void addValue(const TimeHistoryAddValueArg& thp, Int32 value) override;
92 void addValue(const TimeHistoryAddValueArg& thp, Int64 value) override;
93 void addValue(const TimeHistoryAddValueArg& thp, RealConstArrayView values) override;
94 void addValue(const TimeHistoryAddValueArg& thp, Int32ConstArrayView values) override;
95 void addValue(const TimeHistoryAddValueArg& thp, Int64ConstArrayView values) override;
96
97 private:
98
99 ITimeHistoryMng* m_thm;
100 MeshHandle m_mesh_handle;
101};
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106} // End namespace Arcane
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
110
111#endif
Class interface allowing the addition of one or more values to a value history.
Class managing a history of values.
Handle on a mesh.
Definition MeshHandle.h:48
MeshTimeHistoryAdder(ITimeHistoryMng *time_history_mng, const MeshHandle &mesh_handle)
Constructor.
void addValue(const TimeHistoryAddValueArg &thp, Real value) override
Method allowing the addition of a value to a history.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488