From fb3e45a7d760203791a458164118ff6450f47961 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 30 Mar 2011 10:07:10 +0000 Subject: [PATCH] Merge from V6_main; debug remains --- doc/MEDMEM/FIELDcreate.cxx | 2 +- doc/MEDMEM/FIELDcreate.py | 2 +- doc/MEDMEM/FIELDgeneral.cxx | 3 +-- doc/MEDMEM/FIELDgeneral.py | 2 +- .../MEDMEM_InvokingDriverAtObjectCreationTime.cxx | 1 + .../MEDMEM_InvokingDriverByAttachingItToAnObject.cxx | 12 ++++-------- .../MEDMEM_InvokingDriverByAttachingItToAnObject.py | 4 ++-- ...MEDMEM_InvokingDriverFromStandardObjectMethod.cxx | 4 ++-- .../MEDMEM_InvokingDriverFromStandardObjectMethod.py | 2 +- doc/MEDMEM/MESHINGexample.py | 4 ++-- 10 files changed, 16 insertions(+), 20 deletions(-) diff --git a/doc/MEDMEM/FIELDcreate.cxx b/doc/MEDMEM/FIELDcreate.cxx index a579b80a7..393923c82 100644 --- a/doc/MEDMEM/FIELDcreate.cxx +++ b/doc/MEDMEM/FIELDcreate.cxx @@ -36,7 +36,7 @@ int main (int argc, char ** argv) { 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 ; diff --git a/doc/MEDMEM/FIELDcreate.py b/doc/MEDMEM/FIELDcreate.py index c2dc59c37..ad0cbd2b0 100644 --- a/doc/MEDMEM/FIELDcreate.py +++ b/doc/MEDMEM/FIELDcreate.py @@ -34,7 +34,7 @@ meshName = "maa1" 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) diff --git a/doc/MEDMEM/FIELDgeneral.cxx b/doc/MEDMEM/FIELDgeneral.cxx index 0b9178de4..548baff96 100644 --- a/doc/MEDMEM/FIELDgeneral.cxx +++ b/doc/MEDMEM/FIELDgeneral.cxx @@ -39,7 +39,7 @@ int main (int argc, char ** argv) { /* 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 myField(mySupport,MED_DRIVER,MedFile,FieldName) ; // myField.read() ; @@ -77,7 +77,6 @@ int main (int argc, char ** argv) { cout << endl ; } - mySupport->removeReference(); myMesh->removeReference(); return 0 ; diff --git a/doc/MEDMEM/FIELDgeneral.py b/doc/MEDMEM/FIELDgeneral.py index c2bd995a8..659aa10d6 100644 --- a/doc/MEDMEM/FIELDgeneral.py +++ b/doc/MEDMEM/FIELDgeneral.py @@ -35,7 +35,7 @@ fieldName = "fieldcelldoublescalar" 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) diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx index 8fe5c483e..df5869e90 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx @@ -50,3 +50,4 @@ main () { MESSAGE_MED(ex.what()) ; } } + diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx index 2ec038ab6..0197b43ed 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx @@ -35,7 +35,7 @@ main () { 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 { @@ -45,14 +45,12 @@ main () { MED_FIELD_RDONLY_DRIVER 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 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(); @@ -75,9 +73,7 @@ main () { 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; } diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py index 714c93803..27f01397d 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py +++ b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.py @@ -53,17 +53,17 @@ except : 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" diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx index 8fb7cf3dc..abb22db69 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx @@ -40,12 +40,12 @@ main () { // Test creation of drivers from the standard driver method of an object FIELD * myField = new FIELD(); 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); diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py index aafefdeee..52bcf2e90 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py +++ b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.py @@ -30,7 +30,7 @@ from libMEDMEM_Swig import * medFile = "pointe.med" -medFile2 = "fieldCellDoubleOfpointe.me" +medFile2 = "fieldCellDoubleOfpointe.med" fieldName = "fieldcelldoublescalar" meshName = "maa1" diff --git a/doc/MEDMEM/MESHINGexample.py b/doc/MEDMEM/MESHINGexample.py index a05a00319..21e616a8c 100644 --- a/doc/MEDMEM/MESHINGexample.py +++ b/doc/MEDMEM/MESHINGexample.py @@ -307,10 +307,10 @@ myMeshing.write(VTK_DRIVER,vtkFileName) # 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) -- 2.39.2