Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::OutputChecker Class Reference

Manages outputs based on physical time, CPU time, or a number of iterations. More...

#include <arcane/core/OutputChecker.h>

Collaboration diagram for Arcane::OutputChecker:

Public Types

enum  eOutType { OutTypeNone , OutTypeGlobalTime , OutTypeCPUTime , OutTypeIteration }
 Output type. More...

Public Member Functions

 OutputChecker (ISubDomain *sd, const String &name)
void initialize ()
void initialize (bool recompute_next_value)
bool hasOutput () const
bool check (Real old_time, Real current_time, Integer current_iteration, Integer current_cpu_time, const String &from_function=String())
 Checks whether an output should be performed.
void assignGlobalTime (VariableScalarReal *variable, const CaseOptionReal *option)
void assignCPUTime (VariableScalarInteger *variable, const CaseOptionInteger *option)
void assignIteration (VariableScalarInteger *variable, const CaseOptionInteger *option)
Real nextGlobalTime () const
Integer nextIteration () const
Integer nextCPUTime () const

Private Member Functions

void _recomputeTypeGlobalTime ()
void _recomputeTypeCPUTime ()
void _recomputeTypeIteration ()

Private Attributes

ISubDomainm_sub_domain = nullptr
String m_name
eOutType m_out_type = OutTypeNone
VariableScalarIntegerm_next_iteration = nullptr
 Next save iteration.
VariableScalarRealm_next_global_time = nullptr
 Physical time of the next save.
VariableScalarIntegerm_next_cpu_time = nullptr
 CPU time of the next save.
const CaseOptionInteger * m_step_iteration = nullptr
const CaseOptionReal * m_step_global_time = nullptr
const CaseOptionInteger * m_step_cpu_time = nullptr

Detailed Description

Manages outputs based on physical time, CPU time, or a number of iterations.

CPU time is expressed in minutes.

Definition at line 37 of file OutputChecker.h.

Member Enumeration Documentation

◆ eOutType

Output type.

Enumerator
OutTypeNone 

No outputs.

OutTypeGlobalTime 

Output based on physical time.

OutTypeCPUTime 

Output based on consumed CPU time.

OutTypeIteration 

Output based on number of iterations.

Definition at line 42 of file OutputChecker.h.

Constructor & Destructor Documentation

◆ OutputChecker()

Arcane::OutputChecker::OutputChecker ( ISubDomain * sd,
const String & name )

Definition at line 34 of file OutputChecker.cc.

Member Function Documentation

◆ _recomputeTypeCPUTime()

void Arcane::OutputChecker::_recomputeTypeCPUTime ( )
private

Definition at line 233 of file OutputChecker.cc.

◆ _recomputeTypeGlobalTime()

void Arcane::OutputChecker::_recomputeTypeGlobalTime ( )
private

Definition at line 210 of file OutputChecker.cc.

◆ _recomputeTypeIteration()

void Arcane::OutputChecker::_recomputeTypeIteration ( )
private

Definition at line 259 of file OutputChecker.cc.

◆ assignCPUTime()

void Arcane::OutputChecker::assignCPUTime ( VariableScalarInteger * variable,
const CaseOptionInteger * option )

Definition at line 54 of file OutputChecker.cc.

◆ assignGlobalTime()

void Arcane::OutputChecker::assignGlobalTime ( VariableScalarReal * variable,
const CaseOptionReal * option )

Definition at line 47 of file OutputChecker.cc.

◆ assignIteration()

void Arcane::OutputChecker::assignIteration ( VariableScalarInteger * variable,
const CaseOptionInteger * option )

Definition at line 61 of file OutputChecker.cc.

◆ check()

bool Arcane::OutputChecker::check ( Real old_time,
Real current_time,
Integer current_iteration,
Integer cpu_time_used,
const String & from_function = String() )

Checks whether an output should be performed.

  • old_time and current_time are used for physical time outputs.
  • current_iteration is used for iteration count outputs.
  • cpu_time_used is used for CPU time outputs.

When an output type is not available, the associated value(s) are not used and may be arbitrary.

Parameters
old_timephysical time of the previous iteration.
current_timecurrent physical time.
current_iterationcurrent iteration.
cpu_time_usedCPU time used

Definition at line 86 of file OutputChecker.cc.

References Arcane::ITraceMng::debug(), Arcane::math::floor(), Arcane::math::isEqual(), Arcane::math::isZero(), m_next_global_time, OutTypeCPUTime, OutTypeGlobalTime, OutTypeIteration, and OutTypeNone.

Here is the call graph for this function:

◆ hasOutput()

bool Arcane::OutputChecker::hasOutput ( ) const
inline

Definition at line 58 of file OutputChecker.h.

◆ initialize() [1/2]

void Arcane::OutputChecker::initialize ( )

Definition at line 286 of file OutputChecker.cc.

◆ initialize() [2/2]

void Arcane::OutputChecker::initialize ( bool recompute_next_value)

Definition at line 295 of file OutputChecker.cc.

◆ nextCPUTime()

Integer Arcane::OutputChecker::nextCPUTime ( ) const

Definition at line 365 of file OutputChecker.cc.

◆ nextGlobalTime()

Real Arcane::OutputChecker::nextGlobalTime ( ) const

Definition at line 341 of file OutputChecker.cc.

◆ nextIteration()

Integer Arcane::OutputChecker::nextIteration ( ) const

Definition at line 353 of file OutputChecker.cc.

Member Data Documentation

◆ m_name

String Arcane::OutputChecker::m_name
private

Definition at line 71 of file OutputChecker.h.

◆ m_next_cpu_time

VariableScalarInteger* Arcane::OutputChecker::m_next_cpu_time = nullptr
private

CPU time of the next save.

Definition at line 75 of file OutputChecker.h.

◆ m_next_global_time

VariableScalarReal* Arcane::OutputChecker::m_next_global_time = nullptr
private

Physical time of the next save.

Definition at line 74 of file OutputChecker.h.

Referenced by check().

◆ m_next_iteration

VariableScalarInteger* Arcane::OutputChecker::m_next_iteration = nullptr
private

Next save iteration.

Definition at line 73 of file OutputChecker.h.

◆ m_out_type

eOutType Arcane::OutputChecker::m_out_type = OutTypeNone
private

Definition at line 72 of file OutputChecker.h.

◆ m_step_cpu_time

const CaseOptionInteger* Arcane::OutputChecker::m_step_cpu_time = nullptr
private

Definition at line 78 of file OutputChecker.h.

◆ m_step_global_time

const CaseOptionReal* Arcane::OutputChecker::m_step_global_time = nullptr
private

Definition at line 77 of file OutputChecker.h.

◆ m_step_iteration

const CaseOptionInteger* Arcane::OutputChecker::m_step_iteration = nullptr
private

Definition at line 76 of file OutputChecker.h.

◆ m_sub_domain

ISubDomain* Arcane::OutputChecker::m_sub_domain = nullptr
private

Definition at line 70 of file OutputChecker.h.


The documentation for this class was generated from the following files: