Salome HOME
[EDF24514] : GlobalNodeIds array was missing whereas a Global node array is present...
[tools/medcoupling.git] / src / ParaMEDMEMTest / test_perf.cxx
index 66a78d005193b8da5e990131501bc098b6800991..81c8d55f08c3d2e5af62e239f623f14ea3d8c114 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021  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
 #include "ParaMESH.hxx"
 #include "ParaFIELD.hxx"
 #include "ComponentTopology.hxx"
-#include "ICoCoMEDField.hxx"
 #include "MEDLoader.hxx"
+#include "ICoCoMEDDoubleField.hxx"
+#include "MEDCouplingUMesh.hxx"
  
 #include <string>
 #include <cstring>
 
+
 // use this define to enable lines, execution of which leads to Segmentation Fault
 #define ENABLE_FAULTS
 
@@ -146,10 +148,10 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1
   else
     dec.setIntersectionType(INTERP_KERNEL::Convex);
 
-  MEDCoupling::MEDCouplingUMesh* mesh;
-  MEDCoupling::ParaMESH* paramesh;
-  MEDCoupling::ParaFIELD* parafield;
-  ICoCo::MEDField* icocofield ;
+  MEDCoupling::MEDCouplingUMesh* mesh = nullptr;
+  MEDCoupling::ParaMESH* paramesh = nullptr;
+  MEDCoupling::ParaFIELD* parafield = nullptr;
+  ICoCo::MEDDoubleField* icocofield = nullptr;
   
   // To remove tmp files from disk
   ParaMEDMEMTest_TmpFilesRemover aRemover;
@@ -171,7 +173,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1
       meshname<< meshname1<<"_"<< rank+1;
       
     get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
-    mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+    mesh=ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
     get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
     if( rank == 0 )
       cout << "IO : Telapse = " << telps << " TuserCPU = " << tcpu_u << " TsysCPU = " << tcpu_s << " TCPU = " << tcpu << endl;
@@ -187,7 +189,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1
     for(int ielem=0; ielem<nb_local;ielem++)
       value[ielem]=1.0;
     
-    icocofield=new ICoCo::MEDField(parafield->getField());
+    icocofield=new ICoCo::MEDDoubleField(parafield->getField());
      
     dec.attachLocalField(icocofield);
   }
@@ -207,7 +209,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1
       meshname<< meshname2<<"_"<<rank-nproc_source+1;
       
     get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
-    mesh = MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+    mesh = ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
     get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
     mesh->incrRef();
 
@@ -219,7 +221,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1
     double *value=parafield->getField()->getArray()->getPointer();
     for(int ielem=0; ielem<nb_local;ielem++)
       value[ielem]=0.0;
-    icocofield=new ICoCo::MEDField(parafield->getField());
+    icocofield=new ICoCo::MEDDoubleField(parafield->getField());
       
     dec.attachLocalField(icocofield);
   }