]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
updating the main trunk with the CEA debug devellopment from the branch
authornadir <nadir>
Mon, 26 Sep 2005 15:12:57 +0000 (15:12 +0000)
committernadir <nadir>
Mon, 26 Sep 2005 15:12:57 +0000 (15:12 +0000)
CEA_V3_0_x (tagged For_V3_0_3a2)

58 files changed:
Makefile.in
bin/VERSION
doc/MEDMEM/FIELDcreate.cxx
doc/MEDMEM/FIELDgeneral.cxx
doc/MEDMEM/MEDMEM_InvokingDriverAtObjectCreationTime.cxx
doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx
doc/MEDMEM/MEDMEM_InvokingDriverFromStandardObjectMethod.cxx
doc/MEDMEM/MESHINGexample.cxx
doc/MEDMEM/MESHconnectivities.cxx
doc/MEDMEM/MESHcoordinates.cxx
idl/MED.idl
resources/Darcy3_3D_H_10x10x10_2.med [new file with mode: 0644]
resources/elle_3D_HPr_10x10x10_2.med [new file with mode: 0644]
resources/elle_3D_HPr_2x2x2_2.med [new file with mode: 0644]
resources/elle_3D_HPr_4x4x4_2.med [new file with mode: 0644]
src/MED/Med_Gen_test.py
src/MEDMEM/MEDMEM_MedMeshDriver21.cxx
src/MEDMEM/MEDMEM_MedMeshDriver22.cxx
src/MEDMEM/duplicateMED.cxx
src/MEDMEM/duplicateMEDMESH.cxx
src/MEDMEM/med2vtk.cxx
src/MEDMEM/med_test.cxx
src/MEDMEM/test_MEDMEM_Array.cxx
src/MEDMEM/test_MEDMEM_CellModel.cxx
src/MEDMEM/test_MEDMEM_Meshing.cxx
src/MEDMEM/test_MEDMEM_MeshingPoly.cxx
src/MEDMEM/test_MEDMEM_ModulusArray.cxx
src/MEDMEM/test_MEDMEM_PolyConnectivity.cxx
src/MEDMEM/test_MEDMEM_PolyDriverMedMeshRead.cxx
src/MEDMEM/test_MEDMEM_PolyDriverMedMeshWrite.cxx
src/MEDMEM/test_MEDMEM_PolyhedronArray.cxx
src/MEDMEM/test_MEDMEM_SkyLineArray.cxx
src/MEDMEM/test_MEDMEM_poly3D.cxx
src/MEDMEM/test_affect_medarray.cxx
src/MEDMEM/test_copie_connectivity.cxx
src/MEDMEM/test_copie_coordinate.cxx
src/MEDMEM/test_copie_family.cxx
src/MEDMEM/test_copie_fieldT.cxx
src/MEDMEM/test_copie_field_.cxx
src/MEDMEM/test_copie_group.cxx
src/MEDMEM/test_copie_medarray.cxx
src/MEDMEM/test_copie_mesh.cxx
src/MEDMEM/test_copie_support.cxx
src/MEDMEM/test_gibi_driver.cxx
src/MEDMEM/test_grid.cxx
src/MEDMEM/test_operation_fielddouble.cxx
src/MEDMEM/test_operation_fieldint.cxx
src/MEDMEM/test_porflow_driver.cxx
src/MEDMEM_I/MEDMEM_Field_i.cxx
src/MEDMEM_I/MEDMEM_Med_i.cxx
src/MEDMEM_I/MEDMEM_Med_i.hxx
src/MEDMEM_I/MEDMEM_Mesh_i.cxx
src/MEDMEM_I/MEDMEM_Support_i.cxx
src/MEDMEM_SWIG/testMedMemGeneral.py
src/MedClient/src/FIELDClient.cxx
src/MedClient/src/Makefile.in
src/MedClient/src/libMEDClient.i
src/MedClient/src/medClient_test.py [new file with mode: 0644]

index ab72f27280f6734addf90d24e8ef6f28fb93155f..28493549ce1e34502408a6c2617042b446d8c0e4 100644 (file)
@@ -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 \
index e9a90323f5aa70bb3263fa7ef90d0b5f5f2fd9f2..851d79cab9d6f8cbd8f03e14918b081146e18f5e 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - MED VERSION: 3.0.2
+THIS IS SALOME - MED VERSION: 3.0.3
index e94b17b788150447eb4b8011b0ba7fdd55f94b0c..d8375e07308c55992cb53521b5f0442bbaa39eca 100644 (file)
@@ -3,6 +3,7 @@ using namespace std;
 #include "MEDMEM_Field.hxx"
 
 using namespace MEDMEM;
+using namespace MED_EN ;
 
 int main (int argc, char ** argv) {
 
index 120cef911c249d28546252317aec71a68898054e..18c0210376eacf2462e21a126ac03abe148b1037 100644 (file)
@@ -3,6 +3,7 @@ using namespace std;
 #include "MEDMEM_Field.hxx"
 
 using namespace MEDMEM;
+using namespace MED_EN ;
 
 int main (int argc, char ** argv) {
 
index fca94088d3595301b040b429c0eef3acb06bbea2..b7017228d5f29dd300c2629285f0234f1f883949 100644 (file)
@@ -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";
index b8c110ad29a2a85f9d136436b0451164cea55f9e..e90b6030a60d0e96dfc5ff6b4e10019a2216abd0 100644 (file)
@@ -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 () {
   
index 87ed743930442c4ac94a8a95db0b099c096912f7..270eacbc22ff31247d5d4db2a0bf6bc9e0eb81b3 100644 (file)
@@ -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";
index 2ec7a16ee350a74cfa8844b2b177645acc2ff638..07c943a02d5b5266ddd0ae92bc893ad29da6b28d 100644 (file)
@@ -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) {
index 2964ff9f8e6737a195bad7cdf1463637f9067c1b..6a0f40cfee550d00415f76cdb80330cd4f82803d 100644 (file)
@@ -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" ;
index 18edd03289c4fa37e5e98add7aedccfc6b3fceeb..e52eaaa0007b1f6b4fe65b682870bf6746810976 100644 (file)
@@ -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" ;
index e67960245474c84504120d8f87bc287b0c7e37ce..ef537a2759a3121ae6cbe5238ceb416d227890a9 100644 (file)
@@ -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 (file)
index 0000000..2915317
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 (file)
index 0000000..fe4b21b
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 (file)
index 0000000..7ddd022
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 (file)
index 0000000..690d3ee
Binary files /dev/null and b/resources/elle_3D_HPr_4x4x4_2.med differ
index be61f17d82c8f36c9dfd262080a3c436e3dbf036..750ab9a68abcefae6add8909d3990d336fa55683 100644 (file)
@@ -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"
index 4c1924843e10f1ad37296161ac5ca1cd9d7931da..0e91bf2ef13b4be01269cd126d10fc3350da552e 100644 (file)
@@ -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 !!!!!!!");
 
index 6088176a1664c27277b92b14543d956a8705fc6a..2ba0c1b20720c8470b76d13417f7bc73e34d9ec6 100644 (file)
@@ -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 !!!!!!!");
 
index 9e0f28ec35c101a5646a5a2637b2a86a21f704f4..31af1a7890c6853d9b4ccbb4ec3a6d598752f204 100644 (file)
@@ -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] ;
index 6257bc523881dc767e84a172aab60ede8ee0b0e1..87e705fe743d05d503ec223ccfe91036ccec2e3f 100644 (file)
 #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] ;
     
index 57d87ec5f3700c5b98dd280ff1a63cc89626fc52..4f27d17f1bc9c091d3e2fbd255cbc2535a8fd590 100644 (file)
 #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] ;
index 0c35fe95ff59ec98b5f6950c7c97f592c2d5344a..ef03111c7c9d43d85dc05d4a6f187f624f7bb92f 100644 (file)
 #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)) {
index 8117c696f815ad436f67cf0b651bfbba8885f7c0..6b03fa96972b7ebc123dbd76b54de16aaa796045 100644 (file)
@@ -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<int> * myArray = new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_EN::MED_FULL_INTERLACE) ;
index a760d0c0727b1c33dba5d03444f5e502c796ed12..304506283e6ab54d662d067f2a50a8935464dd59 100644 (file)
@@ -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<medGeometryElement> geomList = meshEntities[MED_CELL] ;
   list<medGeometryElement>::iterator itGeomList ;
   for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
index b1ccc387e10837e0d9f583c93ff293e6392b1ed4..5326e87239e2ee1c638713bd8663aca861efe5b4 100644 (file)
@@ -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] ;
 
index 408f741c5f5a8ca6da21244cd6ae72d7e56f6093..f10b09088873015ae8426218f669f4519cee9104 100644 (file)
@@ -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,
index dff3375303ad2f4b0fea9ce28d1f9de16e6200c8..e9022a381f7b763517b640a8893bb9a07ae2818c 100644 (file)
@@ -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} ;
index c1c3243206c7e71fec1ffd73ef64faae97c9da4c..a1406f535dd7dd978e987d9d783d0a4a86259dc7 100644 (file)
@@ -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;
 
index be1886b869c6651bb8924453520a7e6069a29e47..fb10dcb9ebf15c537675314f4bf8b5c7c7a21168 100644 (file)
@@ -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];
 
index 7f3a74d94393faea664217a02a20b42f4f57a8d5..4433f10a4bce9ebde303a6e514acf218ab562af5 100644 (file)
@@ -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];
 
index 83b6239b344ad5faf1a64749d88301f2fe3ee23a..020dd54aaafbbbe0953d71370b889c63532b4a6e 100644 (file)
@@ -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};
index ed13f443d50801f2ac93ab0dc1efeb6a07fe50ea..7aa4953bae3a801422ddce037bd772301f4fd861 100644 (file)
@@ -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
 
index 7e134ee5123a033cb9960ecfca4233c72331eb0c..24725cdcd9038532bcfa26dee48b6755c071fe13 100755 (executable)
@@ -7,7 +7,6 @@
 #include "MEDMEM_Field.hxx"
 #include "MEDMEM_ModulusArray.hxx"
 #include "MEDMEM_MedMeshDriver.hxx"
-#include "LocalTraceCollector.hxx"
 #include <vector>
 
 #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;
index 4ae4262367478a87b0e342d2c651734e1766e44d..cebf8ff55ffd8624cd8db10480a63e0fa73b23ff 100644 (file)
 #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<double> & myMedArray)
 
 
 int main (int argc, char ** argv) {
-#ifdef _DEBUG_
-  LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
   /*
   if ((argc !=3) && (argc != 4)) {
     cerr << "Usage : " << argv[0] 
index 87e07fb726046e879df9228202a7d3aa01568e30..1b05189b890ded72391cc8ae215efd03ebd45481 100644 (file)
 #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] ;
 
index 72d41e69f0a2e24c14943f1d626e031bf9836ae7..5bf79c9795b9540b5e60340ffc58dfdf3776ac3d 100644 (file)
 #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] 
index e09d36eeeb11618842698f6b32f8e03f9afc5d43..9b7b5596535e0203a554fdcbcc81a52b27c9edd4 100644 (file)
 #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 !
index f25e4cd8c660e947ac43e215c9e8d1b60c44be63..b6f6b8255f98638a0f0abfd207ef7cad75791266 100644 (file)
 #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<double> * 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)) {
index 1be6744142336f6eb6880902870d5177918297e1..da73f56572a88f0492877dd547198063841d6507 100644 (file)
 #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)) {
index a2bc356cf2d4bd1ed9da994c2afa1f259c1dc419..58cac0c5bc2dbaea4c7f29085d2a8fad0533f0a0 100644 (file)
 #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 !
index 9cfd93c888a5c0a8bc8641a1e1e514ef3374d054..e1eac48467b1aeb7a5e5c914e4bc97d2cdf7db53 100644 (file)
 #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<double> & myMedArray)
 
 
 int main (int argc, char ** argv) {
-#ifdef _DEBUG_
-  LocalTraceCollector::instance();
-#endif /* ifdef _DEBUG_*/
-
   /*
   if ((argc !=3) && (argc != 4)) {
     cerr << "Usage : " << argv[0] 
index d24215b5f643563473905413372d890a4459e919..9e5098b6c31e5cfe571d99a21676a7930eda3f6d 100644 (file)
 #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 !
index f4ad559bdcefd1a5af7756dbf76277a507fdb83c..43b98d6fa7d0fac5c610fb06848573c0e4303229 100644 (file)
 #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 !
index 6d877695c0dff2e3312f1a6ba6d5c6439a0a2dfe..b2a1ed9dff4e0075cb0bd766f12589e38ee144cf 100644 (file)
@@ -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
index 3a33db75c02149128cb4d9f0d7719435b7815f1c..4825b9acbcdeaa7e68d6315d3cd9cc17ab0bdd39 100644 (file)
@@ -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)
index 3120666899e279c3bae0f9067da40b56c0d46fd4..18737e79e518a8f3e4d550273cae7576a9149ee2 100644 (file)
 #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];
index 59b1a633532b6e1b3f63cb6740ad193dfe222f55..334f9f811d5edcd6f12bb94fbf5c044f169831eb 100644 (file)
 #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];
index 6371c6aee060d594738be040a519714027a4650e..a56d604d70439846b1c4f66eda3d344e5d88ef6d 100644 (file)
@@ -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
index 556e72bd18e336b684653eb25908d610a83d1a0a..71fb67476f3feeca1d6240360fc9f7be185a9dcd 100644 (file)
@@ -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");
index 896917c0b5cd5371d749fa1d1264ff8e601cd083..3ae43045f8126d22d522f02277013955eddf3931 100644 (file)
@@ -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)");
 }
-
index 0dbeb12de3d0f2f852234f27fbed3b42deefe5f9..cfc71c664a4346ca090f24bdbec111749e7d2077 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <SALOMEconfig.h>
 
+#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<DT_IT_, SALOME_MED::FIELD_ptr, LT_DT_IT_ > 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 :
index bd1115b2368008e4905c0f544f3e688988ac4792..a25961b331065bb5d258359f3f2e7b38486c1b16 100644 (file)
@@ -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)");
 }
 //=============================================================================
index a8e302c295a86777b3b2e496a69ba99f82fa4e9e..64ea4a7b664054fa3f26b824c630c09aedef0553 100644 (file)
@@ -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);
 }
-
index bf477ff8625e4e101ccc10b51c908c83a3ff4e8f..e2c25505b1a1e90929b41290b770676a46fe26ce 100755 (executable)
@@ -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)
index a082b0741db37cba044abadde98177ae7d803c78..617a22d117760eb057ddf9eec4a2549a400822d4 100644 (file)
@@ -2,7 +2,11 @@ template<class T>
 FIELDClient<T>::FIELDClient(typename MapCppFieldServ<T>::FieldPtrType ptrCorba,MEDMEM::SUPPORT * S):_fieldPtr(MapCppFieldServ<T>::FieldGlobalType::_duplicate(ptrCorba)),_refCounter(1)
 {
   if (!S) 
-    MEDMEM::FIELD<T>::_support=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport());
+    {
+      SCRUTE(_fieldPtr);
+      SCRUTE(_fieldPtr->getSupport());
+      MEDMEM::FIELD<T>::_support=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport());
+    }
   else
     MEDMEM::FIELD<T>::setSupport(S);
   
index 0c567262d0557892717c84c9f93e66febd62622e..4bf19794f7b455aa5c4653307a46225eb42e4c7f 100644 (file)
@@ -61,7 +61,8 @@ else
 SWIG_DEF = libMEDClient.i
 endif
 
-EXPORT_PYSCRIPTS = libMEDClient.py
+EXPORT_PYSCRIPTS = libMEDClient.py \
+                  medClient_test.py
 
 # Libraries targets
 
index 8be804bcf8d632e373b4bf99a86763d9b0d1b964..da8a5f7563b4b64799d150046780e4a0b21a894b 100644 (file)
 %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 (file)
index 0000000..719fed5
--- /dev/null
@@ -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"