Salome HOME
1st step.
[modules/paravis.git] / src / Plugins / MEDReader / IO / MEDFileFieldRepresentationTree.cxx
index 40c072c817dd0f3848a704d08f78c10a5fcc4bd4..9c19bfdfa90ce23aa6592802b6476d3d6ea40240 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2015  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
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include "MEDFileData.hxx"
 #include "SauvReader.hxx"
 
+#ifdef MEDREADER_USE_MPI
+  #include "ParaMEDFileMesh.hxx"
+#endif
+
 #include "vtkXMLUnstructuredGridWriter.h"//
 
 #include "vtkUnstructuredGrid.h"
 #include "vtkFieldData.h"
 #include "vtkCellData.h"
 
-#include "vtksys/stl/string"
-#include "vtksys/ios/fstream"
-#include "vtksys/stl/algorithm"
 #include "vtkMutableDirectedGraph.h"
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 const char MEDFileFieldRepresentationLeavesArrays::ZE_SEP[]="@@][@@";
 
@@ -73,7 +74,7 @@ const char MEDFileFieldRepresentationTree::ROOT_OF_FAM_IDS_IN_TREE[]="zeFamIds";
 
 const char MEDFileFieldRepresentationTree::COMPO_STR_TO_LOCATE_MESH_DA[]="-@?|*_";
 
-vtkIdTypeArray *ELGACmp::findOrCreate(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const
+vtkIdTypeArray *ELGACmp::findOrCreate(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const
 {
   vtkIdTypeArray *try0(isExisting(locsReallyUsed,vtkd));
   if(try0)
@@ -104,9 +105,9 @@ vtkIdTypeArray *ELGACmp::isExisting(const std::vector<std::string>& locsReallyUs
   return ret;
 }
 
-vtkIdTypeArray *ELGACmp::createNew(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const
+vtkIdTypeArray *ELGACmp::createNew(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const
 {
-  static const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_DELETE;
+  const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_DELETE;
   std::vector< std::vector<std::string> > locNames(_loc_names);
   std::vector<vtkIdTypeArray *> elgas(_elgas);
   std::vector< std::pair< vtkQuadratureSchemeDefinition *, unsigned char > > defs;
@@ -136,7 +137,13 @@ vtkIdTypeArray *ELGACmp::createNew(const ParaMEDMEM::MEDFileFieldGlobsReal *glob
       for(int i=0;i<nbGaussPt;i++)
         {
           const double *pt0(calculator.getFunctionValues(i));
-          std::copy(pt0,pt0+nbPtsPerCell,shape+nbPtsPerCell*i);
+          if(ct!=INTERP_KERNEL::NORM_HEXA27)
+            std::copy(pt0,pt0+nbPtsPerCell,shape+nbPtsPerCell*i);
+          else
+            {
+              for(int j=0;j<27;j++)
+                shape[nbPtsPerCell*i+j]=pt0[MEDMeshMultiLev::HEXA27_PERM_ARRAY[j]];
+            }
         }
       unsigned char vtkType(MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE[ct]);
       m[vtkType]=nbGaussPt;
@@ -157,7 +164,7 @@ vtkIdTypeArray *ELGACmp::createNew(const ParaMEDMEM::MEDFileFieldGlobsReal *glob
       offset+=delta;
     }
   elga->GetInformation()->Set(MEDUtilities::ELGA(),1);
-  elga->SetArray(pt,ncell,0,VTK_DATA_ARRAY_DELETE);
+  elga->SetVoidArray(pt,ncell,0,VTK_DATA_ARRAY_DELETE);
   std::ostringstream oss; oss << "ELGA" << "@" << _loc_names.size();
   std::string ossStr(oss.str());
   elga->SetName(ossStr.c_str());
@@ -191,21 +198,21 @@ MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays()
 {
 }
 
-MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays(const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS>& arr):ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS>(arr),_activated(false),_id(-1)
+MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileAnyTypeFieldMultiTS>& arr):MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileAnyTypeFieldMultiTS>(arr),_activated(false),_id(-1)
 {
-  std::vector< std::vector<ParaMEDMEM::TypeOfField> > typs((operator->())->getTypesOfFieldAvailable());
+  std::vector< std::vector<MEDCoupling::TypeOfField> > typs((operator->())->getTypesOfFieldAvailable());
   if(typs.size()<1)
     throw INTERP_KERNEL::Exception("There is a big internal problem in MEDLoader ! The field time spitting has failed ! A CRASH will occur soon !");
   if(typs[0].size()!=1)
     throw INTERP_KERNEL::Exception("There is a big internal problem in MEDLoader ! The field spitting by spatial discretization has failed ! A CRASH will occur soon !");
-  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDiscretization> fd(MEDCouplingFieldDiscretization::New(typs[0][0]));
+  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDCouplingFieldDiscretization> fd(MEDCouplingFieldDiscretization::New(typs[0][0]));
   std::ostringstream oss2; oss2 << (operator->())->getName() << ZE_SEP << fd->getRepr();
   _ze_name=oss2.str();
 }
 
 MEDFileFieldRepresentationLeavesArrays& MEDFileFieldRepresentationLeavesArrays::operator=(const MEDFileFieldRepresentationLeavesArrays& other)
 {
-  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS>::operator=(other);
+  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileAnyTypeFieldMultiTS>::operator=(other);
   _id=-1;
   _activated=false;
   _ze_name=other._ze_name;
@@ -228,12 +235,15 @@ std::string MEDFileFieldRepresentationLeavesArrays::getZeName() const
   return _ze_full_name;
 }
 
-void MEDFileFieldRepresentationLeavesArrays::feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, const std::string& tsName, const std::string& meshName, const std::string& comSupStr, std::vector<std::string>& names) const
+const char *MEDFileFieldRepresentationLeavesArrays::getZeNameC() const
+{
+  return _ze_full_name.c_str();
+}
+
+void MEDFileFieldRepresentationLeavesArrays::feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names) const
 {
   vtkIdType refId(sil->AddChild(root,edge));
   names.push_back(_ze_name);
-  std::ostringstream oss3; oss3 << tsName << "/" << meshName << "/" << comSupStr << "/" << _ze_name;
-  _ze_full_name=oss3.str();
   //
   if(MEDFileFieldRepresentationTree::IsFieldMeshRegardingInfo(((operator->())->getInfo())))
     {
@@ -242,6 +252,12 @@ void MEDFileFieldRepresentationLeavesArrays::feedSIL(vtkMutableDirectedGraph* si
     }
 }
 
+void MEDFileFieldRepresentationLeavesArrays::computeFullNameInLeaves(const std::string& tsName, const std::string& meshName, const std::string& comSupStr) const
+{
+  std::ostringstream oss3; oss3 << tsName << "/" << meshName << "/" << comSupStr << "/" << _ze_name;
+  _ze_full_name=oss3.str();
+}
+
 bool MEDFileFieldRepresentationLeavesArrays::getStatus() const
 {
   return _activated;
@@ -254,10 +270,10 @@ bool MEDFileFieldRepresentationLeavesArrays::setStatus(bool status) const
   return ret;
 }
 
-void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshStruct *mst, vtkDataSet *ds) const
+void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshStruct *mst, vtkDataSet *ds) const
 {
-  static const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
-  static const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_DELETE;
+  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
+  const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_DELETE;
   tr->setNumberOfTS((operator->())->getNumberOfTS());
   tr->initIterator();
   for(int timeStepId=0;timeStepId<tr->size();timeStepId++,++(*tr))
@@ -347,7 +363,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr,
                   offset+=delta;
                 }
               elno->GetInformation()->Set(MEDUtilities::ELNO(),1);
-              elno->SetArray(pt,ncell,0,VTK_DATA_ARRAY_DELETE);
+              elno->SetVoidArray(pt,ncell,0,VTK_DATA_ARRAY_DELETE);
               std::string nameElno("ELNO"); nameElno+="@"; nameElno+=name;
               elno->SetName(nameElno.c_str());
               ds->GetCellData()->AddArray(elno);
@@ -423,8 +439,8 @@ MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves():_cached_ds(
 {
 }
 
-MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves(const std::vector< ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS> >& arr,
-                                                                   const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileFastCellSupportComparator>& fsp):_arrays(arr.size()),_fsp(fsp),_cached_ds(0)
+MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileAnyTypeFieldMultiTS> >& arr,
+                                                                   const MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileFastCellSupportComparator>& fsp):_arrays(arr.size()),_fsp(fsp),_cached_ds(0)
 {
   for(std::size_t i=0;i<arr.size();i++)
     _arrays[i]=MEDFileFieldRepresentationLeavesArrays(arr[i]);
@@ -463,10 +479,38 @@ int MEDFileFieldRepresentationLeaves::getNumberOfTS() const
   return _arrays[0]->getNumberOfTS();
 }
 
-void MEDFileFieldRepresentationLeaves::feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, const std::string& tsName, const std::string& meshName, const std::string& comSupStr, std::vector<std::string>& names) const
+void MEDFileFieldRepresentationLeaves::computeFullNameInLeaves(const std::string& tsName, const std::string& meshName, const std::string& comSupStr) const
 {
   for(std::vector<MEDFileFieldRepresentationLeavesArrays>::const_iterator it=_arrays.begin();it!=_arrays.end();it++)
-    (*it).feedSIL(sil,root,edge,tsName,meshName,comSupStr,names);
+    (*it).computeFullNameInLeaves(tsName,meshName,comSupStr);
+}
+
+/*!
+ * \param [in] ms is the meshes pointer. It can be used only for information of geometric types. No special processing will be requested on ms.
+ */
+void MEDFileFieldRepresentationLeaves::feedSIL(const MEDCoupling::MEDFileMeshes *ms, const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names) const
+{
+  vtkIdType root2(sil->AddChild(root,edge));
+  names.push_back(std::string("Arrs"));
+  for(std::vector<MEDFileFieldRepresentationLeavesArrays>::const_iterator it=_arrays.begin();it!=_arrays.end();it++)
+    (*it).feedSIL(sil,root2,edge,names);
+  //
+  vtkIdType root3(sil->AddChild(root,edge));
+  names.push_back(std::string("InfoOnGeoType"));
+  const MEDCoupling::MEDFileMesh *m(0);
+  if(ms)
+    m=ms->getMeshWithName(meshName);
+  const MEDCoupling::MEDFileFastCellSupportComparator *fsp(_fsp);
+  if(!fsp || fsp->getNumberOfTS()==0)
+    return ;
+  std::vector< INTERP_KERNEL::NormalizedCellType > gts(fsp->getGeoTypesAt(0,m));
+  for(std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator it2=gts.begin();it2!=gts.end();it2++)
+    {
+      const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(*it2));
+      std::string cmStr(cm.getRepr()); cmStr=cmStr.substr(5);//skip "NORM_"
+      sil->AddChild(root3,edge);
+      names.push_back(cmStr);
+    }
 }
 
 bool MEDFileFieldRepresentationLeaves::containId(int id) const
@@ -488,6 +532,12 @@ bool MEDFileFieldRepresentationLeaves::containZeName(const char *name, int& id)
   return false;
 }
 
+void MEDFileFieldRepresentationLeaves::dumpState(std::map<std::string,bool>& status) const
+{
+  for(std::vector<MEDFileFieldRepresentationLeavesArrays>::const_iterator it=_arrays.begin();it!=_arrays.end();it++)
+    status[(*it).getZeName()]=(*it).getStatus();
+}
+
 bool MEDFileFieldRepresentationLeaves::isActivated() const
 {
   for(std::vector<MEDFileFieldRepresentationLeavesArrays>::const_iterator it=_arrays.begin();it!=_arrays.end();it++)
@@ -566,7 +616,7 @@ std::string MEDFileFieldRepresentationLeaves::getHumanReadableOverviewOfTS() con
   return oss.str();
 }
 
-void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshes *meshes, vtkDataSet *ds) const
+void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshes *meshes, vtkDataSet *ds) const
 {
   if(_arrays.size()<1)
     throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationLeaves::appendFields : internal error !");
@@ -581,7 +631,7 @@ void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const
 
 vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationUnstructured(MEDUMeshMultiLev *mm) const
 {
-  static const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
+  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   DataArrayDouble *coordsMC(0);
   DataArrayByte *typesMC(0);
   DataArrayInt *cellLocationsMC(0),*cellsMC(0),*faceLocationsMC(0),*facesMC(0);
@@ -595,18 +645,18 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
   vtkUnsignedCharArray *cellTypes(vtkUnsignedCharArray::New());
   cellTypes->SetArray(reinterpret_cast<unsigned char *>(typesSafe->getPointer()),nbOfCells,0,VTK_DATA_ARRAY_FREE); typesSafe->accessToMemArray().setSpecificDeallocator(0);
   vtkIdTypeArray *cellLocations(vtkIdTypeArray::New());
-  cellLocations->SetArray(cellLocationsSafe->getPointer(),nbOfCells,0,VTK_DATA_ARRAY_FREE); cellLocationsSafe->accessToMemArray().setSpecificDeallocator(0);
+  cellLocations->SetVoidArray(cellLocationsSafe->getPointer(),nbOfCells,0,VTK_DATA_ARRAY_FREE); cellLocationsSafe->accessToMemArray().setSpecificDeallocator(0);
   vtkCellArray *cells(vtkCellArray::New());
   vtkIdTypeArray *cells2(vtkIdTypeArray::New());
-  cells2->SetArray(cellsSafe->getPointer(),cellsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); cellsSafe->accessToMemArray().setSpecificDeallocator(0);
+  cells2->SetVoidArray(cellsSafe->getPointer(),cellsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); cellsSafe->accessToMemArray().setSpecificDeallocator(0);
   cells->SetCells(nbOfCells,cells2);
   cells2->Delete();
   if(faceLocationsMC!=0 && facesMC!=0)
     {
       vtkIdTypeArray *faces(vtkIdTypeArray::New());
-      faces->SetArray(facesSafe->getPointer(),facesSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); facesSafe->accessToMemArray().setSpecificDeallocator(0);
+      faces->SetVoidArray(facesSafe->getPointer(),facesSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); facesSafe->accessToMemArray().setSpecificDeallocator(0);
       vtkIdTypeArray *faceLocations(vtkIdTypeArray::New());
-      faceLocations->SetArray(faceLocationsSafe->getPointer(),faceLocationsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); faceLocationsSafe->accessToMemArray().setSpecificDeallocator(0);
+      faceLocations->SetVoidArray(faceLocationsSafe->getPointer(),faceLocationsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); faceLocationsSafe->accessToMemArray().setSpecificDeallocator(0);
       ret->SetCells(cellTypes,cellLocations,cells,faceLocations,faces);
       faceLocations->Delete();
       faces->Delete();
@@ -634,9 +684,9 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
   return ret;
 }
 
-vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCartesian(ParaMEDMEM::MEDCMeshMultiLev *mm) const
+vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCartesian(MEDCoupling::MEDCMeshMultiLev *mm) const
 {
-  static const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
+  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   bool isInternal;
   std::vector< DataArrayDouble * > arrs(mm->buildVTUArrays(isInternal));
   vtkDoubleArray *vtkTmp(0);
@@ -687,9 +737,9 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte
   return ret;
 }
 
-vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCurveLinear(ParaMEDMEM::MEDCurveLinearMeshMultiLev *mm) const
+vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCurveLinear(MEDCoupling::MEDCurveLinearMeshMultiLev *mm) const
 {
-  static const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
+  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   int meshStr[3]={1,1,1};
   DataArrayDouble *coords(0);
   std::vector<int> nodeStrct;
@@ -729,9 +779,9 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter
   return ret;
 }
  
-vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDFileMeshes *meshes) const
+vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDFileMeshes *meshes) const
 {
-  static const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
+  const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate<double>::VTK_DATA_ARRAY_FREE;
   vtkDataSet *ret(0);
   //_fsp->isDataSetSupportEqualToThePreviousOne(i,globs);
   MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> mml(_fsp->buildFromScratchDataSetSupport(0,globs));//0=timestep Id. Make the hypothesis that support does not change 
@@ -856,6 +906,28 @@ void MEDFileFieldRepresentationTree::assignIds() const
       for(std::vector< MEDFileFieldRepresentationLeaves >::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
         (*it2).setId(zeId);
 }
+
+void MEDFileFieldRepresentationTree::computeFullNameInLeaves() const
+{
+   std::size_t it0Cnt(0);
+   for(std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > >::const_iterator it0=_data_structure.begin();it0!=_data_structure.end();it0++,it0Cnt++)
+     {
+       std::ostringstream oss; oss << MEDFileFieldRepresentationLeavesArrays::TS_STR << it0Cnt;
+       std::string tsName(oss.str());
+       for(std::vector< std::vector< MEDFileFieldRepresentationLeaves > >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
+         {
+           std::string meshName((*it1)[0].getMeshName());
+           std::size_t it2Cnt(0);
+           for(std::vector< MEDFileFieldRepresentationLeaves >::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++,it2Cnt++)
+             {
+               std::ostringstream oss2; oss2 << MEDFileFieldRepresentationLeavesArrays::COM_SUP_STR << it2Cnt;
+               std::string comSupStr(oss2.str());
+               (*it2).computeFullNameInLeaves(tsName,meshName,comSupStr);
+             }
+         }
+     }
+}
+
 void MEDFileFieldRepresentationTree::activateTheFirst() const
 {
   for(std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > >::const_iterator it0=_data_structure.begin();it0!=_data_structure.end();it0++)
@@ -910,7 +982,7 @@ void MEDFileFieldRepresentationTree::feedSIL(vtkMutableDirectedGraph* sil, vtkId
               std::string comSupStr(oss2.str());
               vtkIdType typeId2(sil->AddChild(typeId1,edge));
               names.push_back(comSupStr);
-              (*it2).feedSIL(sil,typeId2,edge,tsName,meshName,comSupStr,names);
+              (*it2).feedSIL(_ms,meshName,sil,typeId2,edge,names);
             } 
         }
     }
@@ -978,6 +1050,12 @@ std::string MEDFileFieldRepresentationTree::getNameOf(int id) const
   return elt.getZeName();
 }
 
+const char *MEDFileFieldRepresentationTree::getNameOfC(int id) const
+{
+  const MEDFileFieldRepresentationLeavesArrays& elt(getLeafArr(id));
+  return elt.getZeNameC();
+}
+
 bool MEDFileFieldRepresentationTree::getStatusOf(int id) const
 {
   const MEDFileFieldRepresentationLeavesArrays& elt(getLeafArr(id));
@@ -992,7 +1070,8 @@ int MEDFileFieldRepresentationTree::getIdHavingZeName(const char *name) const
       for(std::vector< MEDFileFieldRepresentationLeaves >::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
         if((*it2).containZeName(name,ret))
           return ret;
-  throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationTree::getIdHavingZeName : No such a name !");
+  std::ostringstream msg; msg << "MEDFileFieldRepresentationTree::getIdHavingZeName : No such a name \"" << name << "\" !";
+  throw INTERP_KERNEL::Exception(msg.str().c_str());
 }
 
 bool MEDFileFieldRepresentationTree::changeStatusOfAndUpdateToHaveCoherentVTKDataSet(int id, bool status) const
@@ -1015,31 +1094,52 @@ int MEDFileFieldRepresentationTree::getMaxNumberOfTimeSteps() const
 /*!
  * 
  */
-void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv)
+void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts)
 {
   if(isMEDOrSauv)
     {
-      _ms=MEDFileMeshes::New(fileName);
-      _fields=MEDFileFields::New(fileName,false);//false is important to not read the values
+      if((iPart==-1 && nbOfParts==-1) || (iPart==0 && nbOfParts==1))
+        {
+          _ms=MEDFileMeshes::New(fileName);
+          _fields=MEDFileFields::New(fileName,false);//false is important to not read the values
+        }
+      else
+        {
+#ifdef MEDREADER_USE_MPI
+          _ms=ParaMEDFileMeshes::New(iPart,nbOfParts,fileName);
+          int nbMeshes(_ms->getNumberOfMeshes());
+          for(int i=0;i<nbMeshes;i++)
+            {
+              MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i));
+              MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast<MEDCoupling::MEDFileUMesh *>(tmp));
+              if(tmp2)
+                MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp3(tmp2->zipCoords());
+            }
+          _fields=MEDFileFields::LoadPartOf(fileName,false,_ms);//false is important to not read the values
+#else
+          std::ostringstream oss; oss << "MEDFileFieldRepresentationTree::loadMainStructureOfFile : request for iPart/nbOfParts=" << iPart << "/" << nbOfParts << " whereas Plugin not compiled with MPI !";
+          throw INTERP_KERNEL::Exception(oss.str().c_str());
+#endif
+        }
     }
   else
     {
-      MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::SauvReader> sr(ParaMEDMEM::SauvReader::New(fileName));
-      MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileData> mfd(sr->loadInMEDFileDS());
+      MEDCouplingAutoRefCountObjectPtr<MEDCoupling::SauvReader> sr(MEDCoupling::SauvReader::New(fileName));
+      MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileData> mfd(sr->loadInMEDFileDS());
       _ms=mfd->getMeshes(); _ms->incrRef();
       int nbMeshes(_ms->getNumberOfMeshes());
       for(int i=0;i<nbMeshes;i++)
         {
-          ParaMEDMEM::MEDFileMesh *tmp(_ms->getMeshAtPos(i));
-          ParaMEDMEM::MEDFileUMesh *tmp2(dynamic_cast<ParaMEDMEM::MEDFileUMesh *>(tmp));
+          MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i));
+          MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast<MEDCoupling::MEDFileUMesh *>(tmp));
           if(tmp2)
             tmp2->forceComputationOfParts();
         }
       _fields=mfd->getFields();
-      if((ParaMEDMEM::MEDFileFields *)_fields)
+      if((MEDCoupling::MEDFileFields *)_fields)
         _fields->incrRef();
     }
-  if(!((ParaMEDMEM::MEDFileFields *)_fields))
+  if(!((MEDCoupling::MEDFileFields *)_fields))
     {
       _fields=BuildFieldFromMeshes(_ms);
     }
@@ -1047,6 +1147,8 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
     {
       AppendFieldFromMeshes(_ms,_fields);
     }
+  _ms->cartesianizeMe();
+  _fields->removeFieldsWithoutAnyTimeStep();
   std::vector<std::string> meshNames(_ms->getMeshesNames());
   std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFields> > fields_per_mesh(meshNames.size());
   for(std::size_t i=0;i<meshNames.size();i++)
@@ -1061,7 +1163,24 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
         {
           MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> fmts((*fields)->getFieldAtPos((int)j));
           std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > tmp(fmts->splitDiscretizations());
-          allFMTSLeavesToDisplaySafe.insert(allFMTSLeavesToDisplaySafe.end(),tmp.begin(),tmp.end());
+          // EDF 8655
+          for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::const_iterator it=tmp.begin();it!=tmp.end();it++)
+            {
+              if(!(*it)->presenceOfMultiDiscPerGeoType())
+                allFMTSLeavesToDisplaySafe.push_back(*it);
+              else
+                {// The case of some parts of field have more than one discretization per geo type.
+                  std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > subTmp((*it)->splitMultiDiscrPerGeoTypes());
+                  std::size_t it0Cnt(0);
+                  for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::iterator it0=subTmp.begin();it0!=subTmp.end();it0++,it0Cnt++)//not const because setName
+                    {
+                      std::ostringstream oss; oss << (*it0)->getName() << "_" << std::setfill('M') << std::setw(3) << it0Cnt;
+                      (*it0)->setName(oss.str());
+                      allFMTSLeavesToDisplaySafe.push_back(*it0);
+                    }
+                }
+            }
+         // end EDF 8655
         }
     }
   std::vector< MEDFileAnyTypeFieldMultiTS *> allFMTSLeavesToDisplay(allFMTSLeavesToDisplaySafe.size());
@@ -1086,12 +1205,12 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
   this->_data_structure.resize(allFMTSLeavesPerTimeSeriesSafe.size());
   for(std::size_t i=0;i<allFMTSLeavesPerTimeSeriesSafe.size();i++)
     {
-      vtksys_stl::vector< vtksys_stl::string > meshNamesLoc;
+      std::vector< std::string > meshNamesLoc;
       std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> > > splitByMeshName;
       for(std::size_t j=0;j<allFMTSLeavesPerTimeSeriesSafe[i].size();j++)
         {
           std::string meshName(allFMTSLeavesPerTimeSeriesSafe[i][j]->getMeshName());
-          vtksys_stl::vector< vtksys_stl::string >::iterator it(std::find(meshNamesLoc.begin(),meshNamesLoc.end(),meshName));
+          std::vector< std::string >::iterator it(std::find(meshNamesLoc.begin(),meshNamesLoc.end(),meshName));
           if(it==meshNamesLoc.end())
             {
               meshNamesLoc.push_back(meshName);
@@ -1127,6 +1246,7 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
     }
   this->removeEmptyLeaves();
   this->assignIds();
+  this->computeFullNameInLeaves();
 }
 
 void MEDFileFieldRepresentationTree::removeEmptyLeaves()
@@ -1223,7 +1343,7 @@ vtkDataSet *MEDFileFieldRepresentationTree::buildVTKInstance(bool isStdOrMode, d
   if(!isStdOrMode)
     tr=new MEDStdTimeReq((int)zeTimeId);
   else
-    tr=new MEDModeTimeReq(tk.getTheVectOfBool());
+    tr=new MEDModeTimeReq(tk.getTheVectOfBool(),tk.getPostProcessedTime());
   vtkDataSet *ret(leaf.buildVTKInstanceNoTimeInterpolation(tr,_fields,_ms));
   delete tr;
   return ret;
@@ -1277,63 +1397,170 @@ void MEDFileFieldRepresentationTree::printMySelf(std::ostream& os) const
     os << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" << std::endl;
 }
 
-void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms, ParaMEDMEM::MEDFileFields *ret)
+std::map<std::string,bool> MEDFileFieldRepresentationTree::dumpState() const
 {
+  std::map<std::string,bool> ret;
+  for(std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > >::const_iterator it0=_data_structure.begin();it0!=_data_structure.end();it0++)
+    for(std::vector< std::vector< MEDFileFieldRepresentationLeaves > >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
+      for(std::vector< MEDFileFieldRepresentationLeaves >::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
+        (*it2).dumpState(ret);
+  return ret;
+}
+
+void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms, MEDCoupling::MEDFileFields *ret)
+{
+  if(!ret)
+    throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationTree::AppendFieldFromMeshes : internal error ! NULL ret !");
   for(int i=0;i<ms->getNumberOfMeshes();i++)
     {
       MEDFileMesh *mm(ms->getMeshAtPos(i));
-      MEDFileUMesh *mmu(dynamic_cast<MEDFileUMesh *>(mm));
-      if(!mmu)
-        continue;
       std::vector<int> levs(mm->getNonEmptyLevels());
-      ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileField1TS> f1tsMultiLev(ParaMEDMEM::MEDFileField1TS::New());
-      for(std::vector<int>::const_iterator it=levs.begin();it!=levs.end();it++)
+      MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileField1TS> f1tsMultiLev(MEDCoupling::MEDFileField1TS::New());
+      MEDFileUMesh *mmu(dynamic_cast<MEDFileUMesh *>(mm));
+      if(mmu)
         {
-          std::vector<INTERP_KERNEL::NormalizedCellType> gts(mmu->getGeoTypesAtLevel(*it));
-          for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator gt=gts.begin();gt!=gts.end();gt++)
+          for(std::vector<int>::const_iterator it=levs.begin();it!=levs.end();it++)
             {
-              ParaMEDMEM::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt));
-              ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS));
-              f->setMesh(m);
-              ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected());
-             arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA));
-              arr->iota();
-              f->setArray(arr);
-              f->setName(mm->getName());
-              f1tsMultiLev->setFieldNoProfileSBT(f);
+              std::vector<INTERP_KERNEL::NormalizedCellType> gts(mmu->getGeoTypesAtLevel(*it));
+              for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator gt=gts.begin();gt!=gts.end();gt++)
+                {
+                  MEDCoupling::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt));
+                  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDCouplingFieldDouble> f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS));
+                  f->setMesh(m);
+                  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::DataArrayDouble> arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected());
+                  arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA));
+                  arr->iota();
+                  f->setArray(arr);
+                  f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret));
+                  f1tsMultiLev->setFieldNoProfileSBT(f);
+                }
             }
-        }
-      if(levs.empty())
-        {
-          std::vector<int> levsExt(mm->getNonEmptyLevelsExt());
-          if(levsExt.size()==levs.size()+1)
+          if(levs.empty())
             {
-              ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingMesh> m(mm->getGenMeshAtLevel(1));
-              ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES));
-              f->setMesh(m);
-              ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes());
-             arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA));
-              arr->iota(); f->setArray(arr);
-              f->setName(mm->getName());
-              f1tsMultiLev->setFieldNoProfileSBT(f);
+              std::vector<int> levsExt(mm->getNonEmptyLevelsExt());
+              if(levsExt.size()==levs.size()+1)
+                {
+                  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDCouplingMesh> m(mm->getMeshAtLevel(1));
+                  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDCouplingFieldDouble> f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES));
+                  f->setMesh(m);
+                  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::DataArrayDouble> arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes());
+                  arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA));
+                  arr->iota(); f->setArray(arr);
+                  f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret));
+                  f1tsMultiLev->setFieldNoProfileSBT(f);
+                }
+              else
+                continue;
             }
-          else
-            continue;
+        }
+      else
+        {
+          MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDCouplingMesh> m(mm->getMeshAtLevel(0));
+          MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDCouplingFieldDouble> f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS));
+          f->setMesh(m);
+          MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::DataArrayDouble> arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected());
+          arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA));
+          arr->iota();
+          f->setArray(arr);
+          f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret));
+          f1tsMultiLev->setFieldNoProfileSBT(f);
         }
       //
-      ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileFieldMultiTS> fmtsMultiLev(ParaMEDMEM::MEDFileFieldMultiTS::New());
+      MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileFieldMultiTS> fmtsMultiLev(MEDCoupling::MEDFileFieldMultiTS::New());
       fmtsMultiLev->pushBackTimeStep(f1tsMultiLev);
       ret->pushField(fmtsMultiLev);
     }
 }
 
-ParaMEDMEM::MEDFileFields *MEDFileFieldRepresentationTree::BuildFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms)
+std::string MEDFileFieldRepresentationTree::BuildAUniqueArrayNameForMesh(const std::string& meshName, const MEDCoupling::MEDFileFields *ret)
 {
-  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileFields> ret(ParaMEDMEM::MEDFileFields::New());
+  const char KEY_STR_TO_AVOID_COLLIDE[]="MESH@";
+  if(!ret)
+    throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationTree::BuildAUniqueArrayNameForMesh : internal error ! NULL ret !");
+  std::vector<std::string> fieldNamesAlreadyExisting(ret->getFieldsNames());
+  if(std::find(fieldNamesAlreadyExisting.begin(),fieldNamesAlreadyExisting.end(),meshName)==fieldNamesAlreadyExisting.end())
+    return meshName;
+  std::string tmpName(KEY_STR_TO_AVOID_COLLIDE); tmpName+=meshName;
+  while(std::find(fieldNamesAlreadyExisting.begin(),fieldNamesAlreadyExisting.end(),tmpName)!=fieldNamesAlreadyExisting.end())
+    tmpName=std::string(KEY_STR_TO_AVOID_COLLIDE)+tmpName;
+  return tmpName;
+}
+
+MEDCoupling::MEDFileFields *MEDFileFieldRepresentationTree::BuildFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms)
+{
+  MEDCoupling::MEDCouplingAutoRefCountObjectPtr<MEDCoupling::MEDFileFields> ret(MEDCoupling::MEDFileFields::New());
   AppendFieldFromMeshes(ms,ret);
   return ret.retn();
 }
 
+std::vector<std::string> MEDFileFieldRepresentationTree::SplitFieldNameIntoParts(const std::string& fullFieldName, char sep)
+{
+  std::vector<std::string> ret;
+  std::size_t pos(0);
+  while(pos!=std::string::npos)
+    {
+      std::size_t curPos(fullFieldName.find_first_of(sep,pos));
+      std::string elt(fullFieldName.substr(pos,curPos!=std::string::npos?curPos-pos:std::string::npos));
+      ret.push_back(elt);
+      pos=fullFieldName.find_first_not_of(sep,curPos);
+    }
+  return ret;
+}
+
+/*!
+ * Here the non regression tests.
+ * const char inp0[]="";
+ * const char exp0[]="";
+ * const char inp1[]="field";
+ * const char exp1[]="field";
+ * const char inp2[]="_________";
+ * const char exp2[]="_________";
+ * const char inp3[]="field_p";
+ * const char exp3[]="field_p";
+ * const char inp4[]="field__p";
+ * const char exp4[]="field_p";
+ * const char inp5[]="field_p__";
+ * const char exp5[]="field_p";
+ * const char inp6[]="field_p_";
+ * const char exp6[]="field_p";
+ * const char inp7[]="field_____EDFGEG//sdkjf_____PP_______________";
+ * const char exp7[]="field_EDFGEG//sdkjf_PP";
+ * const char inp8[]="field_____EDFGEG//sdkjf_____PP";
+ * const char exp8[]="field_EDFGEG//sdkjf_PP";
+ * const char inp9[]="_field_____EDFGEG//sdkjf_____PP_______________";
+ * const char exp9[]="field_EDFGEG//sdkjf_PP";
+ * const char inp10[]="___field_____EDFGEG//sdkjf_____PP_______________";
+ * const char exp10[]="field_EDFGEG//sdkjf_PP";
+*/
+std::string MEDFileFieldRepresentationTree::PostProcessFieldName(const std::string& fullFieldName)
+{
+  const char SEP('_');
+  std::vector<std::string> v(SplitFieldNameIntoParts(fullFieldName,SEP));
+  if(v.empty())
+    return fullFieldName;//should never happen
+  if(v.size()==1)
+    {
+      if(v[0].empty())
+        return fullFieldName;
+      else
+        return v[0];
+    }
+  std::string ret(v[0]);
+  for(std::size_t i=1;i<v.size();i++)
+    {
+      if(!v[i].empty())
+        {
+          if(!ret.empty())
+            { ret+=SEP; ret+=v[i]; }
+          else
+            ret=v[i];
+        }
+    }
+  if(ret.empty())
+    return fullFieldName;
+  return ret;
+}
+
 ///////////
 
 TimeKeeper::TimeKeeper(int policy):_policy(policy)