Salome HOME
MEDFileCurveLinearMesh -> getSpaceDimension() was missing
[tools/medcoupling.git] / src / ParaMEDMEMTest / ParaMEDMEMTest_ICoco.cxx
index 6e42c84169c06e0414e36d871e5a7ebb21466ff0..2650ce9ef296c798711f223db9491d32e20c01ea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020  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
@@ -35,7 +35,7 @@
 #include <assert.h>
 
 using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 using namespace ICoCo;
 
 typedef enum {sync_and,sync_or} synctype;
@@ -45,7 +45,7 @@ void synchronize_bool(bool& stop, synctype s)
   int my_stop_temp = stop?1:0;
   if (s==sync_and)
     MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD);
-  else if (s==sync_or)
+  else // if (s==sync_or)
     MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MAX,MPI_COMM_WORLD);
   stop =(my_stop==1);
 }
@@ -67,12 +67,12 @@ void affiche(const ParaFIELD& field)
 
 MEDCouplingUMesh *init_quad()
 {
-  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_quad",2));
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::New());
+  MCAuto<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_quad",2));
+  MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
   const double dataCoo[24]={0.,0.,0.,1.,0.,0.,0.,0.,1.,1.,0.,1.,0.,1e-05,0.,1.,1e-05,0.,0.,1e-05,1.,1.,1e-05,1.};
   coo->alloc(8,3);
   std::copy(dataCoo,dataCoo+24,coo->getPointer());
-  const int conn[8]={0,1,3,2,4,5,7,6};
+  const mcIdType conn[8]={0,1,3,2,4,5,7,6};
   m->allocateCells(2);
   m->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
   m->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+4);
@@ -82,12 +82,12 @@ MEDCouplingUMesh *init_quad()
 
 MEDCouplingUMesh *init_triangle()
 {
-  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_triangle",2));
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::New());
+  MCAuto<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_triangle",2));
+  MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
   const double dataCoo[24]={0.,0.,0.,1.,0.,0.,0.,0.,1.,1.,0.,1.,0.,1e-05,0.,1.,1e-05,0.,0.,1e-05,1.,1.,1e-05,1.};
   coo->alloc(8,3);
   std::copy(dataCoo,dataCoo+24,coo->getPointer());
-  const int conn[12]={0,1,2,1,2,3,4,5,7,4,6,7};
+  const mcIdType conn[12]={0,1,2,1,2,3,4,5,7,4,6,7};
   m->allocateCells(4);
   for(int i=0;i<4;i++)
     m->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn+3*i);
@@ -102,7 +102,7 @@ void ParaMEDMEMTest::testICoco1()
   MPI_Comm_size(MPI_COMM_WORLD,&size);
   MPI_Comm_rank(MPI_COMM_WORLD,&rank);
 
-  //the test is meant to run on five processors
+  //the test is meant to run on 2 processors
   if (size !=2) return ;
   
   CommInterface comm;
@@ -122,29 +122,28 @@ void ParaMEDMEMTest::testICoco1()
 
   InterpKernelDEC dec_emetteur(emetteur_group,recepteur_group);
   dec_emetteur.setOrientation(2);
-  ParaMEDMEM::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
-  ParaMEDMEM::ParaMESH *paramesh(0);
+  MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+  MEDCoupling::ParaMESH *paramesh(0);
   if (cas=="emetteur") 
     {
-      MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingUMesh> mesh_emetteur(init_triangle());
-      paramesh=new ParaMEDMEM::ParaMESH(mesh_emetteur,emetteur_group,"emetteur mesh");
-      ParaMEDMEM::ComponentTopology comptopo;
-      champ_emetteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
-      champ_emetteur->getField()->setNature(ConservativeVolumic);
+      MCAuto<MEDCoupling::MEDCouplingUMesh> mesh_emetteur(init_triangle());
+      paramesh=new MEDCoupling::ParaMESH(mesh_emetteur,emetteur_group,"emetteur mesh");
+      MEDCoupling::ComponentTopology comptopo;
+      champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+      champ_emetteur->getField()->setNature(IntensiveMaximum);
       champ_emetteur->setOwnSupport(true);
       champ_emetteur->getField()->getArray()->fillWithValue(1.);
     }
   else
     {
-      MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingUMesh> mesh_recepteur(init_quad());
-      paramesh=new ParaMEDMEM::ParaMESH(mesh_recepteur,recepteur_group,"recepteur mesh");
-      ParaMEDMEM::ComponentTopology comptopo;
-      champ_recepteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
-      champ_recepteur->getField()->setNature(ConservativeVolumic);
+      MCAuto<MEDCoupling::MEDCouplingUMesh> mesh_recepteur(init_quad());
+      paramesh=new MEDCoupling::ParaMESH(mesh_recepteur,recepteur_group,"recepteur mesh");
+      MEDCoupling::ComponentTopology comptopo;
+      champ_recepteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+      champ_recepteur->getField()->setNature(IntensiveMaximum);
       champ_recepteur->setOwnSupport(true);
     }
   
-  
   MPI_Barrier(MPI_COMM_WORLD);
 
   clock_t clock0(clock());