Salome HOME
Update C++ code consecutive to API modification of ReadField
[tools/medcoupling.git] / src / MEDPartitioner / MEDPARTITIONER_MeshCollection.cxx
index 27a7bb47a5db87e3a1d405c10fac489d186eb1f1..b19b15f13eec41336b1499eaa3c6799b90fcf5b8 100644 (file)
@@ -1142,7 +1142,7 @@ void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeM
 
       // separate ids of two domains
       const MEDCoupling::MEDCouplingSkyLineArray *corrArray = cz->getEntityCorresp( 0, 0 );
-      const DataArrayInt* ids12 = corrArray->getValueArray();
+      const DataArrayInt* ids12 = corrArray->getValuesArray();
       MCAuto<DataArrayInt> ids1, ids2, ids12Sorted;
       ids1 = ids12->selectByTupleIdSafeSlice( 0, corrArray->getLength(), 2 );
       ids2 = ids12->selectByTupleIdSafeSlice( 1, corrArray->getLength(), 2 );
@@ -1252,7 +1252,7 @@ void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeM
 
       // separate ids of two domains
       const MEDCoupling::MEDCouplingSkyLineArray *corrArray = cz->getNodeCorresp();
-      const DataArrayInt *ids12 = corrArray->getValueArray();
+      const DataArrayInt *ids12 = corrArray->getValuesArray();
       MCAuto<DataArrayInt> ids1, ids2, ids12Sorted;
       ids1 = ids12->selectByTupleIdSafeSlice( 0, corrArray->getLength(), 2 );
       ids2 = ids12->selectByTupleIdSafeSlice( 1, corrArray->getLength(), 2 );
@@ -1922,7 +1922,7 @@ void MEDPARTITIONER::MeshCollection::buildCellGraph(MEDCoupling::MEDCouplingSkyL
         vector<int> value;
         vector<int> index(1,0);
         
-        array=new MEDCoupling::MEDCouplingSkyLineArray(index,value);
+        array = MEDCoupling::MEDCouplingSkyLineArray::New(index,value);
         return;
      }
   array=mesh->generateGraph();
@@ -2101,7 +2101,7 @@ void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(MEDCoupling::MEDCoup
         }
     }
 
-  array=new MEDCoupling::MEDCouplingSkyLineArray(index,value);
+  array=MEDCoupling::MEDCouplingSkyLineArray::New(index,value);
 
   if (MyGlobals::_Verbose>100)
     {
@@ -2252,7 +2252,7 @@ void MEDPARTITIONER::MeshCollection::setDomainNames(const std::string& name)
 
 MEDCoupling::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::string descriptionField, int iold)
 //getField look for and read it if not done, and assume decrRef() in ~MeshCollection;
-//something like MEDCouplingFieldDouble *f2=ReadFieldCell(name,f1->getMesh()->getName(),0,f1->getName(),0,1);
+//something like MCAuto<MEDCouplingFieldDouble> f2=ReadFieldCell(name,f1->getMesh()->getName(),0,f1->getName(),0,1);
 {
   int rank=MyGlobals::_Rank;
   std::string tag="ioldFieldDouble="+IntToStr(iold);
@@ -2274,8 +2274,8 @@ MEDCoupling::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::stri
   FieldShortDescriptionToData(descriptionIold, fieldName, typeField, entity, DT, IT);
   meshName=MyGlobals::_Mesh_Names[iold];
   
-  MEDCoupling::MEDCouplingFieldDouble* f2=ReadField((MEDCoupling::TypeOfField) typeField,
-                                                    fileName, meshName, 0, fieldName, DT, IT);
+  MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> f2=ReadField((MEDCoupling::TypeOfField) typeField,
+                                                                        fileName, meshName, 0, fieldName, DT, IT);
   
   MEDCoupling::DataArrayDouble* res=f2->getArray();
   //to know names of components
@@ -2285,7 +2285,6 @@ MEDCoupling::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::stri
     std::cout << "proc " << MyGlobals::_Rank << " : localFieldInformation : " << localFieldInformation << std::endl;
   MyGlobals::_General_Informations.push_back(localFieldInformation);
   res->incrRef();
-  f2->decrRef();
   _map_dataarray_double[descriptionIold]=res; 
   return res;
 }