1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
20 #include "MEDMEM_Mesh.hxx"
22 using namespace MEDMEM ;
23 using namespace MED_EN ;
25 int main (int argc, char ** argv) {
27 const string MedFile = "pointe.med" ;
28 const string MeshName = "maa1" ;
29 MESH myMesh(MED_DRIVER,MedFile,MeshName) ;
31 cout << "Mesh name : " << myMesh.getName() << endl << endl ;
33 int SpaceDimension = myMesh.getSpaceDimension() ;
34 int NumberOfNodes = myMesh.getNumberOfNodes() ;
35 cout << "Space dimension : " << SpaceDimension << endl << endl ;
36 cout << "Number of nodes : " << NumberOfNodes << endl << endl ;
38 cout << "Show Nodes Coordinates : " << endl ;
40 // coordinates names :
41 cout << "Name :" << endl ;
42 const string * CoordinatesNames = myMesh.getCoordinatesNames() ;
43 for(int i=0; i<SpaceDimension ; i++) {
44 cout << " - " << CoordinatesNames[i] << endl ;
47 cout << "Unit :" << endl ;
48 const string * CoordinatesUnits = myMesh.getCoordinatesUnits() ;
49 for(int i=0; i<SpaceDimension ; i++) {
50 cout << " - " << CoordinatesUnits[i] << endl ;
53 const double * Coordinates =
54 myMesh.getCoordinates(MED_FULL_INTERLACE) ;
55 for(int i=0; i<NumberOfNodes ; i++) {
56 cout << "Nodes " << i+1 << " : " ;
57 for (int j=0; j<SpaceDimension ; j++)
58 cout << Coordinates[i*SpaceDimension+j] << " " ;