Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[modules/smesh.git] / src / DriverGMF / DriverGMF_Read.cxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File      : DriverGMF_Read.cxx
23 // Created   : Mon Sep 17 17:03:02 2012
24 // Author    : Edward AGAPOV (eap)
25
26 #include "DriverGMF_Read.hxx"
27 #include "DriverGMF.hxx"
28
29 #include "SMESHDS_Group.hxx"
30 #include "SMESHDS_Mesh.hxx"
31 #include "SMESH_Comment.hxx"
32 #include "SMESH_TypeDefs.hxx"
33
34 #include <Basics_Utils.hxx>
35
36 extern "C"
37 {
38 #include "libmesh5.h"
39 }
40
41 #include <stdarg.h>
42
43 // --------------------------------------------------------------------------------
44 DriverGMF_Read::DriverGMF_Read():
45   Driver_SMESHDS_Mesh(),
46   _makeRequiredGroups( true ),
47   _makeFaultGroups( true )
48 {
49 }
50 // --------------------------------------------------------------------------------
51 DriverGMF_Read::~DriverGMF_Read()
52 {
53 }
54
55 //================================================================================
56 /*!
57  * \brief Read a GMF file
58  */
59 //================================================================================
60
61 Driver_Mesh::Status DriverGMF_Read::Perform()
62 {
63   Kernel_Utils::Localizer loc;
64
65   Status status = DRS_OK;
66
67   int dim, version;
68
69   // open the file
70   int meshID = GmfOpenMesh( myFile.c_str(), GmfRead, &version, &dim );
71   if ( !meshID )
72   {
73     if ( DriverGMF::isExtensionCorrect( myFile ))
74       return addMessage( SMESH_Comment("Can't open for reading ") << myFile,
75                          /*fatal=*/true );
76     else
77       return addMessage( SMESH_Comment("Not '.mesh' or '.meshb' extension of file ") << myFile,
78                          /*fatal=*/true );
79   }
80   DriverGMF::MeshCloser aMeshCloser( meshID ); // An object closing GMF mesh at destruction
81
82   // Read nodes
83
84   int nbNodes = GmfStatKwd(meshID, GmfVertices);
85   if ( nbNodes < 1 )
86     return addMessage( "No nodes in the mesh", /*fatal=*/true );
87
88   GmfGotoKwd(meshID, GmfVertices);
89
90   int ref;
91
92   const smIdType nodeIDShift = myMesh->GetMeshInfo().NbNodes();
93   if ( version != GmfFloat )
94   {
95     double x, y, z;
96     for ( int i = 1; i <= nbNodes; ++i )
97     {
98       GmfGetLin(meshID, GmfVertices, &x, &y, &z, &ref);
99       myMesh->AddNodeWithID( x,y,z, nodeIDShift + i);
100     }
101   }
102   else
103   {
104     float x, y, z;
105     for ( int i = 1; i <= nbNodes; ++i )
106     {
107       GmfGetLin(meshID, GmfVertices, &x, &y, &z, &ref);
108       myMesh->AddNodeWithID( x,y,z, nodeIDShift + i);
109     }
110   }
111
112   // Read elements
113
114   int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :)
115
116   /* Read edges */
117   const smIdType edgeIDShift = myMesh->GetMeshInfo().NbElements();
118   if ( int nbEdges = GmfStatKwd(meshID, GmfEdges))
119   {
120     // read extra vertices for quadratic edges
121     std::vector<int> quadNodesAtEdges( nbEdges + 1, -1 );
122     if ( int nbQuadEdges = GmfStatKwd(meshID, GmfExtraVerticesAtEdges))
123     {
124       GmfGotoKwd(meshID, GmfExtraVerticesAtEdges);
125       for ( int i = 1; i <= nbQuadEdges; ++i )
126       {
127         GmfGetLin(meshID, GmfExtraVerticesAtEdges, &iN[0], &iN[1], &iN[2]);
128         if ( iN[1] >= 1 )
129           quadNodesAtEdges[ iN[0] ] = iN[2];
130       }
131     }
132     // create edges
133     GmfGotoKwd(meshID, GmfEdges);
134     for ( int i = 1; i <= nbEdges; ++i )
135     {
136       GmfGetLin(meshID, GmfEdges, &iN[0], &iN[1], &ref);
137       const int midN = quadNodesAtEdges[ i ];
138       if ( midN > 0 )
139       {
140         if ( !myMesh->AddEdgeWithID( iN[0], iN[1], midN, edgeIDShift + i ))
141           status = storeBadNodeIds( "GmfEdges + GmfExtraVerticesAtEdges",i,
142                                     3, iN[0], iN[1], midN);
143       }
144       else
145       {
146         if ( !myMesh->AddEdgeWithID( iN[0], iN[1], edgeIDShift + i ))
147           status = storeBadNodeIds( "GmfEdges",i, 2, iN[0], iN[1] );
148       }
149     }
150   }
151
152   /* Read triangles */
153   const smIdType triaIDShift = myMesh->GetMeshInfo().NbElements();
154   if ( int nbTria = GmfStatKwd(meshID, GmfTriangles))
155   {
156     // read extra vertices for quadratic triangles
157     std::vector< std::vector<int> > quadNodesAtTriangles( nbTria + 1 );
158     if ( int nbQuadTria = GmfStatKwd(meshID, GmfExtraVerticesAtTriangles ))
159     {
160       GmfGotoKwd( meshID, GmfExtraVerticesAtTriangles );
161       for ( int i = 1; i <= nbQuadTria; ++i )
162       {
163         GmfGetLin(meshID, GmfExtraVerticesAtTriangles,
164                   &iN[0], &iN[1], &iN[2], &iN[3], &iN[4],
165                   &iN[5]); // iN[5] - preview TRIA7
166         if ( iN[0] <= nbTria )
167         {
168           std::vector<int>& nodes = quadNodesAtTriangles[ iN[0] ];
169           nodes.insert( nodes.end(), & iN[2], & iN[5+1] );
170           nodes.resize( iN[1] );
171         }
172       }
173     }
174     // create triangles
175     GmfGotoKwd(meshID, GmfTriangles);
176     for ( int i = 1; i <= nbTria; ++i )
177     {
178       GmfGetLin(meshID, GmfTriangles, &iN[0], &iN[1], &iN[2], &ref);
179       std::vector<int>& midN = quadNodesAtTriangles[ i ];
180       if ( midN.size() >= 3 )
181       {
182         if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2], midN[0],midN[1],midN[2],
183                                      triaIDShift + i ))
184           status = storeBadNodeIds( "GmfTriangles + GmfExtraVerticesAtTriangles",i, 6,
185                                     iN[0],iN[1],iN[2], midN[0],midN[1],midN[2] );
186       }
187       else
188       {
189         if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], triaIDShift + i ))
190           status = storeBadNodeIds( "GmfTriangles",i, 3, iN[0], iN[1], iN[2] );
191       }
192       if ( !midN.empty() ) SMESHUtils::FreeVector( midN );
193     }
194   }
195
196   /* Read quadrangles */
197   const smIdType quadIDShift = myMesh->GetMeshInfo().NbElements();
198   if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals))
199   {
200     // read extra vertices for quadratic quadrangles
201     std::vector< std::vector<int> > quadNodesAtQuadrilaterals( nbQuad + 1 );
202     if ( int nbQuadQuad = GmfStatKwd( meshID, GmfExtraVerticesAtQuadrilaterals ))
203     {
204       GmfGotoKwd(meshID, GmfExtraVerticesAtQuadrilaterals);
205       for ( int i = 1; i <= nbQuadQuad; ++i )
206       {
207         GmfGetLin(meshID, GmfExtraVerticesAtQuadrilaterals,
208                   &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6]);
209         if ( iN[0] <= nbQuad )
210         {
211           std::vector<int>& nodes = quadNodesAtQuadrilaterals[ iN[0] ];
212           nodes.insert( nodes.end(), & iN[2], & iN[6+1] );
213           nodes.resize( iN[1] );
214         }
215       }
216     }
217     // create quadrangles
218     GmfGotoKwd(meshID, GmfQuadrilaterals);
219     for ( int i = 1; i <= nbQuad; ++i )
220     {
221       GmfGetLin(meshID, GmfQuadrilaterals, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
222       std::vector<int>& midN = quadNodesAtQuadrilaterals[ i ];
223       if ( midN.size() == 8-4 ) // QUAD8
224       {
225         if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3],
226                                      midN[0], midN[1], midN[2], midN[3],
227                                      quadIDShift + i ))
228           status = storeBadNodeIds( "GmfQuadrilaterals + GmfExtraVerticesAtQuadrilaterals",i, 8,
229                                     iN[0], iN[1],iN[2], iN[3],
230                                     midN[0], midN[1], midN[2], midN[3]);
231       }
232       else if ( midN.size() > 8-4 ) // QUAD9
233       {
234         if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3],
235                                      midN[0], midN[1], midN[2], midN[3], midN[4],
236                                      quadIDShift + i ))
237           status = storeBadNodeIds( "GmfQuadrilaterals + GmfExtraVerticesAtQuadrilaterals",i, 9,
238                                     iN[0], iN[1],iN[2], iN[3],
239                                     midN[0], midN[1], midN[2], midN[3], midN[4]);
240       }
241       else // QUAD4
242       {
243         if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3], quadIDShift + i ))
244           status = storeBadNodeIds( "GmfQuadrilaterals",i, 4, iN[0], iN[1],iN[2], iN[3] );
245       }
246       if ( !midN.empty() ) SMESHUtils::FreeVector( midN );
247     }
248   }
249
250   /* Read terahedra */
251   const smIdType tetIDShift = myMesh->GetMeshInfo().NbElements();
252   if ( int nbTet = GmfStatKwd( meshID, GmfTetrahedra ))
253   {
254     // read extra vertices for quadratic tetrahedra
255     std::vector< std::vector<int> > quadNodesAtTetrahedra( nbTet + 1 );
256     if ( int nbQuadTetra = GmfStatKwd( meshID, GmfExtraVerticesAtTetrahedra ))
257     {
258       GmfGotoKwd(meshID, GmfExtraVerticesAtTetrahedra);
259       for ( int i = 1; i <= nbQuadTetra; ++i )
260       {
261         GmfGetLin(meshID, GmfExtraVerticesAtTetrahedra,
262                   &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7]);
263         if ( iN[0] <= nbTet )
264         {
265           std::vector<int>& nodes = quadNodesAtTetrahedra[ iN[0] ];
266           nodes.insert( nodes.end(), & iN[2], & iN[7+1] );
267           nodes.resize( iN[1] );
268         }
269       }
270     }
271     // create tetrahedra
272     GmfGotoKwd(meshID, GmfTetrahedra);
273     for ( int i = 1; i <= nbTet; ++i )
274     {
275       GmfGetLin(meshID, GmfTetrahedra, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
276       std::vector<int>& midN = quadNodesAtTetrahedra[ i ];
277       if ( midN.size() >= 10-4 ) // TETRA10
278       {
279         if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3],
280                                        midN[2], midN[1], midN[0], midN[3], midN[5], midN[4],
281                                        tetIDShift + i ))
282           status = storeBadNodeIds( "GmfTetrahedra + GmfExtraVerticesAtTetrahedra",i, 10,
283                                     iN[0], iN[2], iN[1], iN[3],
284                                     midN[2], midN[1], midN[0], midN[3], midN[5], midN[4] );
285       }
286       else // TETRA4
287       {
288         if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], tetIDShift + i ))
289           status = storeBadNodeIds( "GmfTetrahedra" ,i, 4, iN[0], iN[2], iN[1], iN[3] );
290       }
291       if ( !midN.empty() ) SMESHUtils::FreeVector( midN );
292     }
293   }
294
295   /* Read pyramids */
296   const smIdType pyrIDShift = myMesh->GetMeshInfo().NbElements();
297   if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids))
298   {
299     GmfGotoKwd(meshID, GmfPyramids);
300     for ( int i = 1; i <= nbPyr; ++i )
301     {
302       GmfGetLin(meshID, GmfPyramids, &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &ref);
303       if ( !myMesh->AddVolumeWithID( iN[3], iN[2], iN[1], iN[0], iN[4], pyrIDShift + i ))
304         status = storeBadNodeIds( "GmfPyramids",i, 5, iN[0], iN[1],iN[2], iN[3], iN[4] );
305     }
306   }
307
308   /* Read hexahedra */
309   const smIdType hexIDShift = myMesh->GetMeshInfo().NbElements();
310   if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
311   {
312     // read extra vertices for quadratic hexahedra
313     std::vector< std::vector<int> > quadNodesAtHexahedra( nbHex + 1 );
314     if ( int nbQuadHexa = GmfStatKwd( meshID, GmfExtraVerticesAtHexahedra ))
315     {
316       GmfGotoKwd(meshID, GmfExtraVerticesAtHexahedra);
317       for ( int i = 1; i <= nbQuadHexa; ++i )
318       {
319         GmfGetLin(meshID, GmfExtraVerticesAtHexahedra, &iN[0], &iN[1], // Hexa Id, Nb extra vertices
320                   &iN[2], &iN[3], &iN[4], &iN[5],
321                   &iN[6], &iN[7], &iN[8], &iN[9],
322                   &iN[10], &iN[11], &iN[12], &iN[13], // HEXA20
323                   &iN[14],
324                   &iN[15], &iN[16], &iN[17], &iN[18],
325                   &iN[19],
326                   &iN[20]);                          // HEXA27
327         if ( iN[0] <= nbHex )
328         {
329           std::vector<int>& nodes = quadNodesAtHexahedra[ iN[0] ];
330           nodes.insert( nodes.end(), & iN[2], & iN[20+1] );
331           nodes.resize( iN[1] );
332         }
333       }
334     }
335     // create hexhedra
336     GmfGotoKwd(meshID, GmfHexahedra);
337     for ( int i = 1; i <= nbHex; ++i )
338     {
339       GmfGetLin(meshID, GmfHexahedra, &iN[0], &iN[1], &iN[2], &iN[3],
340                 &iN[4], &iN[5], &iN[6], &iN[7], &ref);
341       std::vector<int>& midN = quadNodesAtHexahedra[ i ];
342       if ( midN.size() == 20-8 ) // HEXA20
343       {
344         if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
345                                        iN[4], iN[7], iN[6], iN[5],
346                                        midN[3], midN[2], midN[1], midN[0],
347                                        midN[7], midN[6], midN[5], midN[4],
348                                        midN[8], midN[11], midN[10], midN[9],
349                                        hexIDShift + i ))
350           status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20,
351                                     iN[0], iN[3], iN[2], iN[1],
352                                     iN[4], iN[7], iN[6], iN[5],
353                                     midN[3], midN[2], midN[1], midN[0],
354                                     midN[7], midN[6], midN[5], midN[4],
355                                     midN[8], midN[11], midN[10], midN[9]);
356       }
357       else if ( midN.size() >= 27-8 ) // HEXA27
358       {
359         if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
360                                        iN[4], iN[7], iN[6], iN[5],
361                                        midN[3], midN[2], midN[1], midN[0],
362                                        midN[7], midN[6], midN[5], midN[4],
363                                        midN[8], midN[11], midN[10], midN[9],
364                                        midN[12],
365                                        midN[16], midN[15], midN[14], midN[13],
366                                        midN[17],
367                                        midN[18],
368                                        hexIDShift + i ))
369           status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27,
370                                     iN[0], iN[3], iN[2], iN[1],
371                                     iN[4], iN[7], iN[6], iN[5],
372                                     midN[3], midN[2], midN[1], midN[0],
373                                     midN[7], midN[6], midN[5], midN[4],
374                                     midN[8], midN[11], midN[10], midN[9],
375                                     midN[12],
376                                     midN[16], midN[15], midN[14], midN[13],
377                                     midN[17],
378                                     midN[18]);
379       }
380       else // HEXA8
381       {
382         if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
383                                        iN[4], iN[7], iN[6], iN[5], hexIDShift + i ) )
384           status = storeBadNodeIds( "GmfHexahedra" ,i, 8, iN[0], iN[3], iN[2], iN[1],
385                                     iN[4], iN[7], iN[6], iN[5] );
386       }
387       if ( !midN.empty() ) SMESHUtils::FreeVector( midN );
388     }
389   }
390
391   /* Read prism */
392   const smIdType prismIDShift = myMesh->GetMeshInfo().NbElements();
393   if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms))
394   {
395     GmfGotoKwd(meshID, GmfPrisms);
396     for ( int i = 1; i <= nbPrism; ++i )
397     {
398       GmfGetLin(meshID, GmfPrisms, &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &ref);
399       if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], iN[5], iN[4], prismIDShift + i))
400         status = storeBadNodeIds( "GmfPrisms",i,
401                                   6, iN[0], iN[1],iN[2], iN[3], iN[4], iN[5] );
402     }
403   }
404
405   // Read some entities into groups
406   // see MeshGems/Docs/meshgems_formats_description.pdf
407
408   // get ids of existing groups
409   std::set< int > groupIDs;
410   const std::set<SMESHDS_GroupBase*>&          groups = myMesh->GetGroups();
411   std::set<SMESHDS_GroupBase*>::const_iterator grIter = groups.begin();
412   for ( ; grIter != groups.end(); ++grIter )
413     groupIDs.insert( (*grIter)->GetID() );
414   if ( groupIDs.empty() ) groupIDs.insert( 0 );
415
416   // Read required entities into groups
417   if ( _makeRequiredGroups )
418   {
419
420     const smIdType kes[4][3] = { { GmfRequiredVertices,      SMDSAbs_Node, nodeIDShift },
421                                  { GmfRequiredEdges,         SMDSAbs_Edge, edgeIDShift },
422                                  { GmfRequiredTriangles,     SMDSAbs_Face, triaIDShift },
423                                  { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }
424     };
425     const char* names[4] = { "_required_Vertices"      ,
426                              "_required_Edges"         ,
427                              "_required_Triangles"     ,
428                              "_required_Quadrilaterals"
429     };
430     for ( int i = 0; i < 4; ++i )
431     {
432       int                 gmfKwd = FromSmIdType<int>( kes[i][0] );
433       SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
434       smIdType            shift  = kes[i][2];
435       if ( int nb = GmfStatKwd(meshID, gmfKwd))
436       {
437         const int newID = *groupIDs.rbegin() + 1;
438         groupIDs.insert( newID );
439         SMESHDS_Group* group = new SMESHDS_Group( newID, myMesh, entity );
440         group->SetStoreName( names[i] );
441         myMesh->AddGroup( group );
442
443         GmfGotoKwd(meshID, gmfKwd);
444         for ( int i = 0; i < nb; ++i )
445         {
446           GmfGetLin(meshID, gmfKwd, &iN[0] );
447           group->Add( shift + iN[0] );
448         }
449       }
450     }
451   }
452
453   // Read fault entities into groups
454   if ( _makeFaultGroups )
455   {
456
457     const smIdType kes[7][3] = { { GmfFault_SmallTri,     SMDSAbs_Face, triaIDShift },
458                                  { GmfFault_BadShape,     SMDSAbs_Face, triaIDShift },
459                                  { GmfFault_Overlap,      SMDSAbs_Face, triaIDShift },
460                                  { GmfFault_Inter,        SMDSAbs_Face, triaIDShift },
461                                  { GmfFault_NearTri,      SMDSAbs_Face, triaIDShift },
462                                  { GmfFault_FreeEdge,     SMDSAbs_Face, triaIDShift },
463                                  { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift }
464     };
465     const char* names[7] = { "Fault_SmallTri",
466                              "Fault_BadShape",
467                              "Fault_Overlap",
468                              "Fault_Inter",
469                              "Fault_NearTri",
470                              "Fault_FreeEdge",
471                              "Fault_MultipleEdge"
472     };
473     for ( int i = 0; i < 7; ++i )
474     {
475       int                 gmfKwd = FromSmIdType<int>( kes[i][0] );
476       SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
477       smIdType            shift  = kes[i][2];
478       if ( int nb = GmfStatKwd(meshID, gmfKwd))
479       {
480         const int newID = *groupIDs.rbegin() + 1;
481         groupIDs.insert( newID );
482         SMESHDS_Group* group = new SMESHDS_Group( newID, myMesh, entity );
483         group->SetStoreName( names[i] );
484         myMesh->AddGroup( group );
485
486         GmfGotoKwd(meshID, gmfKwd);
487         for ( int i = 0; i < nb; ++i )
488         {
489           GmfGetLin(meshID, gmfKwd, &iN[0] );
490           group->Add( shift + iN[0] );
491         }
492       }
493     }
494   }
495
496
497   myMesh->Modified();
498   myMesh->CompactMesh();
499
500   return status;
501 }
502
503 //================================================================================
504 /*!
505  * \brief Store a message about invalid IDs of nodes
506  */
507 //================================================================================
508
509 Driver_Mesh::Status DriverGMF_Read::storeBadNodeIds(const char* gmfKwd, int elemNb, int nb, ...)
510 {
511   if ( myStatus != DRS_OK )
512     return myStatus;
513
514   SMESH_Comment msg;
515
516   va_list VarArg;
517   va_start(VarArg, nb);
518
519   for ( int i = 0; i < nb; ++i )
520   {
521     int id = va_arg(VarArg, int );
522     if ( !myMesh->FindNode( id ))
523       msg << " " << id;
524   }
525   va_end(VarArg);
526
527   if ( !msg.empty() )
528   {
529     std::string nbStr;
530     const char* nbNames[] = { "1-st ", "2-nd ", "3-d " };
531     if ( elemNb < 3 ) nbStr = nbNames[ elemNb-1 ];
532     else              nbStr = SMESH_Comment(elemNb) << "-th ";
533
534     return addMessage
535       ( SMESH_Comment("Wrong node IDs of ")<< nbStr << gmfKwd << ":" << msg,
536         /*fatal=*/false );
537   }
538   return DRS_OK;
539 }