From: nadir Date: Mon, 26 Sep 2005 15:12:57 +0000 (+0000) Subject: updating the main trunk with the CEA debug devellopment from the branch X-Git-Tag: V3_0_3a2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=153861724418e21fd2707b2dfb4bea760533928b;p=modules%2Fmed.git updating the main trunk with the CEA debug devellopment from the branch CEA_V3_0_x (tagged For_V3_0_3a2) --- diff --git a/Makefile.in b/Makefile.in index ab72f2728..28493549c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -55,6 +55,10 @@ Mistrat_import22.med \ pointe_import22.med \ TimeStamps_import22.med \ poly3D.med \ +Darcy3_3D_H_10x10x10_2.med \ +elle_3D_HPr_10x10x10_2.med \ +elle_3D_HPr_2x2x2_2.med \ +elle_3D_HPr_4x4x4_2.med \ Darcy3_3D_H_10x10x10.sauve \ dx200_dy1_avec_2couches.sauve \ elle_2D_QT_10x10.sauve \ diff --git a/bin/VERSION b/bin/VERSION index e9a90323f..851d79cab 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - MED VERSION: 3.0.2 +THIS IS SALOME - MED VERSION: 3.0.3 diff --git a/doc/MEDMEM/FIELDcreate.cxx b/doc/MEDMEM/FIELDcreate.cxx index e94b17b78..d8375e073 100644 --- a/doc/MEDMEM/FIELDcreate.cxx +++ b/doc/MEDMEM/FIELDcreate.cxx @@ -3,6 +3,7 @@ using namespace std; #include "MEDMEM_Field.hxx" using namespace MEDMEM; +using namespace MED_EN ; int main (int argc, char ** argv) { diff --git a/doc/MEDMEM/FIELDgeneral.cxx b/doc/MEDMEM/FIELDgeneral.cxx index 120cef911..18c021037 100644 --- a/doc/MEDMEM/FIELDgeneral.cxx +++ b/doc/MEDMEM/FIELDgeneral.cxx @@ -3,6 +3,7 @@ using namespace std; #include "MEDMEM_Field.hxx" using namespace MEDMEM; +using namespace MED_EN ; int main (int argc, char ** argv) { diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx index fca94088d..b7017228d 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx @@ -5,6 +5,9 @@ #include "MEDMEM_Mesh.hxx" #include "MEDMEM_Med.hxx" +using namespace MEDMEM ; +using namespace MED_EN ; + main () { const char * fileName = "pointe.med"; diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx index b8c110ad2..e90b6030a 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx @@ -4,6 +4,11 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_Mesh.hxx" #include "MEDMEM_Med.hxx" +#include "MEDMEM_MedMedDriver.hxx" +#include "MEDMEM_MedMeshDriver.hxx" + +using namespace MEDMEM ; +using namespace MED_EN ; main () { diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx index 87ed74393..270eacbc2 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx @@ -5,6 +5,9 @@ #include "MEDMEM_Mesh.hxx" #include "MEDMEM_Med.hxx" +using namespace MEDMEM ; +using namespace MED_EN ; + main () { const char * fileName = "pointe.med"; diff --git a/doc/MEDMEM/MESHINGexample.cxx b/doc/MEDMEM/MESHINGexample.cxx index 2ec7a16ee..07c943a02 100644 --- a/doc/MEDMEM/MESHINGexample.cxx +++ b/doc/MEDMEM/MESHINGexample.cxx @@ -1,6 +1,9 @@ #include "MEDMEM_Meshing.hxx" #include "MEDMEM_Group.hxx" +using namespace MEDMEM ; +using namespace MED_EN ; + using namespace std; int main (int argc, char ** argv) { diff --git a/doc/MEDMEM/MESHconnectivities.cxx b/doc/MEDMEM/MESHconnectivities.cxx index 2964ff9f8..6a0f40cfe 100644 --- a/doc/MEDMEM/MESHconnectivities.cxx +++ b/doc/MEDMEM/MESHconnectivities.cxx @@ -1,6 +1,9 @@ #include "MEDMEM_Mesh.hxx" #include "MEDMEM_CellModel.hxx" +using namespace MEDMEM ; +using namespace MED_EN ; + int main (int argc, char ** argv) { const string MedFile = "pointe.med" ; diff --git a/doc/MEDMEM/MESHcoordinates.cxx b/doc/MEDMEM/MESHcoordinates.cxx index 18edd0328..e52eaaa00 100644 --- a/doc/MEDMEM/MESHcoordinates.cxx +++ b/doc/MEDMEM/MESHcoordinates.cxx @@ -1,5 +1,8 @@ #include "MEDMEM_Mesh.hxx" +using namespace MEDMEM ; +using namespace MED_EN ; + int main (int argc, char ** argv) { const string MedFile = "pointe.med" ; diff --git a/idl/MED.idl b/idl/MED.idl index e67960245..ef537a275 100644 --- a/idl/MED.idl +++ b/idl/MED.idl @@ -933,7 +933,7 @@ Internal Corba method. // MED interface - interface MED { + interface MED : SALOME::GenericObj { /*! returns the number of meshes in the %MED object. */ diff --git a/resources/Darcy3_3D_H_10x10x10_2.med b/resources/Darcy3_3D_H_10x10x10_2.med new file mode 100644 index 000000000..291531702 Binary files /dev/null and b/resources/Darcy3_3D_H_10x10x10_2.med differ diff --git a/resources/elle_3D_HPr_10x10x10_2.med b/resources/elle_3D_HPr_10x10x10_2.med new file mode 100644 index 000000000..fe4b21bc9 Binary files /dev/null and b/resources/elle_3D_HPr_10x10x10_2.med differ diff --git a/resources/elle_3D_HPr_2x2x2_2.med b/resources/elle_3D_HPr_2x2x2_2.med new file mode 100644 index 000000000..7ddd0228c Binary files /dev/null and b/resources/elle_3D_HPr_2x2x2_2.med differ diff --git a/resources/elle_3D_HPr_4x4x4_2.med b/resources/elle_3D_HPr_4x4x4_2.med new file mode 100644 index 000000000..690d3ee5c Binary files /dev/null and b/resources/elle_3D_HPr_4x4x4_2.med differ diff --git a/src/MED/Med_Gen_test.py b/src/MED/Med_Gen_test.py index be61f17d8..750ab9a68 100644 --- a/src/MED/Med_Gen_test.py +++ b/src/MED/Med_Gen_test.py @@ -40,35 +40,35 @@ def getMedObjectFromStudy(file): listOfSO = salome.myStudy.FindObjectByName(objNameInStudy,compNameInStudy) listLength = len(listOfSO) if (listLength == 0) : - print "PROBLEME ",objNameInStudy," cannot be found in the Study under the component ",compNameInStudy + print objNameInStudy," cannot be found in the Study under the component ",compNameInStudy return None elif (listLength > 1) : - print "PROBLEME there are more than one instance of ",objNameInStudy," in the Study under the component ",compNameInStudy + print "there are more than one instance of ",objNameInStudy," in the Study under the component ",compNameInStudy return None mySO = listOfSO[0] if (mySO == None) : - print "PROBLEM ",objNameInStudy," cannot be found in the Study" + print objNameInStudy," cannot be found in the Study" return mySO else: anAttr = mySO.FindAttribute("AttributeIOR")[1] obj = salome.orb.string_to_object(anAttr.Value()) myObj = obj._narrow(SALOME_MED.MED) if (myObj == None) : - print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type" + print objNameInStudy," has been found in the Study but with the wrong type" return myObj def getMeshObjectFromStudy(meshName): objNameInStudy = "/Med/MEDMESH/"+meshName mySO = salome.myStudy.FindObjectByPath(objNameInStudy) if (mySO == None) : - print "PROBLEM ",objNameInStudy," cannot be found in the Study" + print objNameInStudy," cannot be found in the Study" return mySO else: anAttr = mySO.FindAttribute("AttributeIOR")[1] obj = salome.orb.string_to_object(anAttr.Value()) myObj = obj._narrow(SALOME_MED.MESH) if (myObj == None) : - print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type" + print objNameInStudy," has been found in the Study but with the wrong type" return myObj def getSupportObjectFromStudy(meshName,supportName): @@ -76,14 +76,14 @@ def getSupportObjectFromStudy(meshName,supportName): objNameInStudy = "/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy+"/"+supportName mySO = salome.myStudy.FindObjectByPath(objNameInStudy) if (mySO == None) : - print "PROBLEM ",objNameInStudy," cannot be found in the Study" + print objNameInStudy," cannot be found in the Study" return mySO else: anAttr = mySO.FindAttribute("AttributeIOR")[1] obj = salome.orb.string_to_object(anAttr.Value()) myObj = obj._narrow(SALOME_MED.SUPPORT) if (myObj == None) : - print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type" + print objNameInStudy," has been found in the Study but with the wrong type" return myObj def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName): @@ -91,7 +91,7 @@ def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName): objNameInStudy = "/Med/MEDFIELD/"+fieldName+"/("+str(dt)+","+str(it)+")_ON_"+supportName+"_OF_"+meshNameStudy mySO = salome.myStudy.FindObjectByPath(objNameInStudy) if (mySO == None) : - print "PROBLEM ",objNameInStudy," cannot be found in the Study" + print objNameInStudy," cannot be found in the Study" return mySO else: anAttr = mySO.FindAttribute("AttributeIOR")[1] @@ -100,7 +100,7 @@ def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName): if (myObj == None): myObj = obj._narrow(SALOME_MED.FIELDDOUBLE) if (myObj == None) : - print "PROBLEM ",objNameInStudy," has been found in the Study but with the wrong type" + print objNameInStudy," has been found in the Study but with the wrong type" return myObj fileName = "cube_hexa8_quad4.med" diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver21.cxx b/src/MEDMEM/MEDMEM_MedMeshDriver21.cxx index 4c1924843..0e91bf2ef 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver21.cxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver21.cxx @@ -175,10 +175,13 @@ void MED_MESH_RDONLY_DRIVER21::read(void) buildAllGroups(_ptrMesh->_groupNode,_ptrMesh->_familyNode) ; // on cell buildAllGroups(_ptrMesh->_groupCell,_ptrMesh->_familyCell) ; - // on face - buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ; - // on edge - buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ; + + if (_ptrMesh->_meshDimension == 3) + // on face + buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ; + else if (_ptrMesh->_meshDimension == 2) + // on edge + buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ; // MESSAGE(LOC<<"Checking of CellModel !!!!!!!"); diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx index 6088176a1..2ba0c1b20 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx @@ -176,10 +176,13 @@ void MED_MESH_RDONLY_DRIVER22::read(void) buildAllGroups(_ptrMesh->_groupNode,_ptrMesh->_familyNode) ; // on cell buildAllGroups(_ptrMesh->_groupCell,_ptrMesh->_familyCell) ; - // on face - buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ; - // on edge - buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ; + + if (_ptrMesh->_meshDimension == 3) + // on face + buildAllGroups(_ptrMesh->_groupFace,_ptrMesh->_familyFace) ; + else if (_ptrMesh->_meshDimension == 2) + // on edge + buildAllGroups(_ptrMesh->_groupEdge,_ptrMesh->_familyEdge) ; // MESSAGE(LOC<<"Checking of CellModel !!!!!!!"); diff --git a/src/MEDMEM/duplicateMED.cxx b/src/MEDMEM/duplicateMED.cxx index 9e0f28ec3..31af1a789 100644 --- a/src/MEDMEM/duplicateMED.cxx +++ b/src/MEDMEM/duplicateMED.cxx @@ -3,10 +3,6 @@ #include "MEDMEM_Exception.hxx" #include "MEDMEM_Med.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; void usage(char * name) @@ -17,10 +13,6 @@ void usage(char * name) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - if (argc != 3) usage(argv[0]); string filenameIN = argv[1] ; diff --git a/src/MEDMEM/duplicateMEDMESH.cxx b/src/MEDMEM/duplicateMEDMESH.cxx index 6257bc523..87e705fe7 100644 --- a/src/MEDMEM/duplicateMEDMESH.cxx +++ b/src/MEDMEM/duplicateMEDMESH.cxx @@ -13,17 +13,9 @@ #include "MEDMEM_MedMedDriver.hxx" #include "MEDMEM_MedMeshDriver.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string filenameIN = argv[1] ; string filenameOUT = argv[2] ; diff --git a/src/MEDMEM/med2vtk.cxx b/src/MEDMEM/med2vtk.cxx index 57d87ec5f..4f27d17f1 100644 --- a/src/MEDMEM/med2vtk.cxx +++ b/src/MEDMEM/med2vtk.cxx @@ -11,10 +11,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_VtkMedDriver.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; void usage(char * name) @@ -25,10 +21,6 @@ void usage(char * name) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - if (argc != 3) usage(argv[0]); string filenameIN = argv[1] ; diff --git a/src/MEDMEM/med_test.cxx b/src/MEDMEM/med_test.cxx index 0c35fe95f..ef03111c7 100644 --- a/src/MEDMEM/med_test.cxx +++ b/src/MEDMEM/med_test.cxx @@ -14,10 +14,6 @@ #include "MEDMEM_MedFieldDriver.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -85,10 +81,6 @@ void affiche_groupe(MESH *myMesh,medEntityMesh Entity) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int read; if ((argc !=3) && (argc != 4)) { diff --git a/src/MEDMEM/test_MEDMEM_Array.cxx b/src/MEDMEM/test_MEDMEM_Array.cxx index 8117c696f..6b03fa969 100644 --- a/src/MEDMEM/test_MEDMEM_Array.cxx +++ b/src/MEDMEM/test_MEDMEM_Array.cxx @@ -1,18 +1,10 @@ #include "utilities.h" #include "MEDMEM_Array.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int SpaceDimension = 3 ; int NumberOfNodes = 4 ; MEDARRAY * myArray = new MEDARRAY(SpaceDimension,NumberOfNodes,MED_EN::MED_FULL_INTERLACE) ; diff --git a/src/MEDMEM/test_MEDMEM_CellModel.cxx b/src/MEDMEM/test_MEDMEM_CellModel.cxx index a760d0c07..304506283 100644 --- a/src/MEDMEM/test_MEDMEM_CellModel.cxx +++ b/src/MEDMEM/test_MEDMEM_CellModel.cxx @@ -2,19 +2,11 @@ #include "MEDMEM_CellModel.hxx" #include "MEDMEM_DriversDef.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - list geomList = meshEntities[MED_CELL] ; list::iterator itGeomList ; for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) { diff --git a/src/MEDMEM/test_MEDMEM_Meshing.cxx b/src/MEDMEM/test_MEDMEM_Meshing.cxx index b1ccc387e..5326e8723 100644 --- a/src/MEDMEM/test_MEDMEM_Meshing.cxx +++ b/src/MEDMEM/test_MEDMEM_Meshing.cxx @@ -2,10 +2,6 @@ #include "MEDMEM_Group.hxx" #include "MEDMEM_Field.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -20,10 +16,6 @@ int main (int argc, char ** argv) { exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - // filename to save the generated MESH string filenameRoot = argv[1] ; diff --git a/src/MEDMEM/test_MEDMEM_MeshingPoly.cxx b/src/MEDMEM/test_MEDMEM_MeshingPoly.cxx index 408f741c5..f10b09088 100644 --- a/src/MEDMEM/test_MEDMEM_MeshingPoly.cxx +++ b/src/MEDMEM/test_MEDMEM_MeshingPoly.cxx @@ -1,14 +1,11 @@ #include "MEDMEM_Meshing.hxx" #include "MEDMEM_Field.hxx" -#include "LocalTraceCollector.hxx" using namespace std; using namespace MEDMEM; using namespace MED_EN; int main (int argc, char ** argv) { - LocalTraceCollector::instance(); - double Coordinates[57] = { 2.0, 3.0, 2.0, 3.0, 2.0, 2.0, diff --git a/src/MEDMEM/test_MEDMEM_ModulusArray.cxx b/src/MEDMEM/test_MEDMEM_ModulusArray.cxx index dff337530..e9022a381 100644 --- a/src/MEDMEM/test_MEDMEM_ModulusArray.cxx +++ b/src/MEDMEM/test_MEDMEM_ModulusArray.cxx @@ -2,18 +2,10 @@ #include "MEDMEM_ModulusArray.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - using namespace std ; int array[5]={0,1,2,1,4} ; diff --git a/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx b/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx index c1c324320..a1406f535 100644 --- a/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx +++ b/src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx @@ -2,20 +2,12 @@ #include "MEDMEM_Connectivity.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; int main(void) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - CONNECTIVITY myNodalConnectivity; CONNECTIVITY myDescendingConnectivity; diff --git a/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshRead.cxx b/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshRead.cxx index be1886b86..fb10dcb9e 100644 --- a/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshRead.cxx +++ b/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshRead.cxx @@ -4,10 +4,6 @@ #include "MEDMEM_Mesh.hxx" #include "MEDMEM_MedMeshDriver.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; @@ -21,10 +17,6 @@ int main (int argc, char ** argv) exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string filename = argv[1]; string meshname = argv[2]; diff --git a/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshWrite.cxx b/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshWrite.cxx index 7f3a74d94..4433f10a4 100644 --- a/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshWrite.cxx +++ b/src/MEDMEM/test_MEDMEM_PolyDriverMedMeshWrite.cxx @@ -4,10 +4,6 @@ #include "MEDMEM_Mesh.hxx" #include "MEDMEM_MedMeshDriver.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; @@ -21,10 +17,6 @@ int main (int argc, char ** argv) exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string filename = argv[1]; string meshname = argv[2]; diff --git a/src/MEDMEM/test_MEDMEM_PolyhedronArray.cxx b/src/MEDMEM/test_MEDMEM_PolyhedronArray.cxx index 83b6239b3..020dd54aa 100644 --- a/src/MEDMEM/test_MEDMEM_PolyhedronArray.cxx +++ b/src/MEDMEM/test_MEDMEM_PolyhedronArray.cxx @@ -2,20 +2,12 @@ #include "MEDMEM_PolyhedronArray.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; int main(void) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - POLYHEDRONARRAY myPArray(2,11,40); med_int polyhedronindex[2] = {1,7}; med_int facesindex[11] = {1,5,9,13,17,21,25,28,31,34,37}; diff --git a/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx b/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx index ed13f443d..7aa4953ba 100644 --- a/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx +++ b/src/MEDMEM/test_MEDMEM_SkyLineArray.cxx @@ -1,18 +1,10 @@ #include "utilities.h" #include "MEDMEM_SkyLineArray.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle int Size = 10 ; // 10 nodes diff --git a/src/MEDMEM/test_MEDMEM_poly3D.cxx b/src/MEDMEM/test_MEDMEM_poly3D.cxx index 7e134ee51..24725cdcd 100755 --- a/src/MEDMEM/test_MEDMEM_poly3D.cxx +++ b/src/MEDMEM/test_MEDMEM_poly3D.cxx @@ -7,7 +7,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_ModulusArray.hxx" #include "MEDMEM_MedMeshDriver.hxx" -#include "LocalTraceCollector.hxx" #include #define MESHNAME "poly3D" @@ -83,7 +82,6 @@ bool SupportTester::areEquivalent(const int *nodes1, const int *nodes2, int nbOf int main (int argc, char ** argv) { - LocalTraceCollector::instance(); if (argc<2) // after 2, ignored ! { cerr << "Usage : " << argv[0] << " poly3D.med typically in ../../share/salome/resources" << endl << endl; diff --git a/src/MEDMEM/test_affect_medarray.cxx b/src/MEDMEM/test_affect_medarray.cxx index 4ae426236..cebf8ff55 100644 --- a/src/MEDMEM/test_affect_medarray.cxx +++ b/src/MEDMEM/test_affect_medarray.cxx @@ -17,10 +17,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -82,10 +78,6 @@ void affiche_medarray(MEDARRAY & myMedArray) int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - /* if ((argc !=3) && (argc != 4)) { cerr << "Usage : " << argv[0] diff --git a/src/MEDMEM/test_copie_connectivity.cxx b/src/MEDMEM/test_copie_connectivity.cxx index 87e07fb72..1b05189b8 100644 --- a/src/MEDMEM/test_copie_connectivity.cxx +++ b/src/MEDMEM/test_copie_connectivity.cxx @@ -17,10 +17,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -129,10 +125,6 @@ int main (int argc, char ** argv) { exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string filename = argv[1] ; string meshname = argv[2] ; diff --git a/src/MEDMEM/test_copie_coordinate.cxx b/src/MEDMEM/test_copie_coordinate.cxx index 72d41e69f..5bf79c979 100644 --- a/src/MEDMEM/test_copie_coordinate.cxx +++ b/src/MEDMEM/test_copie_coordinate.cxx @@ -17,10 +17,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -61,10 +57,6 @@ void affiche_coordinate(COORDINATE & myCoordinate, int _numberofNodes, int _spac int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - /* if ((argc !=3) && (argc != 4)) { cerr << "Usage : " << argv[0] diff --git a/src/MEDMEM/test_copie_family.cxx b/src/MEDMEM/test_copie_family.cxx index e09d36eee..9b7b55965 100644 --- a/src/MEDMEM/test_copie_family.cxx +++ b/src/MEDMEM/test_copie_family.cxx @@ -14,10 +14,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -74,10 +70,6 @@ void affiche_groupe(MESH *myMesh,medEntityMesh Entity) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int read; if (argc <3) { // after 3, ignored ! diff --git a/src/MEDMEM/test_copie_fieldT.cxx b/src/MEDMEM/test_copie_fieldT.cxx index f25e4cd8c..b6f6b8255 100644 --- a/src/MEDMEM/test_copie_fieldT.cxx +++ b/src/MEDMEM/test_copie_fieldT.cxx @@ -17,10 +17,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -64,10 +60,6 @@ void affiche_fieldT(FIELD * myField, const SUPPORT * mySupport) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - // int read; !! UNUSED VARIABLE !! if ((argc !=3) && (argc != 4)) { diff --git a/src/MEDMEM/test_copie_field_.cxx b/src/MEDMEM/test_copie_field_.cxx index 1be674414..da73f5657 100644 --- a/src/MEDMEM/test_copie_field_.cxx +++ b/src/MEDMEM/test_copie_field_.cxx @@ -17,10 +17,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace MEDMEM; using namespace MED_EN; @@ -58,10 +54,6 @@ void affiche_field(FIELD_ * myField, const SUPPORT * mySupport) int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - // int read; !! UNUSED VARIABLE !! if ((argc !=3) && (argc != 4)) { diff --git a/src/MEDMEM/test_copie_group.cxx b/src/MEDMEM/test_copie_group.cxx index a2bc356cf..58cac0c5b 100644 --- a/src/MEDMEM/test_copie_group.cxx +++ b/src/MEDMEM/test_copie_group.cxx @@ -14,10 +14,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -69,10 +65,6 @@ void affiche_groupe(const GROUP * myGroup) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int read; if (argc <3) { // after 3, ignored ! diff --git a/src/MEDMEM/test_copie_medarray.cxx b/src/MEDMEM/test_copie_medarray.cxx index 9cfd93c88..e1eac4846 100644 --- a/src/MEDMEM/test_copie_medarray.cxx +++ b/src/MEDMEM/test_copie_medarray.cxx @@ -17,10 +17,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -82,10 +78,6 @@ void affiche_medarray(MEDARRAY & myMedArray) int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - /* if ((argc !=3) && (argc != 4)) { cerr << "Usage : " << argv[0] diff --git a/src/MEDMEM/test_copie_mesh.cxx b/src/MEDMEM/test_copie_mesh.cxx index d24215b5f..9e5098b6c 100644 --- a/src/MEDMEM/test_copie_mesh.cxx +++ b/src/MEDMEM/test_copie_mesh.cxx @@ -14,18 +14,10 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int read; if (argc <3) { // after 3, ignored ! diff --git a/src/MEDMEM/test_copie_support.cxx b/src/MEDMEM/test_copie_support.cxx index f4ad559bd..43b98d6fa 100644 --- a/src/MEDMEM/test_copie_support.cxx +++ b/src/MEDMEM/test_copie_support.cxx @@ -14,10 +14,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -79,10 +75,6 @@ void affiche_groupe(MESH *myMesh,medEntityMesh Entity) } int main (int argc, char ** argv) { -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - int read; if (argc <3) { // after 3, ignored ! diff --git a/src/MEDMEM/test_gibi_driver.cxx b/src/MEDMEM/test_gibi_driver.cxx index 6d877695c..b2a1ed9df 100644 --- a/src/MEDMEM/test_gibi_driver.cxx +++ b/src/MEDMEM/test_gibi_driver.cxx @@ -1,10 +1,6 @@ #include "MEDMEM_GibiMeshDriver.hxx" #include "MEDMEM_Mesh.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; int main (int argc, char ** argv) @@ -18,10 +14,6 @@ int main (int argc, char ** argv) exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string gibifilename = argv[1]; // Construction des noms de fichier diff --git a/src/MEDMEM/test_grid.cxx b/src/MEDMEM/test_grid.cxx index 3a33db75c..4825b9acb 100644 --- a/src/MEDMEM/test_grid.cxx +++ b/src/MEDMEM/test_grid.cxx @@ -1,9 +1,5 @@ #include "MEDMEM_Grid.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace MEDMEM; using namespace MED_EN; @@ -21,10 +17,6 @@ int main (int argc, char ** argv) { if (argc != 3) usage(argv[0]); -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - const int SpaceDimension=atoi(argv[1]); const int nbMaille=atoi(argv[2]); if(SpaceDimension>3 || SpaceDimension<1 || nbMaille<1) diff --git a/src/MEDMEM/test_operation_fielddouble.cxx b/src/MEDMEM/test_operation_fielddouble.cxx index 312066689..18737e79e 100644 --- a/src/MEDMEM/test_operation_fielddouble.cxx +++ b/src/MEDMEM/test_operation_fielddouble.cxx @@ -16,10 +16,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - double myfunction1(double x) { return 0.25*(x-1.0); @@ -195,10 +191,6 @@ int main (int argc, char ** argv) exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string filename = argv[verbose+1]; string meshname = argv[verbose+2]; string fieldname = argv[verbose+3]; diff --git a/src/MEDMEM/test_operation_fieldint.cxx b/src/MEDMEM/test_operation_fieldint.cxx index 59b1a6335..334f9f811 100644 --- a/src/MEDMEM/test_operation_fieldint.cxx +++ b/src/MEDMEM/test_operation_fieldint.cxx @@ -16,10 +16,6 @@ #include "MEDMEM_Field.hxx" #include "MEDMEM_define.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace MEDMEM; using namespace MED_EN; @@ -106,10 +102,6 @@ int main (int argc, char ** argv) exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string filename = argv[1] ; string meshname = argv[2] ; string fieldname = argv[3]; diff --git a/src/MEDMEM/test_porflow_driver.cxx b/src/MEDMEM/test_porflow_driver.cxx index 6371c6aee..a56d604d7 100644 --- a/src/MEDMEM/test_porflow_driver.cxx +++ b/src/MEDMEM/test_porflow_driver.cxx @@ -1,10 +1,6 @@ #include "MEDMEM_PorflowMeshDriver.hxx" #include "MEDMEM_Mesh.hxx" -#ifdef _DEBUG_ -#include "LocalTraceCollector.hxx" -#endif /* ifdef _DEBUG_*/ - using namespace std; using namespace MEDMEM; using namespace MED_EN; @@ -20,10 +16,6 @@ int main (int argc, char ** argv) exit(-1); } -#ifdef _DEBUG_ - LocalTraceCollector::instance(); -#endif /* ifdef _DEBUG_*/ - string porflowfilename = argv[1]; // Construction des noms de fichier diff --git a/src/MEDMEM_I/MEDMEM_Field_i.cxx b/src/MEDMEM_I/MEDMEM_Field_i.cxx index 556e72bd1..71fb67476 100644 --- a/src/MEDMEM_I/MEDMEM_Field_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Field_i.cxx @@ -545,6 +545,10 @@ void FIELD_i::addInStudy(SALOMEDS::Study_ptr myStudy, delete [] supportEntryPath; delete [] fieldEntryName; + // register the Corba pointer: increase the referrence count + MESSAGE("Registering of the Corba Field pointer"); + Register(); + MESSAGE("FIELD_i::addInStudy"); //END_OF("FIELD_i::addInStudy"); diff --git a/src/MEDMEM_I/MEDMEM_Med_i.cxx b/src/MEDMEM_I/MEDMEM_Med_i.cxx index 896917c0b..3ae43045f 100644 --- a/src/MEDMEM_I/MEDMEM_Med_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Med_i.cxx @@ -1177,6 +1177,10 @@ throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) _medId = newObj->GetID(); myBuilder->CommitCommand(); + // register the Corba pointer: increase the referrence count + MESSAGE("Registering of the Corba Med pointer"); + Register(); + END_OF("Med_i::addInStudy(SALOMEDS::Study_ptr myStudy)"); } @@ -1260,6 +1264,9 @@ void MED_i::addInStudy(SALOMEDS::Study_ptr myStudy, SALOME_MED::MED_ptr myIor, // delete [] medObjName1; + // register the Corba pointer: increase the referrence count + MESSAGE("Registering of the Corba Med pointer"); + Register(); + END_OF("Med_i::addInStudy(myStudy, myIor, medObjName)"); } - diff --git a/src/MEDMEM_I/MEDMEM_Med_i.hxx b/src/MEDMEM_I/MEDMEM_Med_i.hxx index 0dbeb12de..cfc71c664 100644 --- a/src/MEDMEM_I/MEDMEM_Med_i.hxx +++ b/src/MEDMEM_I/MEDMEM_Med_i.hxx @@ -13,6 +13,7 @@ #include +#include "SALOME_GenericObj_i.hh" #include CORBA_SERVER_HEADER(MED) #include CORBA_SERVER_HEADER(SALOMEDS) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) @@ -22,7 +23,8 @@ namespace MEDMEM { typedef map MAP_IOR_DT_IT_; -class MED_i: public POA_SALOME_MED::MED +class MED_i: public POA_SALOME_MED::MED, + public SALOME::GenericObj_i { private : diff --git a/src/MEDMEM_I/MEDMEM_Mesh_i.cxx b/src/MEDMEM_I/MEDMEM_Mesh_i.cxx index bd1115b23..a25961b33 100644 --- a/src/MEDMEM_I/MEDMEM_Mesh_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Mesh_i.cxx @@ -1354,6 +1354,10 @@ throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) _meshId = newObj->GetID(); myBuilder->CommitCommand(); + // register the Corba pointer: increase the referrence count + MESSAGE("Registering of the Corba Mesh pointer"); + Register(); + END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)"); } //============================================================================= @@ -1416,6 +1420,10 @@ throw (SALOME::SALOME_Exception,SALOMEDS::StudyBuilder::LockProtection) _meshId = newObj->GetID(); myBuilder->CommitCommand(); + // register the Corba pointer: increase the referrence count + MESSAGE("Registering of the Corba Mesh pointer"); + Register(); + END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)"); } //============================================================================= diff --git a/src/MEDMEM_I/MEDMEM_Support_i.cxx b/src/MEDMEM_I/MEDMEM_Support_i.cxx index a8e302c29..64ea4a7b6 100644 --- a/src/MEDMEM_I/MEDMEM_Support_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Support_i.cxx @@ -433,7 +433,7 @@ throw (SALOME::SALOME_Exception) SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; try { - MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS"); + MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS"); int nbelements=_support->getNumberOfElements(::MED_ALL_ELEMENTS); myseq->length(nbelements); const int * numbers=_support->getNumberIndex(); @@ -465,7 +465,7 @@ SALOME::SenderInt_ptr SUPPORT_i::getSenderForNumberIndex() SALOME::SenderInt_ptr ret; try { - MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS"); + MESSAGE ("Nombre d'elements mis de façon stupide a MED_ALL_ELEMENTS"); int nbelements=_support->getNumberOfElements(::MED_ALL_ELEMENTS); const int * numbers=_support->getNumberIndex(); ret=SenderFactory::buildSender(*this,numbers,nbelements); @@ -709,6 +709,9 @@ void SUPPORT_i::addInStudy (SALOMEDS::Study_ptr myStudy, SALOME_MED::SUPPORT_ptr delete [] medsupfatherName; delete [] supportEntryPath; + // register the Corba pointer: increase the referrence count + MESSAGE("Registering of the Corba Support pointer"); + Register(); + END_OF(LOC); } - diff --git a/src/MEDMEM_SWIG/testMedMemGeneral.py b/src/MEDMEM_SWIG/testMedMemGeneral.py index bf477ff86..e2c25505b 100755 --- a/src/MEDMEM_SWIG/testMedMemGeneral.py +++ b/src/MEDMEM_SWIG/testMedMemGeneral.py @@ -119,6 +119,18 @@ meshNameFiles.append("Mistrat_Hexa") ##files.append("TimeStamps.med") ##meshNameFiles.append("dom") +files.append("Darcy3_3D_H_10x10x10_2.med") +meshNameFiles.append("Darcy3_3D_H_10x10x10") + +files.append("elle_3D_HPr_10x10x10_2.med") +meshNameFiles.append("elle_3D_HPr_10x10x10") + +files.append("elle_3D_HPr_2x2x2_2.med") +meshNameFiles.append("elle_3D_HPr_2x2x2") + +files.append("elle_3D_HPr_4x4x4_2.med") +meshNameFiles.append("elle_3D_HPr_4x4x4") + # # Castem or Gibi file list # @@ -856,7 +868,7 @@ for i in range(nbOfFiles): print " Norme 2 : ", fieldint.norm2() print " Norme Max : ", fieldint.normMax() - if fielddouble.getSupport().getEntity()!=MED_NODE: + if fieldint.getSupport().getEntity()!=MED_NODE: fieldint_vol=fieldint.getSupport().getMesh().getVolume(fieldint.getSupport()) print " Norme L1 : ", fieldint.normL1() print " Norme L2 : ", fieldint.normL2() @@ -871,7 +883,7 @@ for i in range(nbOfFiles): print " Name:",compName print " Description:",compDesc print " Unit:",compUnit - if fielddouble.getSupport().getEntity()!=MED_NODE: + if fieldint.getSupport().getEntity()!=MED_NODE: print " Norme L1 : ", fieldint.normL1(kp1) print " Norme L2 : ", fieldint.normL2(kp1) print " Norme L2(vol) : ", fieldint.normL2(kp1,fieldint_vol) diff --git a/src/MedClient/src/FIELDClient.cxx b/src/MedClient/src/FIELDClient.cxx index a082b0741..617a22d11 100644 --- a/src/MedClient/src/FIELDClient.cxx +++ b/src/MedClient/src/FIELDClient.cxx @@ -2,7 +2,11 @@ template FIELDClient::FIELDClient(typename MapCppFieldServ::FieldPtrType ptrCorba,MEDMEM::SUPPORT * S):_fieldPtr(MapCppFieldServ::FieldGlobalType::_duplicate(ptrCorba)),_refCounter(1) { if (!S) - MEDMEM::FIELD::_support=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport()); + { + SCRUTE(_fieldPtr); + SCRUTE(_fieldPtr->getSupport()); + MEDMEM::FIELD::_support=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport()); + } else MEDMEM::FIELD::setSupport(S); diff --git a/src/MedClient/src/Makefile.in b/src/MedClient/src/Makefile.in index 0c567262d..4bf19794f 100644 --- a/src/MedClient/src/Makefile.in +++ b/src/MedClient/src/Makefile.in @@ -61,7 +61,8 @@ else SWIG_DEF = libMEDClient.i endif -EXPORT_PYSCRIPTS = libMEDClient.py +EXPORT_PYSCRIPTS = libMEDClient.py \ + medClient_test.py # Libraries targets diff --git a/src/MedClient/src/libMEDClient.i b/src/MedClient/src/libMEDClient.i index 8be804bcf..da8a5f756 100644 --- a/src/MedClient/src/libMEDClient.i +++ b/src/MedClient/src/libMEDClient.i @@ -16,6 +16,11 @@ %include "libMedCorba_Swig.i" %include "libMEDMEM_Swig.i" +%typecheck(SWIG_TYPECHECK_POINTER) SALOME_MED::FIELDDOUBLE_ptr, SALOME_MED::FIELDINT_ptr +{ + $1 = ($input != 0); +} + class MESHClient : public MESH { public: diff --git a/src/MedClient/src/medClient_test.py b/src/MedClient/src/medClient_test.py new file mode 100644 index 000000000..719fed5ee --- /dev/null +++ b/src/MedClient/src/medClient_test.py @@ -0,0 +1,295 @@ +#################################################################################################### +# +# Test the MedClient classes: mounting in Memory a .med file and using this file as a client of +# the MED component we try +# +#################################################################################################### +from libMEDClient import * + +import string + +import salome + +import SALOME_MED + +from libSALOME_Swig import * +sg = SALOMEGUI_Swig() + +def print_ord(i): + if i == 0: + return 'first' + elif i == 1: + return 'second' + elif i == 2: + return 'third' + else: + return `(i+1)`+'th' + +def changeBlankToUnderScore(stringWithBlank): + blank = ' ' + underscore = '_' + decompString = string.split(stringWithBlank,blank) + length = len(decompString) + stringWithUnderScore = decompString[0] + for i in range(1,length): + stringWithUnderScore += underscore + stringWithUnderScore += decompString[i] + return stringWithUnderScore + +def getMedObjectFromStudy(file): + objNameInStudy = "MED_OBJECT_FROM_FILE_"+file + compNameInStudy= "MED" + listOfSO = salome.myStudy.FindObjectByName(objNameInStudy,compNameInStudy) + listLength = len(listOfSO) + if (listLength == 0) : + print objNameInStudy," cannot be found in the Study under the component ",compNameInStudy + return None + elif (listLength > 1) : + print "there are more than one instance of ",objNameInStudy," in the Study under the component ",compNameInStudy + return None + mySO = listOfSO[0] + if (mySO == None) : + print objNameInStudy," cannot be found in the Study" + return mySO + else: + anAttr = mySO.FindAttribute("AttributeIOR")[1] + obj = salome.orb.string_to_object(anAttr.Value()) + myObj = obj._narrow(SALOME_MED.MED) + if (myObj == None) : + print objNameInStudy," has been found in the Study but with the wrong type" + return myObj + +def getMeshObjectFromStudy(meshName): + objNameInStudy = "/Med/MEDMESH/"+meshName + mySO = salome.myStudy.FindObjectByPath(objNameInStudy) + if (mySO == None) : + print objNameInStudy," cannot be found in the Study" + return mySO + else: + anAttr = mySO.FindAttribute("AttributeIOR")[1] + obj = salome.orb.string_to_object(anAttr.Value()) + myObj = obj._narrow(SALOME_MED.MESH) + if (myObj == None) : + print objNameInStudy," has been found in the Study but with the wrong type" + return myObj + +def getSupportObjectFromStudy(meshName,supportName): + meshNameStudy = changeBlankToUnderScore(meshName) + objNameInStudy = "/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy+"/"+supportName + mySO = salome.myStudy.FindObjectByPath(objNameInStudy) + if (mySO == None) : + print objNameInStudy," cannot be found in the Study" + return mySO + else: + anAttr = mySO.FindAttribute("AttributeIOR")[1] + obj = salome.orb.string_to_object(anAttr.Value()) + myObj = obj._narrow(SALOME_MED.SUPPORT) + if (myObj == None) : + print objNameInStudy," has been found in the Study but with the wrong type" + return myObj + +def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName): + type = -1 + meshNameStudy = changeBlankToUnderScore(meshName) + objNameInStudy = "/Med/MEDFIELD/"+fieldName+"/("+str(dt)+","+str(it)+")_ON_"+supportName+"_OF_"+meshNameStudy + mySO = salome.myStudy.FindObjectByPath(objNameInStudy) + if (mySO == None) : + print objNameInStudy," cannot be found in the Study" + return -1,-1 + else: + anAttr = mySO.FindAttribute("AttributeIOR")[1] + obj = salome.orb.string_to_object(anAttr.Value()) + myObj = obj._narrow(SALOME_MED.FIELDINT) + type = 0 + if (myObj == None): + myObj = obj._narrow(SALOME_MED.FIELDDOUBLE) + type = 1 + if (myObj == None) : + print objNameInStudy," has been found in the Study but with the wrong type" + return myObj,type + +fileName = "cube_hexa8_quad4.med" + +#fileName = "carre_en_quad4_seg2.med" + +medComp=salome.lcc.FindOrLoadComponent("FactoryServer", "MED") + +import os + +filePath=os.environ["MED_ROOT_DIR"] +filePath=filePath+"/share/salome/resources/" + +filePathName = filePath + fileName + +print "Reading the .med file ",filePathName," and pushing corba objects in the SALOME study" +medComp.readStructFileWithFieldType(filePathName,salome.myStudyName) +sg.updateObjBrowser(1) + +print "getting the MED object from the study" +medObj = getMedObjectFromStudy(fileName) + +nbOfMeshes = medObj.getNumberOfMeshes() +meshNames = medObj.getMeshNames() + +print "in this med file there is(are) ",nbOfMeshes," mesh(es):" +for i in range(nbOfMeshes): + meshName = meshNames[i] + print " - the ",print_ord(i)," mesh is named ",meshName + print " getting the distant MESH object using the API of the corba object MED" + meshObj = medObj.getMeshByName(meshName) + + + + print " getting mesh information using the API of the corba object MESH but corba objects are obtained from the Study" + for entity in [SALOME_MED.MED_NODE,SALOME_MED.MED_CELL, + SALOME_MED.MED_FACE,SALOME_MED.MED_EDGE]: + nbFam = meshObj.getNumberOfFamilies(entity) + nbGrp = meshObj.getNumberOfGroups(entity) + if (entity == SALOME_MED.MED_NODE): + print " this mesh has ",nbFam," Node Family(ies) and ",nbGrp," Node Group(s)" + elif (entity == SALOME_MED.MED_CELL): + print " ",nbFam," Cell Family(ies) and ",nbGrp," Cell Group(s)" + elif (entity == SALOME_MED.MED_FACE): + print " ",nbFam," Face Family(ies) and ",nbGrp," Face Group(s)" + elif (entity == SALOME_MED.MED_EDGE): + print " ",nbFam," Edge Family(ies) and ",nbGrp," Cell Group(s)" + + if nbFam > 0: + for j in range(nbFam): + familyName = (meshObj.getFamily(entity,j+1)).getName() + familyObj = getSupportObjectFromStudy(meshName,familyName) + print familyObj + + if nbGrp > 0: + for j in range(nbGrp): + groupName = (meshObj.getGroup(entity,j+1)).getName() + groupObj = getSupportObjectFromStudy(meshName,groupName) + print groupObj + + print "let's get other SUPPORT object from the Study" + for entity in [SALOME_MED.MED_NODE,SALOME_MED.MED_CELL, + SALOME_MED.MED_FACE,SALOME_MED.MED_EDGE]: + + if entity == SALOME_MED.MED_NODE : + entitySupport = "MED_NOEUD" + elif entity == SALOME_MED.MED_CELL : + entitySupport = "MED_MAILLE" + elif entity == SALOME_MED.MED_FACE : + entitySuppor = "MED_FACE" + elif entity == SALOME_MED.MED_EDGE : + entitySupport = "MED_ARETE" + + supportName = "SupportOnAll_"+entitySupport + supportObj = getSupportObjectFromStudy(meshName,supportName) + + + + + + meshLocalCopy = MESHClient(meshObj) + print " getting information from the local copy of the distant mesh" + name = meshLocalCopy.getName() + spaceDimension = meshLocalCopy.getSpaceDimension() + meshDimension = meshLocalCopy.getMeshDimension() + numberOfNodes = meshLocalCopy.getNumberOfNodes() + print " Name = ", name, " space Dim = ", spaceDimension, " mesh Dim = ", meshDimension, " Nb of Nodes = ", numberOfNodes + coordSyst = meshLocalCopy.getCoordinatesSystem() + print " The coordinates system is",coordSyst + print " The Coordinates :" + coordNames = [] + coordUnits = [] + for isd in range(spaceDimension): + coordNames.append(meshLocalCopy.getCoordinateName(isd)) + coordUnits.append(meshLocalCopy.getCoordinateUnit(isd)) + + print " names:", coordNames + print " units", coordUnits + print " values:" + coordinates = meshLocalCopy.getCoordinates(MED_FULL_INTERLACE) + for k in range(numberOfNodes): + kp1 = k+1 + print " ---- ", coordinates[k*spaceDimension:(kp1*spaceDimension)] + print "" + print " The Cell Nodal Connectivity of the Cells:" + nbTypesCell = meshLocalCopy.getNumberOfTypes(MED_CELL) + print "" + if (nbTypesCell>0): + print " The Mesh has",nbTypesCell,"Type(s) of Cell" + types = meshLocalCopy.getTypes(MED_CELL) + for k in range(nbTypesCell): + type = types[k] + nbElemType = meshLocalCopy.getNumberOfElements(MED_CELL,type) + print " For the type:",type,"there is(are)",nbElemType,"elemnt(s)" + connectivity = meshLocalCopy.getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,type) + nbNodesPerCell = type%100 + for j in range(nbElemType): + print " Element",(j+1)," ",connectivity[j*nbNodesPerCell:(j+1)*nbNodesPerCell] + + +nbOfFields = medObj.getNumberOfFields() +print "in the considered .med file there is(are) ",nbOfFields," field(s):" +fieldNames = medObj.getFieldNames() +for i in range(nbOfFields): + fieldName = fieldNames[i] + nbOfIt = medObj.getFieldNumberOfIteration(fieldName) + print " - the ",print_ord(i)," field is name ",fieldName," and has ",nbOfIt," iteration(s)" + for j in range(nbOfIt): + dtitfield = medObj.getFieldIteration(fieldName,j) + dt = dtitfield[0] + it = dtitfield[1] + print " * Iteration:",dt,"Order number:",it + meshName = meshNames[0] + for entity in [SALOME_MED.MED_NODE,SALOME_MED.MED_CELL, + SALOME_MED.MED_FACE,SALOME_MED.MED_EDGE]: + if entity == SALOME_MED.MED_NODE : + entitySupport = "MED_NOEUD" + elif entity == SALOME_MED.MED_CELL : + entitySupport = "MED_MAILLE" + elif entity == SALOME_MED.MED_FACE : + entitySuppor = "MED_FACE" + elif entity == SALOME_MED.MED_EDGE : + entitySupport = "MED_ARETE" + supportName = "SupportOnAll_"+entitySupport + print " getting a corba object Field from the study iteration ",dt," order number ",it," on the support ",supportName," from the mesh ",meshName + fieldObj,type = getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName) + print fieldObj + + if ((fieldObj != None) and (fieldObj != -1)): + if(type == 1): + fieldTyped = FIELDDOUBLEClient(fieldObj) + elif (type == 0): + fieldTyped = FIELDINTClient(fieldObj) + + type = fieldTyped.getValueType() + print " * Iteration:",dt,"Order number:",it,"Type:",type + name = fieldTyped.getName() + desc = fieldTyped.getDescription() + nbOfComp = fieldTyped.getNumberOfComponents() + print " Field",name," : ",desc + print " Number Of Components:",nbOfComp + iterationNb = fieldTyped.getIterationNumber() + orderNb = fieldTyped.getOrderNumber() + time = fieldTyped.getTime() + print " Iteration Number",iterationNb + print " Order Number",orderNb + print " Time",time + support = fieldTyped.getSupport() + nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS) + print " Values:",nbOf + for k in range(nbOf): + valueI = fieldTyped.getValueI(MED_FULL_INTERLACE,k+1) + print " *",valueI[:nbOfComp] + + + + + + + + + + + + +print "" +print "END of the Pyhton script ..... Ctrl D to exit"