Here is a small C++ example program for which the Python version may be found in MESHcoordinates.py.
using namespace MEDMEM ;
using namespace MED_EN ;
int main (int argc, char ** argv) {
const string MedFile = "pointe.med" ;
const string MeshName = "maa1" ;
MESH myMesh(MED_DRIVER,MedFile,MeshName) ;
cout <<
"Mesh name : " << myMesh.
getName() << endl << endl ;
cout << "Space dimension : " << SpaceDimension << endl << endl ;
cout << "Number of nodes : " << NumberOfNodes << endl << endl ;
cout << "Show Nodes Coordinates : " << endl ;
cout << "Name :" << endl ;
for(int i=0; i<SpaceDimension ; i++) {
cout << " - " << CoordinatesNames[i] << endl ;
}
cout << "Unit :" << endl ;
for(int i=0; i<SpaceDimension ; i++) {
cout << " - " << CoordinatesUnits[i] << endl ;
}
const double * Coordinates =
for(int i=0; i<NumberOfNodes ; i++) {
cout << "Nodes " << i+1 << " : " ;
for (int j=0; j<SpaceDimension ; j++)
cout << Coordinates[i*SpaceDimension+j] << " " ;
cout << endl ;
}
return 0 ;
}