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

Reading variables in HDF5 format. More...

Inheritance diagram for Arcane::Hdf5VariableReaderHelper2:
Collaboration diagram for Arcane::Hdf5VariableReaderHelper2:

Classes

class  TimeVariableInfoBase
class  CorrespondanceInfo
 Correspondence information between saved uids and those of the current mesh for the group group. More...

Public Member Functions

 Hdf5VariableReaderHelper2 (IMesh *mesh, const String &hdf5_file_name)
void setVariables (ConstArrayView< IVariable * > vars)
 Specifies the variables that we want to reread.
void open (bool is_start)
 Opens the file containing the reading information.
void readAndUpdateTimeVariables (Real wanted_time)
 Reading and updating variables.
void notifyRestore ()
 Notification of a rollback.
Real2 timeInterval (IVariable *var)
Public Member Functions inherited from Arcane::Hdf5VariableReaderHelperBase
 Hdf5VariableReaderHelperBase (IMesh *mesh)
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Member Functions

template<typename DataType>
void _readAndUpdateVariable (TimeVariableInfoBase *vi, Real wanted_time, HFile &hfile)
bool _isWanted (const String &var_name, const String &var_family)
void _checkCreateCorrespondance (Hdf5VariableInfoBase *var, HFile &file_id, const String &group_path, bool is_start)
void _createCorrespondance (IVariable *var, CorrespondanceInfo *ci, Int64ConstArrayView saved_uids, Real3ConstArrayView saved_centers)
 Finds which saved mesh entity corresponds to a current mesh entity.

Private Attributes

UniqueArray< IVariable * > m_wanted_vars
ScopedPtrT< IXmlDocumentHolderm_xml_document_holder
UniqueArray< TimeVariableInfoBase * > m_time_variables
std::map< String, CorrespondanceInfo * > m_correspondance_map

Additional Inherited Members

Protected Member Functions inherited from Arcane::Hdf5VariableReaderHelperBase
void _readStandardArray (IVariable *var, RealArray &buffer, hid_t file_id, const String &path)
void _readVariable (IVariable *var, RealArray &buffer, HFile &hfile, const String &path)
void _checkValidVariable (IVariable *var)
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const
Protected Attributes inherited from Arcane::Hdf5VariableReaderHelperBase
IMeshm_mesh
Hdf5Utils::StandardTypes m_types
String m_hdf5_file_name
bool m_is_verbose

Detailed Description

Reading variables in HDF5 format.

Definition at line 552 of file Hdf5VariableReader.cc.

Constructor & Destructor Documentation

◆ Hdf5VariableReaderHelper2()

Arcane::Hdf5VariableReaderHelper2::Hdf5VariableReaderHelper2 ( IMesh * mesh,
const String & hdf5_file_name )

Definition at line 726 of file Hdf5VariableReader.cc.

◆ ~Hdf5VariableReaderHelper2()

Arcane::Hdf5VariableReaderHelper2::~Hdf5VariableReaderHelper2 ( )

Definition at line 736 of file Hdf5VariableReader.cc.

Member Function Documentation

◆ _checkCreateCorrespondance()

void Arcane::Hdf5VariableReaderHelper2::_checkCreateCorrespondance ( Hdf5VariableInfoBase * var,
HFile & file_id,
const String & group_path,
bool is_start )
private

Definition at line 812 of file Hdf5VariableReader.cc.

◆ _createCorrespondance()

void Arcane::Hdf5VariableReaderHelper2::_createCorrespondance ( IVariable * var,
CorrespondanceInfo * ci,
Int64ConstArrayView saved_uids,
Real3ConstArrayView saved_centers )
private

Finds which saved mesh entity corresponds to a current mesh entity.

When rereading variable values from a file, we assume that the current mesh is not necessarily the same as the saved mesh. In this case, the uniqueIds of the entities do not match. Therefore, we must find which saved entity corresponds to each current mesh entity. To know which one to use, we take the one from the original mesh closest to the current mesh. Since only initial coordinates are saved, this only works correctly during initialization. This processing should not be done during restart. This information is therefore saved in a variable. TODO: It would be necessary to be able to use an algorithm other than just the closest entity.

Definition at line 851 of file Hdf5VariableReader.cc.

References Arcane::Array< T >::add(), Arcane::IParallelMng::allGatherVariable(), Arcane::ArrayView< T >::copy(), ENUMERATE_ITEM, Arcane::TraceAccessor::info(), Arcane::Item::isOwn(), Arcane::IVariable::itemGroup(), Arcane::MeshHandle::mesh(), Arcane::IVariable::meshHandle(), Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::nodeIds(), Arcane::VariableRefArrayT< T >::resize(), Arcane::AbstractArray< T >::size(), Arcane::ConstArrayView< T >::size(), Arcane::Item::toItemWithNodes(), and Arcane::Item::toNode().

Here is the call graph for this function:

◆ _isWanted()

bool Arcane::Hdf5VariableReaderHelper2::_isWanted ( const String & var_name,
const String & var_family )
private

Definition at line 913 of file Hdf5VariableReader.cc.

◆ _readAndUpdateVariable()

template<typename DataType>
void Arcane::Hdf5VariableReaderHelper2::_readAndUpdateVariable ( TimeVariableInfoBase * vi,
Real wanted_time,
HFile & hfile )
private

Definition at line 931 of file Hdf5VariableReader.cc.

◆ notifyRestore()

void Arcane::Hdf5VariableReaderHelper2::notifyRestore ( )

Notification of a rollback.

Definition at line 1055 of file Hdf5VariableReader.cc.

References Arcane::Hdf5VariableReaderHelper2::TimeVariableInfoBase::m_current_index.

◆ open()

void Arcane::Hdf5VariableReaderHelper2::open ( bool is_start)

Opens the file containing the reading information.

is_start is true when starting a case. If not, there is no need to read the initialization variables.

Definition at line 747 of file Hdf5VariableReader.cc.

References Arccore::Array< T >::add(), ARCANE_FATAL, Arcane::XmlNode::attr(), Arcane::IParallelMng::broadcastMemoryBuffer(), Arcane::XmlNode::children(), Arcane::Hdf5Utils::StandardArrayT< DataType >::directRead(), Arcane::XmlNode::documentElement(), Arcane::TraceAccessor::fatal(), Arcane::TraceAccessor::info(), Arcane::IParallelMng::isMasterIO(), Arcane::IVariable::itemGroupName(), Arcane::IParallelMng::masterIORank(), Arcane::IIOMng::parseXmlBuffer(), Arcane::AbstractArray< T >::size(), Arcane::XmlNode::valueAsReal(), and Arcane::XmlNode::xpathFullName().

Here is the call graph for this function:

◆ readAndUpdateTimeVariables()

void Arcane::Hdf5VariableReaderHelper2::readAndUpdateTimeVariables ( Real wanted_time)

Reading and updating variables.

Definition at line 1031 of file Hdf5VariableReader.cc.

References Arcane::IVariable::dataType(), Arcane::DT_Real, and Arcane::DT_Real3.

Here is the call graph for this function:

◆ setVariables()

void Arcane::Hdf5VariableReaderHelper2::setVariables ( ConstArrayView< IVariable * > vars)
inline

Specifies the variables that we want to reread.

This method must be called before open(). If this method is not called, it attempts to reread all variables saved in the file.

Definition at line 675 of file Hdf5VariableReader.cc.

◆ timeInterval()

Real2 Arcane::Hdf5VariableReaderHelper2::timeInterval ( IVariable * var)
inline

Definition at line 694 of file Hdf5VariableReader.cc.

Member Data Documentation

◆ m_correspondance_map

std::map<String, CorrespondanceInfo*> Arcane::Hdf5VariableReaderHelper2::m_correspondance_map
private

Definition at line 710 of file Hdf5VariableReader.cc.

◆ m_time_variables

UniqueArray<TimeVariableInfoBase*> Arcane::Hdf5VariableReaderHelper2::m_time_variables
private

Definition at line 709 of file Hdf5VariableReader.cc.

◆ m_wanted_vars

UniqueArray<IVariable*> Arcane::Hdf5VariableReaderHelper2::m_wanted_vars
private

Definition at line 707 of file Hdf5VariableReader.cc.

◆ m_xml_document_holder

ScopedPtrT<IXmlDocumentHolder> Arcane::Hdf5VariableReaderHelper2::m_xml_document_holder
private

Definition at line 708 of file Hdf5VariableReader.cc.


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