Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
PreciseOutputChecker.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/* PreciseOutputChecker.h (C) 2000-2025 */
9/* */
10/* Outputs based on time (physical or CPU) or a number of iterations. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_PRECISEOUTPUTCHECKER_H
13#define ARCANE_CORE_PRECISEOUTPUTCHECKER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/VariableTypes.h"
18#include "arcane/core/ICaseFunction.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * Service for controlling the execution of file outputs.
31 * This service is a singleton that must be initialized when the application starts.
32 */
34{
35 public:
36
37 /*!
38 * Initialization based on the user data set.
39 **/
40 void initializeOutputPhysicalTime(double output_period);
42
43 void initializeOutputIteration(Integer output_period);
44 void initializeOutputIteration(ICaseFunction* output_period);
45
46 //! Indicates whether or not an output should be made
47 bool checkIfOutput(double old_time, double current_time, Integer current_iteration);
48
49 private:
50
51 //! Internal method for comparing times
52 bool _compareTime(Real current_time, Real compar_time);
53
54 //! Method to control a fixed output
55 bool _checkTime(Real old_time, Real current_time, Real output_period);
56
57 //! Method to check if a previous time does not trigger an output
58 bool _checkOldTime(Real old_time, Real output_period, Integer curr_number_of_outputs);
59
60 //! Method to control an output by interval
61 bool _checkTimeInterval(Real output_period, Real current_time, Real period);
62
63 double m_output_period_physical_time = 0.0;
64 ICaseFunction* m_table_values_physical_time = nullptr;
65 Integer m_output_period_iteration = -1;
66 ICaseFunction* m_table_values_iteration = nullptr;
67};
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72} // namespace Arcane
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77#endif
bool checkIfOutput(double old_time, double current_time, Integer current_iteration)
Indicates whether or not an output should be made.
void initializeOutputPhysicalTime(double output_period)
-- 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.