The retrieval of general information about a mesh is illustrated in the following C++ example. Its Python equivalent can be found in MESHgeneral.py. This example illustrates how to retrieve the name, description, mesh and space dimensions.
using namespace std;
using namespace MEDMEM ;
int main (int argc, char ** argv) {
const string MedFile = "pointe.med" ;
const string MeshName = "maa1" ;
MESH myMesh(MED_DRIVER,MedFile,MeshName) ;
if (Name != MeshName) {
cout << "Error when reading mesh name : We ask for mesh #"
<< MeshName <<"# and we get mesh #"<< Name <<"#"<< endl << endl ;
return -1;
}
cout << "Mesh name : " << Name << endl << endl ;
cout << "Space Dimension : " << SpaceDimension << endl << endl ;
cout << "Mesh Dimension : " << MeshDimension << endl << endl ;
return 0 ;
}