Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::VariableComparer Class Reference

Class to perform comparisons between variables. More...

#include <arcane/core/VariableComparer.h>

Public Member Functions

VariableComparerArgs buildForCheckIfSync ()
 Creates a comparison to verify that a variable is synchronized.
VariableComparerArgs buildForCheckIfSameOnAllReplica ()
 Creates a comparison to verify that a variable is identical on all replicas.
VariableComparerArgs buildForCheckIfSame (IDataReader *data_reader)
 Creates a comparison to verify that a variable is identical to a reference value.
VariableComparerResults apply (IVariable *var, const VariableComparerArgs &compare_args)
 Applies the comparison compare_args to the variable var.

Detailed Description

Class to perform comparisons between variables.

To use this class, you must create an instance of VariableComparerArgs via one of the following methods:

You must then call the apply() method with the created instance for each variable you wish to compare.

Definition at line 144 of file VariableComparer.h.

Member Function Documentation

◆ apply()

VariableComparerResults Arcane::VariableComparer::apply ( IVariable * var,
const VariableComparerArgs & compare_args )

Applies the comparison compare_args to the variable var.

Definition at line 63 of file VariableComparer.cc.

References Arcane::IVariable::_internalApi(), and ARCANE_CHECK_POINTER.

◆ buildForCheckIfSame()

VariableComparerArgs Arcane::VariableComparer::buildForCheckIfSame ( IDataReader * data_reader)

Creates a comparison to verify that a variable is identical to a reference value.

This operation verifies that the variable values are identical to a reference value which will be read from the data_reader.

It is possible to call the methods VariableComparerArgs::setMaxPrint(), VariableComparerArgs::setCompareGhost() or VariableComparerArgs::setComputeDifferenceMethod() on the returned instance to modify the behavior.

It is then possible to call the apply() method on the returned instance to perform comparisons on a variable.

Definition at line 50 of file VariableComparer.cc.

References ARCANE_CHECK_POINTER, and Arcane::Same.

◆ buildForCheckIfSameOnAllReplica()

VariableComparerArgs Arcane::VariableComparer::buildForCheckIfSameOnAllReplica ( )

Creates a comparison to verify that a variable is identical on all replicas.

Compares the variable values with those of the same subdomain on other replicas. For each differing element, a message is displayed.

Using apply() for this type of comparison is a collective method on the replica of the variable passed as an argument. Therefore, it should only be called if the variable exists on all subdomains, otherwise it will cause a blockage.

This comparison only works for variables of numerical types. In this case, it throws a NotSupportedException.

It is possible to call the methods VariableComparerArgs::setMaxPrint() or VariableComparerArgs::setComputeDifferenceMethod() on the returned instance to modify the behavior.

Definition at line 39 of file VariableComparer.cc.

References Arcane::SameOnAllReplica.

◆ buildForCheckIfSync()

VariableComparerArgs Arcane::VariableComparer::buildForCheckIfSync ( )

Creates a comparison to verify that a variable is synchronized.

This operation only works for mesh variables.

A variable is synchronized when its values are the same across all subdomains, both on proper elements and ghost elements.

It is possible to call the methods VariableComparerArgs::setMaxPrint(), VariableComparerArgs::setCompareGhost() or VariableComparerArgs::setComputeDifferenceMethod() on the returned instance to modify the behavior.

Definition at line 28 of file VariableComparer.cc.

References Arcane::Sync.


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