Mesh file reader in msh format. More...
Classes | |
| struct | MeshV4ElementsBlock |
| Information about a block for $Elements for version 4. More... | |
| struct | MeshPhysicalName |
| Information about a physical name. More... | |
| struct | MeshPhysicalNameList |
| Information about the '$PhysicalNames' block. More... | |
| struct | MeshV4EntitiesNodes |
| Info for 0D entities. More... | |
| struct | MeshV4EntitiesWithNodes |
| Info for 1D, 2D, and 3D entities. More... | |
| struct | MeshInfo |
Public Types | |
| using | eReturnType = typename IMeshReader::eReturnType |
Public Member Functions | |
| MshMeshReader (ITraceMng *tm) | |
| eReturnType | readMeshFromMshFile (IMesh *mesh, const String &file_name, bool use_internal_partition) override |
| Public Member Functions inherited from Arcane::TraceAccessor | |
| TraceAccessor (ITraceMng *m) | |
| Constructs an accessor via the trace manager m. | |
| TraceAccessor (const TraceAccessor &rhs) | |
| Copy constructor. | |
| TraceAccessor & | operator= (const TraceAccessor &rhs) |
| Copy assignment operator. | |
| virtual | ~TraceAccessor () |
| Frees resources. | |
| ITraceMng * | traceMng () 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 Attributes | |
| Integer | m_version = 0 |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::TraceAccessor | |
| void | _setLocalVerboseLevel (Int32 v) |
| Int32 | _localVerboseLevel () const |
Mesh file reader in msh format.
The msh format is used by the gmsh library.
The reader supports versions 2.0 and 4.1 of this format.
Only a portion of the format's features are supported:
Definition at line 89 of file MshMeshReader.cc.
| using Arcane::MshMeshReader::eReturnType = typename IMeshReader::eReturnType |
Definition at line 95 of file MshMeshReader.cc.
|
inlineexplicit |
Definition at line 226 of file MshMeshReader.cc.
|
private |
Definition at line 831 of file MshMeshReader.cc.
|
private |
Definition at line 763 of file MshMeshReader.cc.
|
private |
Definition at line 853 of file MshMeshReader.cc.
|
private |
Definition at line 632 of file MshMeshReader.cc.
|
private |
Definition at line 695 of file MshMeshReader.cc.
|
private |
Definition at line 430 of file MshMeshReader.cc.
|
private |
Reading elements (cells, faces, ...).
In version 4, elements are sorted by type (eItemKind)
Definition at line 510 of file MshMeshReader.cc.
References Arcane::Array< T >::add(), Arcane::Array< T >::addRange(), ARCANE_FATAL, ARCANE_THROW, Arcane::TraceAccessor::info(), Arcane::math::max(), and Arcane::Array< T >::resize().
Referenced by _readMeshFromNewMshFile().
Reading of entities.
The format is:
* $Entities * numPoints(size_t) numCurves(size_t) * numSurfaces(size_t) numVolumes(size_t) * pointTag(int) X(double) Y(double) Z(double) * numPhysicalTags(size_t) physicalTag(int) ... * ... * curveTag(int) minX(double) minY(double) minZ(double) * maxX(double) maxY(double) maxZ(double) * numPhysicalTags(size_t) physicalTag(int) ... * numBoundingPoints(size_t) pointTag(int) ... * ... * surfaceTag(int) minX(double) minY(double) minZ(double) * maxX(double) maxY(double) maxZ(double) * numPhysicalTags(size_t) physicalTag(int) ... * numBoundingCurves(size_t) curveTag(int) ... * ... * volumeTag(int) minX(double) minY(double) minZ(double) * maxX(double) maxY(double) maxZ(double) * numPhysicalTags(size_t) physicalTag(int) ... * numBoundngSurfaces(size_t) surfaceTag(int) ... * ... * $EndEntities *
Definition at line 953 of file MshMeshReader.cc.
References ARCANE_FATAL, and Arcane::TraceAccessor::info().
Referenced by _readMeshFromNewMshFile().
|
private |
The version 2.0 of the '.msh' file format is Gmsh's new native mesh file format. It is very similar to the old one (see Section 9.1.1 [Version 1.0], page 139), but is more general: it contains information about itself and allows to associate an arbitrary number of integer tags with each element. Ialso exists in both ASCII and binary form. The '.msh' file format, version 2.0, is divided in three main sections, defining the file format ($MeshFormat-$EndMeshFormat), the nodes ($Nodes-$EndNodes) and the elements ($Elements-$EndElements) in the mesh: /code $MeshFormat 2.0 file-type data-size (one-binary) is an integer of value 1 written in binary form. This integer is used for detecting if the computer on which the binary file was written and the computer on which the file is read are of the same type (little or big endian).
$EndMeshFormat $Nodes number-of-nodes node-number x-coord y-coord z-coord ... $EndNodes $Elements number-of-elements elm-number elm-type number-of-tags < tag > ... node-number-list ... $EndElements
Definition at line 1047 of file MshMeshReader.cc.
References _readElementsFromAsciiMshV4File(), _readEntitiesV4(), _readNodesFromAsciiMshV4File(), ARCANE_THROW, Arcane::TraceAccessor::info(), Arcane::IParallelMng::isParallel(), Arcane::IMeshReader::RTOk, and Arcane::IPrimaryMesh::setDimension().
Referenced by readMeshFromMshFile().
|
private |
Definition at line 330 of file MshMeshReader.cc.
|
private |
Definition at line 373 of file MshMeshReader.cc.
References ARCANE_THROW, Arcane::TraceAccessor::info(), Arcane::Array< T >::resize(), and Arcane::IMeshReader::RTOk.
Referenced by _readMeshFromNewMshFile().
|
private |
Definition at line 621 of file MshMeshReader.cc.
Definition at line 893 of file MshMeshReader.cc.
Definition at line 264 of file MshMeshReader.cc.
|
overridevirtual |
readMeshFromMshFile switches whether the targeted file is to be read with _readMeshFromOldMshFile or _readMeshFromNewMshFile function.
Implements Arcane::IMshMeshReader.
Definition at line 1155 of file MshMeshReader.cc.
References _readMeshFromNewMshFile(), Arcane::TraceAccessor::error(), Arcane::TraceAccessor::info(), Arcane::String::localstr(), and Arcane::IMeshReader::RTError.
|
private |
Definition at line 234 of file MshMeshReader.cc.