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

MED format mesh reader. More...

Inheritance diagram for Arcane::MEDMeshReader:
Collaboration diagram for Arcane::MEDMeshReader:

Classes

class  MEDToArcaneItemInfo
 Information for mapping MED types to Arcane types for entities. More...
class  MEDFamilyInfo
 Information about a MED entity family. More...
class  MEDGroupInfo
 List of groups and the entities belonging to them. More...
struct  AutoCloseMED

Public Member Functions

 MEDMeshReader (ITraceMng *tm)
IMeshReader::eReturnType readMesh (IPrimaryMesh *mesh, const String &file_name)
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

IMeshReader::eReturnType _readMesh (IPrimaryMesh *mesh, const String &filename)
Int32 _readItems (med_idt fid, const char *meshnane, const MEDToArcaneItemInfo &iinfo, Array< Int16 > &polygon_nb_nodes, Array< med_int > &connectivity, Array< med_int > &family_values)
 Reads information about entities of a given type.
void _initMEDToArcaneTypes ()
void _addTypeInfo (int dimension, int nb_node, med_int med_type, ItemTypeId arcane_type)
void _addTypeInfo (int dimension, int nb_node, med_int med_type, ItemTypeId arcane_type, const Int32 *indirection)
void _readAndCreateCells (IPrimaryMesh *mesh, Int32 mesh_dimension, med_idt fid, const char *meshname)
void _readFaces (IPrimaryMesh *mesh, Int32 mesh_dimension, med_idt fid, const char *meshname)
 Reads the faces.
IMeshReader::eReturnType _readNodesCoordinates (IPrimaryMesh *mesh, Int64 nb_node, Int32 spacedim, med_idt fid, const char *meshname)
void _readFamilies (med_idt fid, const char *meshname)
void _readAvailableTypes (med_idt fid, const char *meshname)
 Retrieves the list of geometric types present in the mesh.
void _clearItemsInGroups ()
void _broadcastGroups (ConstArrayView< String > names, IItemFamily *family)
 Broadcast the groups of group_names for the family family.

Private Attributes

IPrimaryMeshm_mesh = nullptr
 Mesh currently being read.
UniqueArray< MEDToArcaneItemInfom_med_to_arcane_types
 Conversion table between MED and Arcane types.
std::unordered_map< med_int, Int32m_med_geotype_to_arcane_type_index
 Table of indices in m_med_to_arcane_type for each geotype.
std::unordered_map< Int32, MEDFamilyInfom_med_families_map
 List of families.
UniqueArray< MEDGroupInfom_med_groups
 List of group information.
UniqueArray< med_int > m_med_geotypes_in_mesh
 List of 'geotypes' present in the mesh.

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

MED format mesh reader.

First version of a MED reader handling only 2D, 3D, and unstructured meshes.

Definition at line 49 of file MEDMeshReaderService.cc.

Constructor & Destructor Documentation

◆ MEDMeshReader()

Arcane::MEDMeshReader::MEDMeshReader ( ITraceMng * tm)
inlineexplicit

Definition at line 137 of file MEDMeshReaderService.cc.

Member Function Documentation

◆ _addTypeInfo() [1/2]

void Arcane::MEDMeshReader::_addTypeInfo ( int dimension,
int nb_node,
med_int med_type,
ItemTypeId arcane_type )
inlineprivate

Definition at line 187 of file MEDMeshReaderService.cc.

◆ _addTypeInfo() [2/2]

void Arcane::MEDMeshReader::_addTypeInfo ( int dimension,
int nb_node,
med_int med_type,
ItemTypeId arcane_type,
const Int32 * indirection )
inlineprivate

Definition at line 191 of file MEDMeshReaderService.cc.

◆ _broadcastGroups()

void Arcane::MEDMeshReader::_broadcastGroups ( ConstArrayView< String > group_names,
IItemFamily * family )
private

Broadcast the groups of group_names for the family family.

The list of groups group_names is only used for rank 0.

Definition at line 968 of file MEDMeshReaderService.cc.

References Arcane::IParallelMng::commRank(), Arcane::IItemFamily::findGroup(), m_mesh, and Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ _clearItemsInGroups()

void Arcane::MEDMeshReader::_clearItemsInGroups ( )
inlineprivate

Definition at line 207 of file MEDMeshReaderService.cc.

◆ _initMEDToArcaneTypes()

void Arcane::MEDMeshReader::_initMEDToArcaneTypes ( )
private

Definition at line 237 of file MEDMeshReaderService.cc.

◆ _readAndCreateCells()

void Arcane::MEDMeshReader::_readAndCreateCells ( IPrimaryMesh * mesh,
Int32 mesh_dimension,
med_idt fid,
const char * meshname )
private

Definition at line 521 of file MEDMeshReaderService.cc.

◆ _readAvailableTypes()

void Arcane::MEDMeshReader::_readAvailableTypes ( med_idt fid,
const char * meshname )
private

Retrieves the list of geometric types present in the mesh.

Definition at line 482 of file MEDMeshReaderService.cc.

References ARCANE_FATAL, Arcane::TraceAccessor::info(), and m_med_geotypes_in_mesh.

Here is the call graph for this function:

◆ _readFaces()

void Arcane::MEDMeshReader::_readFaces ( IPrimaryMesh * mesh,
Int32 mesh_dimension,
med_idt fid,
const char * meshname )
private

Reads the faces.

There is no need to explicitly create the faces because this is done automatically in Arcane. We therefore use the MED faces only to add the faces into the corresponding groups in the mesh file.

Definition at line 632 of file MEDMeshReaderService.cc.

References _readItems(), ARCANE_FATAL, Arcane::Node::faces(), Arcane::TraceAccessor::info(), Arcane::Item::localId(), m_med_families_map, m_med_geotype_to_arcane_type_index, m_med_geotypes_in_mesh, m_med_groups, m_med_to_arcane_types, Arcane::Item::null(), Arcane::AbstractArray< T >::size(), Arcane::Array< T >::span(), Arcane::ItemTypeMng::typeFromId(), and Arcane::ItemTypeInfo::typeName().

Here is the call graph for this function:

◆ _readFamilies()

void Arcane::MEDMeshReader::_readFamilies ( med_idt fid,
const char * meshname )
private

Definition at line 899 of file MEDMeshReaderService.cc.

◆ _readItems()

Int32 Arcane::MEDMeshReader::_readItems ( med_idt fid,
const char * meshname,
const MEDToArcaneItemInfo & iinfo,
Array< Int16 > & polygon_nb_nodes,
Array< med_int > & connectivity,
Array< med_int > & family_values )
private

Reads information about entities of a given type.

Reads information about entities whose type is given by iinfo. The entities are cells in the MED sense, i.e., Edge, Face, or Cell. Returns the number of entities read. connectivity will contain the connectivities for the entities read and family_values the array for each entity of the family it belongs to. Note that family_values may be empty if there is no family associated with the entities.

If the type is MED_POLYGON, then polygon_nb_nodes will contain the number of nodes for each polygon.

Definition at line 799 of file MEDMeshReaderService.cc.

References ARCANE_FATAL, ARCANE_THROW, Arcane::Array< T >::clear(), Arcane::Array< T >::data(), Arcane::TraceAccessor::info(), and Arcane::Array< T >::resize().

Referenced by _readFaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readMesh()

IMeshReader::eReturnType Arcane::MEDMeshReader::_readMesh ( IPrimaryMesh * mesh,
const String & filename )
private

Definition at line 300 of file MEDMeshReaderService.cc.

◆ _readNodesCoordinates()

IMeshReader::eReturnType Arcane::MEDMeshReader::_readNodesCoordinates ( IPrimaryMesh * mesh,
Int64 nb_node,
Int32 spacedim,
med_idt fid,
const char * meshname )
nodiscardprivate

Definition at line 733 of file MEDMeshReaderService.cc.

◆ readMesh()

IMeshReader::eReturnType Arcane::MEDMeshReader::readMesh ( IPrimaryMesh * mesh,
const String & file_name )
nodiscard

Definition at line 289 of file MEDMeshReaderService.cc.

Member Data Documentation

◆ m_med_families_map

std::unordered_map<Int32, MEDFamilyInfo> Arcane::MEDMeshReader::m_med_families_map
private

List of families.

Definition at line 176 of file MEDMeshReaderService.cc.

Referenced by _readFaces().

◆ m_med_geotype_to_arcane_type_index

std::unordered_map<med_int, Int32> Arcane::MEDMeshReader::m_med_geotype_to_arcane_type_index
private

Table of indices in m_med_to_arcane_type for each geotype.

Definition at line 174 of file MEDMeshReaderService.cc.

Referenced by _readFaces().

◆ m_med_geotypes_in_mesh

UniqueArray<med_int> Arcane::MEDMeshReader::m_med_geotypes_in_mesh
private

List of 'geotypes' present in the mesh.

Definition at line 180 of file MEDMeshReaderService.cc.

Referenced by _readAvailableTypes(), and _readFaces().

◆ m_med_groups

UniqueArray<MEDGroupInfo> Arcane::MEDMeshReader::m_med_groups
private

List of group information.

Definition at line 178 of file MEDMeshReaderService.cc.

Referenced by _readFaces().

◆ m_med_to_arcane_types

UniqueArray<MEDToArcaneItemInfo> Arcane::MEDMeshReader::m_med_to_arcane_types
private

Conversion table between MED and Arcane types.

Definition at line 172 of file MEDMeshReaderService.cc.

Referenced by _readFaces().

◆ m_mesh

IPrimaryMesh* Arcane::MEDMeshReader::m_mesh = nullptr
private

Mesh currently being read.

Definition at line 170 of file MEDMeshReaderService.cc.

Referenced by _broadcastGroups().


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