Arcane  v3.16.4.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
OutputChecker.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* OutputChecker.h (C) 2000-2025 */
9/* */
10/* Sorties basées sur un temps (physique ou CPU) ou un nombre d'itérations. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_OUTPUTCHECKER_H
13#define ARCANE_CORE_OUTPUTCHECKER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18
19#include "arcane/core/VariableTypes.h"
20#include "arcane/core/CaseOptions.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30/*!
31 * \brief Gère les sorties basées sur un temps physique, temps CPU ou
32 * un nombre d'itération.
33 *
34 * Le temps CPU est exprimé en minutes.
35 */
36class ARCANE_CORE_EXPORT OutputChecker
37{
38 public:
39
40 //! Type de sortie
42 {
43 OutTypeNone, //!< Pas de sorties
44 OutTypeGlobalTime, //!< Sortie basée sur le temps physique
45 OutTypeCPUTime, //!< Sortie basée sur le temps CPU consommé
46 OutTypeIteration //!< Sortie basée sur le nombre d'itérations
47 };
48
49 public:
50
51 OutputChecker(ISubDomain* sd, const String& name);
52
53 public:
54
55 void initialize();
56 void initialize(bool recompute_next_value);
57 bool hasOutput() const { return m_out_type != OutTypeNone; }
58 bool check(Real old_time, Real current_time, Integer current_iteration,
59 Integer current_cpu_time, const String& from_function = String());
60 void assignGlobalTime(VariableScalarReal* variable, const CaseOptionReal* option);
61 void assignCPUTime(VariableScalarInteger* variable, const CaseOptionInteger* option);
62 void assignIteration(VariableScalarInteger* variable, const CaseOptionInteger* option);
63 Real nextGlobalTime() const;
64 Integer nextIteration() const;
65 Integer nextCPUTime() const;
66
67 private:
68
69 ISubDomain* m_sub_domain = nullptr;
70 String m_name;
71 eOutType m_out_type = OutTypeNone;
72 VariableScalarInteger* m_next_iteration = nullptr; //!< Itération de la prochaine sauvegarde
73 VariableScalarReal* m_next_global_time = nullptr; //!< Temps physique de la prochaine sauvegarde
74 VariableScalarInteger* m_next_cpu_time = nullptr; //!< Temps CPU de la prochaine sauvegarde
75 const CaseOptionInteger* m_step_iteration = nullptr;
76 const CaseOptionReal* m_step_global_time = nullptr;
77 const CaseOptionInteger* m_step_cpu_time = nullptr;
78
79 private:
80
81 void _recomputeTypeGlobalTime();
82 void _recomputeTypeCPUTime();
83 void _recomputeTypeIteration();
84};
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89} // namespace Arcane
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94#endif
95
Interface du gestionnaire d'un sous-domaine.
Definition ISubDomain.h:74
Gère les sorties basées sur un temps physique, temps CPU ou un nombre d'itération.
eOutType
Type de sortie.
@ OutTypeCPUTime
Sortie basée sur le temps CPU consommé
@ OutTypeIteration
Sortie basée sur le nombre d'itérations.
@ OutTypeNone
Pas de sorties.
@ OutTypeGlobalTime
Sortie basée sur le temps physique.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-