MESH * myMesh = new MESH(MED_DRIVER,MedFile,MeshName) ;
// we need a support :
- SUPPORT * mySupport = new SUPPORT(myMesh,"Support on all CELLs",MED_CELL);
+ const SUPPORT * mySupport = myMesh->getSupportOnAll(MED_CELL);
/* create FIELD on mySupport, with 3 components */
int NumberOfCompoennts = 3 ;
myMesh = MESH(MED_DRIVER,MedFile,meshName)
-mySupport = SUPPORT(myMesh,"Support on all CELLs",MED_CELL)
+mySupport = myMesh.getSupportOnAll(MED_CELL)
numberOfComponents = 3
myField = FIELDDOUBLE(mySupport,numberOfComponents)
/* read FIELD */
// we need a support :
- SUPPORT * mySupport = new SUPPORT(myMesh,"Support on all Cells",MED_CELL);
+ const SUPPORT * mySupport = myMesh->getSupportOnAll(MED_CELL);
FIELD<double> myField(mySupport,MED_DRIVER,MedFile,FieldName) ;
// myField.read() ;
cout << endl ;
}
- mySupport->removeReference();
myMesh->removeReference();
return 0 ;
myMesh = MESH(MED_DRIVER,MedFile,meshName)
-mySupport = SUPPORT(myMesh,"Support on CELLs",MED_CELL)
+mySupport = myMesh.getSupportOnAll(MED_CELL)
myField = FIELDDOUBLE(mySupport,MED_DRIVER,MedFile,fieldName,-1,-1)
MESSAGE_MED(ex.what()) ;
}
}
+
const char * fileName = "pointe.med";
const char * fileName2 = "Field&MeshGeneratedPointe.med";
const char * fileName3 = "MedGeneratedPointe.med";
- const char * fieldName = "fieldcelldouble";
+ const char * fieldName = "fieldcelldoublescalar";
const char * meshName = "maa1";
try {
MED_FIELD_RDONLY_DRIVER<double> myRdOnlyDriver(fileName,myField);
myRdOnlyDriver.setFieldName(fieldName);
myRdOnlyDriver.open();
- //This test failed due to inadequate Support implementation
- // myRdOnlyDriver.read();
+ myRdOnlyDriver.read();
// try { myRdOnlyDriver.write(); } catch (MEDEXCEPTION& ex)
// { MESSAGE(ex.what()); }
MED_FIELD_WRONLY_DRIVER<double> myWrOnlyDriver(fileName2,myField);
myWrOnlyDriver.open();
- //This test failed due to inadequate Support implementation
- // myWrOnlyDriver.write();
+ myWrOnlyDriver.write();
// try myWrOnlyDriver.read(); catch (MEDEXCEPTION& ex)
// { MESSAGE(ex.what()); }
myRdOnlyDriver.close();
myWrOnlyDriver.write();
// try myWrOnlyDriver.read(); catch (MEDEXCEPTION& ex)
// { MESSAGE(ex.what()); }
- // myRdOnlyDriver.close();
- //While we use H5close() in the MESH/FIELD drivers, the next
- //line will fail, because all files are previously closed !
+ myRdOnlyDriver.close();
myWrOnlyDriver.close();
delete myMesh;
}
try:
myMesh = MESH()
+
myRdOnlyDriver = MED_MESH_RDONLY_DRIVER(medFile,myMesh)
myRdOnlyDriver.setMeshName(meshName)
myRdOnlyDriver.open()
myRdOnlyDriver.read()
myRdOnlyDriver.close()
- myWrOnlyDriver = MED_MESH_WRONLY_DRIVER(medFile,myMesh)
+ myWrOnlyDriver = MED_MESH_WRONLY_DRIVER(medFile2,myMesh)
myWrOnlyDriver.setMeshName(meshName)
myWrOnlyDriver.open()
myWrOnlyDriver.write()
-
myWrOnlyDriver.close()
print "Invoking mesh drivers OK"
// Test creation of drivers from the standard driver method of an object
FIELD<double> * myField = new FIELD<double>();
int myDriver1 = myField->addDriver(MED_DRIVER, fileName, fieldName);
- //myField->read();
+ myField->read();
//This test failed due to inadequate Support implementation
myField->rmDriver(); // TESTER LA VALIDITE DE myDriver2 !!!!
int myDriver2 = myField->addDriver(MED_DRIVER, fileName2, fieldName);
- //myField->write(myDriver2);
+ myField->write(myDriver2);
//This test failed due to inadequate Support implementation
myField->rmDriver(myDriver2);
from libMEDMEM_Swig import *
medFile = "pointe.med"
-medFile2 = "fieldCellDoubleOfpointe.me"
+medFile2 = "fieldCellDoubleOfpointe.med"
fieldName = "fieldcelldoublescalar"
meshName = "maa1"
# 2 fields on nodes (cells) :
# 1 scalar (vector)
-supportOnNodes = SUPPORT(myMeshing,"On_All_Nodes",MED_NODE)
+supportOnNodes = myMeshing.getSupportOnAll(MED_NODE)
numberOfNodes = supportOnNodes.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
-supportOnCells = SUPPORT(myMeshing,"On_All_Cells",MED_CELL)
+supportOnCells = myMeshing.getSupportOnAll(MED_CELL)
numberOfCells = supportOnCells.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
fieldDoubleScalarOnNodes = FIELDDOUBLE(supportOnNodes,1)