Salome HOME
Add to med30 convertor.
[tools/medcoupling.git] / src / MEDLoader / MEDFileMeshSupport.cxx
index 9f8daa813b3370f9ea4f2e4554473c4124308b6f..120447d50e625fc63f5ecb1a4d78d5040665dafd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2017  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
@@ -45,16 +45,16 @@ MEDFileMeshSupports *MEDFileMeshSupports::New()
 
 MEDFileMeshSupports::MEDFileMeshSupports(med_idt fid)
 {
-  int nbSM(MEDnSupportMesh(fid));
+  med_int nbSM(MEDnSupportMesh(fid));
   _supports.resize(nbSM);
   for(int i=0;i<nbSM;i++)
     {
       INTERP_KERNEL::AutoPtr<char> msn(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
       INTERP_KERNEL::AutoPtr<char> description(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
       med_axis_type axType;
-      int nAxis(MEDsupportMeshnAxis(fid,i+1));
+      med_int nAxis(MEDsupportMeshnAxis(fid,i+1));
       INTERP_KERNEL::AutoPtr<char> axisName(new char[MED_SNAME_SIZE*nAxis+1]),axisUnit(new char[MED_SNAME_SIZE*nAxis+1]);
-      int spaceDim(0),meshDim(0);
+      med_int spaceDim(0),meshDim(0);
       MEDFILESAFECALLERRD0(MEDsupportMeshInfo,(fid,i+1,msn,&spaceDim,&meshDim,description,&axType,axisName,axisUnit));
       std::string name(MEDLoaderBase::buildStringFromFortran(msn,MED_NAME_SIZE));
       _supports[i]=MEDFileUMesh::New(fid,name);
@@ -90,6 +90,15 @@ void MEDFileMeshSupports::writeLL(med_idt fid) const
       (*it)->writeLL(fid);
 }
 
+std::vector<std::string> MEDFileMeshSupports::getSupMeshNames() const
+{
+  std::vector<std::string> ret;
+  for(std::vector< MCAuto<MEDFileUMesh> >::const_iterator it=_supports.begin();it!=_supports.end();it++)
+    if((*it).isNotNull())
+      ret.push_back((*it)->getName());
+  return ret;
+}
+
 const MEDFileUMesh *MEDFileMeshSupports::getSupMeshWithName(const std::string& name) const
 {
   std::vector<std::string> mns;
@@ -105,13 +114,13 @@ const MEDFileUMesh *MEDFileMeshSupports::getSupMeshWithName(const std::string& n
         }
     }
   std::ostringstream oss;
-  oss << "MEDFileMeshSupports::getSupMeshWithName : no such name \"" << name << "\". Possibilitities are :";
+  oss << "MEDFileMeshSupports::getSupMeshWithName : no such name \"" << name << "\". Possibilities are :";
   std::copy(mns.begin(),mns.end(),std::ostream_iterator<std::string>(oss,","));
   oss << " !";
   throw INTERP_KERNEL::Exception(oss.str());
 }
 
-int MEDFileMeshSupports::getNumberOfNodesInConnOf(TypeOfField entity, const std::string& name) const
+mcIdType MEDFileMeshSupports::getNumberOfNodesInConnOf(TypeOfField entity, const std::string& name) const
 {
   const MEDFileUMesh *sup(getSupMeshWithName(name));
   switch(entity)