]> SALOME platform Git repositories - tools/medcoupling.git/blobdiff - src/MEDCoupling/MEDCouplingFieldDouble.cxx
Salome HOME
Tests again and again
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingFieldDouble.cxx
index 4b4399ca0dc0deb5f35495a59865e85f9c051ad8..45488f602954059b328ae5797af49442edf6c957 100644 (file)
@@ -212,8 +212,8 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfT
     disc=_type->clone();
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),tdo,disc.retn());
   ret->setMesh(getMesh());
-  ret->setName(getName());
-  ret->setDescription(getDescription());
+  ret->setName(getName().c_str());
+  ret->setDescription(getDescription().c_str());
   return ret.retn();
 }
 
@@ -484,6 +484,8 @@ bool MEDCouplingFieldDouble::areCompatibleForMeld(const MEDCouplingFieldDouble *
  * renumbering. The underlying mesh is deeply copied and its cells are also permuted. 
  * The number of cells remains the same; for that the permutation array \a old2NewBg
  * should not contain equal ids.
+ * ** Warning, this method modifies the mesh aggreagated by \a this (by performing a deep copy ) **.
+ *
  *  \param [in] old2NewBg - the permutation array in "Old to New" mode. Its length is
  *         to be equal to \a this->getMesh()->getNumberOfCells().
  *  \param [in] check - if \c true, \a old2NewBg is transformed to a new permutation
@@ -539,7 +541,8 @@ void MEDCouplingFieldDouble::renumberCellsWithoutMesh(const int *old2NewBg, bool
   _type->renumberCells(old2NewBg,check);
   std::vector<DataArrayDouble *> arrays;
   _time_discr->getArrays(arrays);
-  _type->renumberArraysForCell(_mesh,arrays,old2NewBg,check);
+  std::vector<DataArray *> arrays2(arrays.size()); std::copy(arrays.begin(),arrays.end(),arrays2.begin());
+  _type->renumberArraysForCell(_mesh,arrays2,old2NewBg,check);
   //
   updateTime();
 }
@@ -2174,7 +2177,7 @@ bool MEDCouplingFieldDouble::zipCoords(double epsOnVals) throw(INTERP_KERNEL::Ex
  * duplicates are removed.<br>
  *  \param [in] compType - specifies a cell comparison technique. Meaning of its
  *          valid values [0,1,2] is explained in the description of
- *          MEDCouplingUMesh::zipConnectivityTraducer() which is called by this method.
+ *          MEDCouplingPointSet::zipConnectivityTraducer() which is called by this method.
  *  \param [in] epsOnVals - a precision used to compare field
  *         values at merged cells. If the values differ more than \a epsOnVals, an
  *         exception is thrown.
@@ -2528,7 +2531,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::keepSelectedComponents(const std
   MEDCouplingTimeDiscretization *td=_time_discr->keepSelectedComponents(compoIds);
   td->copyTinyAttrFrom(*_time_discr);
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
-  ret->setName(getName());
+  ret->setName(getName().c_str());
   ret->setMesh(getMesh());
   return ret.retn();
 }
@@ -2595,8 +2598,8 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const MEDCouplingFie
   td->copyTinyAttrFrom(*f1->_time_discr);
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
   ret->setMesh(m);
-  ret->setName(f1->getName());
-  ret->setDescription(f1->getDescription());
+  ret->setName(f1->getName().c_str());
+  ret->setDescription(f1->getDescription().c_str());
   return ret.retn();
 }
 
@@ -2641,13 +2644,13 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const std::vector<co
       tds[i]=a[i]->_time_discr;
     }
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MEDCouplingUMesh::MergeUMeshes(ms2);
-  m->setName(ms2[0]->getName()); m->setDescription(ms2[0]->getDescription());
+  m->setName(ms2[0]->getName().c_str()); m->setDescription(ms2[0]->getDescription().c_str());
   MEDCouplingTimeDiscretization *td=tds[0]->aggregate(tds);
   td->copyTinyAttrFrom(*(a[0]->_time_discr));
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone());
   ret->setMesh(m);
-  ret->setName(a[0]->getName());
-  ret->setDescription(a[0]->getDescription());
+  ret->setName(a[0]->getName().c_str());
+  ret->setDescription(a[0]->getDescription().c_str());
   return ret.retn();
 }
 
@@ -3095,9 +3098,9 @@ void MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vector<co
         }
       TypeOfField typ=cur->getTypeOfField();
       if(typ==ON_CELLS)
-        cur->getArray()->writeVTK(coss,8,cur->getName());
+        cur->getArray()->writeVTK(coss,8,cur->getName().c_str());
       else if(typ==ON_NODES)
-        cur->getArray()->writeVTK(noss,8,cur->getName());
+        cur->getArray()->writeVTK(noss,8,cur->getName().c_str());
     }
   m->writeVTKAdvanced(fileName,coss.str(),noss.str());
 }