Salome HOME
MERGE stage 1: keep doc/dev and src/MEDCalc/doc
[tools/medcoupling.git] / src / ParaMEDMEMTest / ParaMEDMEMTest_InterpKernelDEC.cxx
index cb51ac75365ff756ebf18093e57da9b28a312316..9ca93d3d69541f0d7b56f59ea608583b3e7ff280 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -494,7 +494,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *ta
   ParaMEDMEM::MEDCouplingUMesh* mesh;
   ParaMEDMEM::ParaMESH* paramesh;
   ParaMEDMEM::ParaFIELD* parafield;
-  ICoCo::Field* icocofield ;
+  ICoCo::MEDField* icocofield ;
   
   string filename_xml1              = getResourceFile("square1_split");
   string filename_xml2              = getResourceFile("square2_split");
@@ -539,7 +539,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *ta
         value[ielem]=1.0;
     
       //      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
-      icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField());
+      icocofield=new ICoCo::MEDField(parafield->getField());
       dec.setMethod(srcMeth);
       dec.attachLocalField(icocofield);
     }
@@ -574,7 +574,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *ta
       for(int ielem=0; ielem<nb_local;ielem++)
         value[ielem]=0.0;
       //      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
-      icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField());
+      icocofield=new ICoCo::MEDField(parafield->getField());
       dec.setMethod(targetMeth);
       dec.attachLocalField(icocofield);
     }
@@ -857,10 +857,13 @@ void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *ta
   ParaMEDMEM::MEDCouplingUMesh* mesh;
   ParaMEDMEM::ParaMESH* paramesh;
   ParaMEDMEM::ParaFIELD* parafield;
-  ICoCo::Field* icocofield ;
+  ICoCo::MEDField* icocofield ;
   
-  string tmp_dir                    = getenv("TMP");
-  if (tmp_dir == "")
+  char * tmp_dir_c                    = getenv("TMP");
+  string tmp_dir;
+  if (tmp_dir_c != NULL)
+    tmp_dir = string(tmp_dir_c);
+  else
     tmp_dir = "/tmp";
   string filename_xml1              = getResourceFile("Mesh3D_10_2d");
   string filename_xml2              = getResourceFile("Mesh3D_11");
@@ -905,7 +908,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *ta
         value[ielem]=1.0;
     
       //      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
-      icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField());
+      icocofield=new ICoCo::MEDField(parafield->getField());
       dec.setMethod(srcMeth);
       dec.attachLocalField(icocofield);
     }
@@ -940,7 +943,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *ta
       for(int ielem=0; ielem<nb_local;ielem++)
         value[ielem]=0.0;
       //      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
-      icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField());
+      icocofield=new ICoCo::MEDField(parafield->getField());
       dec.setMethod(targetMeth);
       dec.attachLocalField(icocofield);
     }  
@@ -1907,6 +1910,10 @@ void ParaMEDMEMTest::testInterpKernelDECPartialProcs()
   delete target_group;
   delete source_group;
   delete dec;
+  if(partialComm != MPI_COMM_NULL)
+    comm.commFree(&partialComm);
+  comm.groupFree(&grp);
+  comm.groupFree(&group_world);
   MPI_Barrier(MPI_COMM_WORLD);
 }
 
@@ -2106,10 +2113,13 @@ void ParaMEDMEMTest::testAsynchronousInterpKernelDEC_2D(double dtA, double tmaxA
   ParaMEDMEM::ParaMESH* paramesh;
   ParaMEDMEM::ParaFIELD* parafield;
   
-  ICoCo::Field* icocofield ;
+  ICoCo::MEDField* icocofield ;
 
-  string tmp_dir                    = getenv("TMP");
-  if (tmp_dir == "")
+  char * tmp_dir_c                    = getenv("TMP");
+  string tmp_dir;
+  if (tmp_dir_c != NULL)
+    tmp_dir = string(tmp_dir_c);
+  else
     tmp_dir = "/tmp";
   string filename_xml1              = getResourceFile("square1_split");
   string filename_xml2              = getResourceFile("square2_split"); 
@@ -2155,7 +2165,7 @@ void ParaMEDMEMTest::testAsynchronousInterpKernelDEC_2D(double dtA, double tmaxA
         value[ielem]=0.0;
     
       //      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
-      icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField());
+      icocofield=new ICoCo::MEDField(parafield->getField());
      
       dec.attachLocalField(icocofield);
 
@@ -2194,7 +2204,7 @@ void ParaMEDMEMTest::testAsynchronousInterpKernelDEC_2D(double dtA, double tmaxA
       for(int ielem=0; ielem<nb_local;ielem++)
         value[ielem]=0.0;
       //      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
-      icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField());
+      icocofield=new ICoCo::MEDField(parafield->getField());
       
       dec.attachLocalField(icocofield);
     }