]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDLoader/MEDFileField.hxx
Salome HOME
Merge branch 'master' of https://git.salome-platform.org/git/tools/medcoupling
[tools/medcoupling.git] / src / MEDLoader / MEDFileField.hxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __MEDFILEFIELD_HXX__
22 #define __MEDFILEFIELD_HXX__
23
24 #include "MEDLoaderDefines.hxx"
25
26 #include "MEDFileFieldOverView.hxx"
27 #include "MEDFileUtilities.txx"
28 #include "MEDFileEntities.hxx"
29
30 #include "MCAuto.hxx"
31 #include "MEDLoaderTraits.hxx"
32 #include "MEDCouplingTraits.hxx"
33 #include "MEDCouplingRefCountObject.hxx"
34 #include "MEDCouplingFieldInt.hxx"
35 #include "MEDCouplingMemArray.hxx"
36 #include "MEDCouplingPartDefinition.hxx"
37
38 #include "NormalizedUnstructuredMesh.hxx"
39 #include "InterpKernelException.hxx"
40
41 #include <vector>
42 #include <string>
43 #include <list>
44 #include <set>
45
46 #include "med.h"
47
48 namespace MEDCoupling
49 {
50   class MEDFileFieldGlobs;
51   class MEDCouplingMesh;
52   class MEDCouplingFieldDouble;
53   class MEDFileMesh;
54   class MEDFileFieldVisitor;
55
56   class MEDFileGTKeeper
57   {
58   public:
59     virtual MEDFileGTKeeper *deepCopy() const = 0;
60     virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
61     virtual std::string getRepr() const = 0;
62     virtual bool isEqual(const MEDFileGTKeeper *other) const = 0;
63     virtual ~MEDFileGTKeeper();
64   };
65
66   class MEDFileGTKeeperSta : public MEDFileGTKeeper
67   {
68   public:
69     MEDFileGTKeeperSta(INTERP_KERNEL::NormalizedCellType gt):_geo_type(gt) { }
70     MEDFileGTKeeper *deepCopy() const;
71     INTERP_KERNEL::NormalizedCellType getGeoType() const;
72     std::string getRepr() const;
73     bool isEqual(const MEDFileGTKeeper *other) const;
74   private:
75     INTERP_KERNEL::NormalizedCellType _geo_type;
76   };
77
78
79   class MEDFileGTKeeperDyn : public MEDFileGTKeeper
80   {
81   public:
82     MEDFileGTKeeperDyn(const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileStructureElement *se);
83     MEDFileGTKeeper *deepCopy() const;
84     INTERP_KERNEL::NormalizedCellType getGeoType() const;
85     std::string getRepr() const;
86     bool isEqual(const MEDFileGTKeeper *other) const;
87     const MEDFileUMesh *getMesh() const { return _mesh; }
88     const MEDFileUMesh *getSection() const { return _section; }
89     const MEDFileStructureElement *getSE() const { return _se; }
90   private:
91     MCConstAuto<MEDFileUMesh> _mesh;
92     MCConstAuto<MEDFileUMesh> _section;
93     MCConstAuto<MEDFileStructureElement> _se;
94   };
95     
96   class MEDFileFieldLoc : public RefCountObject
97   {
98   public:
99     MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const;
100     MEDLOADER_EXPORT std::string getName() const { return _name; }
101     MEDLOADER_EXPORT void setName(const std::string& name);
102     static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
103     static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities);
104     static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
105     std::size_t getHeapMemorySizeWithoutChildren() const;
106     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
107     MEDFileFieldLoc *deepCopy() const;
108     bool isOnStructureElement() const;
109     const MEDFileGTKeeper *getUndergroundGTKeeper() const { return _gt; }
110     MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
111     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
112     MEDLOADER_EXPORT std::string repr() const;
113     MEDLOADER_EXPORT bool isName(const std::string& name) const { return _name==name; }
114     MEDLOADER_EXPORT int getDimension() const { return _dim; }
115     MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
116     MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
117     MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
118     MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
119     MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
120     MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _gt->getGeoType(); }
121     MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
122   private:
123     MEDFileFieldLoc(const MEDFileFieldLoc& other);
124     MEDFileFieldLoc(med_idt fid, const std::string& locName);
125     MEDFileFieldLoc(med_idt fid, int id, const MEDFileEntities *entities);
126     MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
127   private:
128     int _dim;
129     int _nb_gauss_pt;
130     INTERP_KERNEL::AutoCppPtr<MEDFileGTKeeper> _gt;
131     int _nb_node_per_cell;
132     std::string _name;
133     std::vector<double> _ref_coo;
134     std::vector<double> _gs_coo;
135     std::vector<double> _w;
136   };
137
138   /// @cond INTERNAL
139   class MEDFileAnyTypeField1TSWithoutSDA;
140   class MEDFileFieldPerMeshPerTypeCommon;
141   class MEDFileFieldPerMeshPerType;
142   class MEDFileField1TSWithoutSDA;
143   class MEDFileFieldNameScope;
144   class MEDFileFieldGlobsReal;
145   class MEDFileFieldPerMesh;
146
147   class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
148   {
149   public:
150     static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
151     static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int locId);
152     static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
153     std::size_t getHeapMemorySizeWithoutChildren() const;
154     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
155     MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerTypeCommon *father) const;
156     void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
157     void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
158     void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
159     void getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const;
160     void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
161     const MEDFileFieldPerMeshPerTypeCommon *getFather() const;
162     void loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc);
163     void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc);
164     void setNewStart(int newValueOfStart);
165     int getIteration() const;
166     int getOrder() const;
167     double getTime() const;
168     std::string getMeshName() const;
169     TypeOfField getType() const;
170     void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
171     void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
172     void setType(TypeOfField newType);
173     INTERP_KERNEL::NormalizedCellType getGeoType() const;
174     int getNumberOfComponents() const;
175     int getNumberOfTuples() const;
176     int getStart() const { return _start; }
177     int getEnd() const { return _end; }
178     void setEnd(int endd) { _end=endd; }
179     int getNumberOfVals() const { return _nval; }
180     DataArray *getOrCreateAndGetArray();
181     const DataArray *getOrCreateAndGetArray() const;
182     const std::vector<std::string>& getInfo() const;
183     std::string getProfile() const;
184     void setProfile(const std::string& newPflName);
185     std::string getLocalization() const;
186     void setLocalization(const std::string& newLocName);
187     int getLocId() const { return _loc_id; }
188     void setLocId(int newId) const { _loc_id=newId; }
189     void setFather(MEDFileFieldPerMeshPerTypeCommon *newFather) { _father=newFather; }
190     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
191     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
192     void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
193                          std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
194     void fillValues(int discId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
195     int fillEltIdsFromCode(int offset, const std::vector<int>& codeOfMesh, const MEDFileFieldGlobsReal& glob, int *ptToFill) const;
196     int fillTupleIds(int *ptToFill) const;
197     static int ConvertType(TypeOfField type, int locId);
198     static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
199     static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
200                                const DataArrayInt *explicitIdsInMesh, const std::vector<int>& newCode,
201                                MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >& result);
202     static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
203                                                                           bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
204                                                                           MEDFileFieldGlobsReal& glob, bool &notInExisting);
205     static MCAuto<MEDFileFieldPerMeshPerTypePerDisc> Aggregate(int &start, const std::vector<std::pair<int,const MEDFileFieldPerMeshPerTypePerDisc *> >& pms, const std::vector< std::vector< std::pair<int,int> > >& dts, TypeOfField tof, MEDFileFieldPerMeshPerType *father, std::vector<std::pair< int, std::pair<int,int> > >& extractInfo);
206     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type):_type(type),_father(fath),_start(-1),_end(-1),_nval(-1),_loc_id(-5),_profile_it(-1) { }
207   private:
208     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
209     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const std::string& dummy);
210     MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other);
211     MEDFileFieldPerMeshPerTypePerDisc();
212   private:
213     void goReadZeValuesInFile(med_idt fid, const std::string& fieldName, int nbOfCompo, int iteration, int order, med_entity_type menti, med_geometry_type mgeoti, unsigned char *startFeedingPtr);
214   private:
215     TypeOfField _type;
216     MEDFileFieldPerMeshPerTypeCommon *_father;
217     int _start;
218     int _end;
219     //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi)
220     int _nval;
221     std::string _profile;
222     std::string _localization;
223     //! only on assignement -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
224     mutable int _loc_id;
225     mutable int _profile_it;
226     MCAuto<PartDefinition> _pd;
227   public:
228     mutable int _tmp_work1;
229   };
230
231   class MEDFileFieldPerMeshPerTypeCommon : public RefCountObject, public MEDFileWritable
232   {
233   public:
234     std::size_t getHeapMemorySizeWithoutChildren() const;
235     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
236     void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
237     void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
238     void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
239     void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
240     const MEDFileFieldPerMesh *getFather() const;
241     void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
242     void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
243     void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
244     bool isUniqueLevel(int& dim) const;
245     void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
246     void fillFieldSplitedByType(std::vector< std::pair<int,int> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const;
247     int getIteration() const;
248     int getOrder() const;
249     double getTime() const;
250     std::string getMeshName() const;
251     void getSizes(int& globalSz, int& nbOfEntries) const;
252     int getNumberOfComponents() const;
253     bool presenceOfMultiDiscPerGeoType() const;
254     void pushDiscretization(MEDFileFieldPerMeshPerTypePerDisc *disc);
255     DataArray *getOrCreateAndGetArray();
256     const DataArray *getOrCreateAndGetArray() const;
257     const std::vector<std::string>& getInfo() const;
258     std::vector<std::string> getPflsReallyUsed() const;
259     std::vector<std::string> getLocsReallyUsed() const;
260     std::vector<std::string> getPflsReallyUsedMulti() const;
261     std::vector<std::string> getLocsReallyUsedMulti() const;
262     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
263     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
264     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId);
265     const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const;
266     int getNumberOfLoc() const { return _field_pm_pt_pd.size(); }
267     void fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
268     void setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
269     bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
270     bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
271     static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
272     MEDFileFieldPerMeshPerTypeCommon(MEDFileFieldPerMesh *father):_father(father) { }
273     void setFather(MEDFileFieldPerMesh *father);
274     void accept(MEDFileFieldVisitor& visitor) const;
275   public:
276     virtual ~MEDFileFieldPerMeshPerTypeCommon();
277     virtual void getDimension(int& dim) const = 0;
278     virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
279     virtual void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const = 0;
280     virtual void simpleRepr(int bkOffset, std::ostream& oss, int id) const = 0;
281     virtual std::string getGeoTypeRepr() const = 0;
282     virtual MEDFileFieldPerMeshPerTypeCommon *deepCopy(MEDFileFieldPerMesh *father) const = 0;
283     virtual void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const = 0;
284   protected:
285     void deepCopyElements();
286     std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
287     std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
288     std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells);
289     std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells);
290   private:
291     MEDFileFieldPerMesh *_father;
292   protected:
293     std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
294   };
295
296   class MEDFileFieldPerMeshPerType : public MEDFileFieldPerMeshPerTypeCommon
297   {
298   public:
299     static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
300     static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
301     static MCAuto<MEDFileFieldPerMeshPerType> Aggregate(int &start, const std::vector< std::pair<int,const MEDFileFieldPerMeshPerType *> >& pms, const std::vector< std::vector< std::pair<int,int> > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector<std::pair< int, std::pair<int,int> > >& extractInfo);
302   public:// overload of abstract methods
303     void getDimension(int& dim) const;
304     INTERP_KERNEL::NormalizedCellType getGeoType() const;
305     void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
306     void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
307     std::string getGeoTypeRepr() const;
308     MEDFileFieldPerMeshPerType *deepCopy(MEDFileFieldPerMesh *father) const;
309     void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
310   private:
311     MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
312     MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *father, INTERP_KERNEL::NormalizedCellType gt);
313   private:
314     INTERP_KERNEL::NormalizedCellType _geo_type;
315   };
316
317   class MEDFileFieldPerMeshPerTypeDyn : public MEDFileFieldPerMeshPerTypeCommon
318   {
319   public:
320     static MEDFileFieldPerMeshPerTypeDyn *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileEntities *entities, int idGT, const MEDFileFieldNameScope& nasc);
321     int getDynGT() const;
322     std::string getModelName() const;
323   public:
324     void getDimension(int& dim) const;
325     INTERP_KERNEL::NormalizedCellType getGeoType() const;
326     void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
327     void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
328     std::string getGeoTypeRepr() const;
329     MEDFileFieldPerMeshPerTypeDyn *deepCopy(MEDFileFieldPerMesh *father) const;
330     void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
331   private:
332     MEDFileFieldPerMeshPerTypeDyn(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileStructureElement *se, const MEDFileFieldNameScope& nasc);
333   private:
334     MCConstAuto<MEDFileStructureElement> _se;
335   };
336   
337   class MEDFileMesh;
338
339   class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
340   {
341   public:
342     static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
343     static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
344     std::size_t getHeapMemorySizeWithoutChildren() const;
345     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
346     MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
347     void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
348     void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
349     void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const std::vector<int>& code, const std::vector<int>& code2, const std::vector<DataArrayInt *>& idsInPflPerType, const std::vector<DataArrayInt *>& idsPerType, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
350     void assignFieldNoProfileNoRenum(int& start, const std::vector<int>& code, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
351     void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
352     void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
353     void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
354     void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
355     void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
356     void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
357     std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
358     void accept(MEDFileFieldVisitor& visitor) const;
359     void getDimension(int& dim) const;
360     bool isUniqueLevel(int& dim) const;
361     double getTime() const;
362     int getIteration() const;
363     int getOrder() const;
364     int getMeshIteration() const { return _mesh_iteration; }
365     int getMeshOrder() const { return _mesh_order; }
366     std::string getMeshName() const { return _mesh_name; }
367     int getNumberOfComponents() const;
368     bool presenceOfMultiDiscPerGeoType() const;
369     bool presenceOfStructureElements() const;
370     bool onlyStructureElements() const;
371     void killStructureElements();
372     void keepOnlyStructureElements();
373     void keepOnlyOnSE(const std::string& seName);
374     void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
375     DataArray *getOrCreateAndGetArray();
376     const DataArray *getOrCreateAndGetArray() const;
377     const std::vector<std::string>& getInfo() const;
378     std::vector<std::string> getPflsReallyUsed() const;
379     std::vector<std::string> getLocsReallyUsed() const;
380     std::vector<std::string> getPflsReallyUsedMulti() const;
381     std::vector<std::string> getLocsReallyUsedMulti() const;
382     void convertMedBallIntoClassic();
383     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
384     bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
385     void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
386     void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
387     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
388     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
389     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
390     DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
391     void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
392     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId);
393     const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const;
394     static MCAuto<MEDFileFieldPerMesh> Aggregate(int &start, const std::vector<const MEDFileFieldPerMesh *>& pms, const std::vector< std::vector< std::pair<int,int> > >& dts, MEDFileAnyTypeField1TSWithoutSDA *father, std::vector<std::pair< int, std::pair<int,int> > >& extractInfo);
395   private:
396     int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
397     MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
398                                         const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
399     MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
400                                          const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
401                                          const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
402                                          const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
403     MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
404                                              const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
405                                              const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
406     DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
407     void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
408     static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type, 
409                                   const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes, const std::vector< std::pair<int,int> >& dads, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& locs,
410                                   std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
411     static int ComputeNbOfElems(const MEDFileFieldGlobsReal *glob, TypeOfField type, const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes, const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs);
412     MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
413     MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
414     MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_father(fath),_mesh_name(meshName),_mesh_iteration(meshIt),_mesh_order(meshOrd) { }
415   private:
416     std::string _mesh_name;
417     int _mesh_iteration;
418     int _mesh_order;
419     MEDFileAnyTypeField1TSWithoutSDA *_father;
420     std::vector< MCAuto< MEDFileFieldPerMeshPerTypeCommon > > _field_pm_pt;
421   };
422
423   class MEDFileFieldGlobsReal;
424
425   class MEDFileFieldGlobs : public RefCountObject
426   {
427   public:
428     static MEDFileFieldGlobs *New(med_idt fid);
429     static MEDFileFieldGlobs *New();
430     std::size_t getHeapMemorySizeWithoutChildren() const;
431     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
432     MEDFileFieldGlobs *deepCopy() const;
433     MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
434     MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
435     void simpleRepr(std::ostream& oss) const;
436     void appendGlobs(const MEDFileFieldGlobs& other, double eps);
437     void checkGlobsPflsPartCoherency(const std::vector<std::string>& pflsUsed) const;
438     void checkGlobsLocsPartCoherency(const std::vector<std::string>& locsUsed) const;
439     void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
440     void loadProfileInFile(med_idt fid, int id);
441     void loadGlobals(med_idt fid, const MEDFileFieldGlobsReal& real);
442     void loadAllGlobals(med_idt fid, const MEDFileEntities *entities);
443     void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
444     std::vector<std::string> getPfls() const;
445     std::vector<std::string> getLocs() const;
446     bool existsPfl(const std::string& pflName) const;
447     bool existsLoc(const std::string& locName) const;
448     std::string createNewNameOfPfl() const;
449     std::string createNewNameOfLoc() const;
450     std::vector< std::vector<int> > whichAreEqualProfiles() const;
451     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
452     void setFileName(const std::string& fileName) { _file_name=fileName; }
453     void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
454     void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
455     int getNbOfGaussPtPerCell(int locId) const;
456     int getLocalizationId(const std::string& loc) const;
457     std::string getFileName() const { return _file_name; }
458     const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
459     const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
460     const DataArrayInt *getProfileFromId(int pflId) const;
461     const DataArrayInt *getProfile(const std::string& pflName) const;
462     MEDFileFieldLoc& getLocalizationFromId(int locId);
463     MEDFileFieldLoc& getLocalization(const std::string& locName);
464     DataArrayInt *getProfile(const std::string& pflName);
465     DataArrayInt *getProfileFromId(int pflId);
466     void killProfileIds(const std::vector<int>& pflIds);
467     void killLocalizationIds(const std::vector<int>& locIds);
468     void killStructureElementsInGlobs();
469     //
470     void appendProfile(DataArrayInt *pfl);
471     void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
472     //
473     static std::string CreateNewNameNotIn(const std::string& prefix, const std::vector<std::string>& namesToAvoid);
474   protected:
475     MEDFileFieldGlobs(med_idt fid);
476     MEDFileFieldGlobs();
477     ~MEDFileFieldGlobs();
478   protected:
479     std::vector< MCAuto<DataArrayInt> > _pfls;
480     std::vector< MCAuto<MEDFileFieldLoc> > _locs;
481     std::string _file_name;
482   };
483
484   /// @endcond INTERNAL
485
486   class MEDFileFieldGlobsReal
487   {
488   public:
489     MEDLOADER_EXPORT MEDFileFieldGlobsReal(med_idt fid);
490     MEDLOADER_EXPORT MEDFileFieldGlobsReal();
491     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
492     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
493     MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const;
494     MEDLOADER_EXPORT void resetContent();
495     MEDLOADER_EXPORT void killStructureElementsInGlobs();
496     MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
497     MEDLOADER_EXPORT void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
498     MEDLOADER_EXPORT void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
499     MEDLOADER_EXPORT void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
500     MEDLOADER_EXPORT void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
501     MEDLOADER_EXPORT void checkGlobsCoherency() const;
502     MEDLOADER_EXPORT void checkGlobsPflsPartCoherency() const;
503     MEDLOADER_EXPORT void checkGlobsLocsPartCoherency() const;
504     MEDLOADER_EXPORT virtual std::vector<std::string> getPflsReallyUsed() const = 0;
505     MEDLOADER_EXPORT virtual std::vector<std::string> getLocsReallyUsed() const = 0;
506     MEDLOADER_EXPORT virtual std::vector<std::string> getPflsReallyUsedMulti() const = 0;
507     MEDLOADER_EXPORT virtual std::vector<std::string> getLocsReallyUsedMulti() const = 0;
508     MEDLOADER_EXPORT virtual void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
509     MEDLOADER_EXPORT virtual void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
510     MEDLOADER_EXPORT virtual ~MEDFileFieldGlobsReal();
511     //
512     MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
513     MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id);
514     MEDLOADER_EXPORT void loadGlobals(med_idt fid);
515     MEDLOADER_EXPORT void loadAllGlobals(med_idt fid, const MEDFileEntities *entities=0);
516     MEDLOADER_EXPORT void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
517     MEDLOADER_EXPORT std::vector<std::string> getPfls() const;
518     MEDLOADER_EXPORT std::vector<std::string> getLocs() const;
519     MEDLOADER_EXPORT bool existsPfl(const std::string& pflName) const;
520     MEDLOADER_EXPORT bool existsLoc(const std::string& locName) const;
521     MEDLOADER_EXPORT std::string createNewNameOfPfl() const;
522     MEDLOADER_EXPORT std::string createNewNameOfLoc() const;
523     MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualProfiles() const;
524     MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
525     MEDLOADER_EXPORT void setFileName(const std::string& fileName);
526     MEDLOADER_EXPORT void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
527     MEDLOADER_EXPORT void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
528     MEDLOADER_EXPORT void changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
529     MEDLOADER_EXPORT void changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
530     MEDLOADER_EXPORT void changePflName(const std::string& oldName, const std::string& newName);
531     MEDLOADER_EXPORT void changeLocName(const std::string& oldName, const std::string& newName);
532     MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipPflsNames();
533     MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipLocsNames(double eps);
534     MEDLOADER_EXPORT int getNbOfGaussPtPerCell(int locId) const;
535     MEDLOADER_EXPORT int getLocalizationId(const std::string& loc) const;
536     MEDLOADER_EXPORT std::string getFileName() const;
537     MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
538     MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
539     MEDLOADER_EXPORT MEDFileFieldLoc& getLocalizationFromId(int locId);
540     MEDLOADER_EXPORT MEDFileFieldLoc& getLocalization(const std::string& locName);
541     MEDLOADER_EXPORT const DataArrayInt *getProfile(const std::string& pflName) const;
542     MEDLOADER_EXPORT const DataArrayInt *getProfileFromId(int pflId) const;
543     MEDLOADER_EXPORT DataArrayInt *getProfile(const std::string& pflName);
544     MEDLOADER_EXPORT DataArrayInt *getProfileFromId(int pflId);
545     MEDLOADER_EXPORT void killProfileIds(const std::vector<int>& pflIds);
546     MEDLOADER_EXPORT void killLocalizationIds(const std::vector<int>& locIds);
547     //
548     MEDLOADER_EXPORT void appendProfile(DataArrayInt *pfl);
549     MEDLOADER_EXPORT void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
550   protected:
551     MEDFileFieldGlobs *contentNotNull();
552     const MEDFileFieldGlobs *contentNotNull() const;
553   protected:
554     MCAuto< MEDFileFieldGlobs > _globals;
555   };
556
557   class MEDFileFieldNameScope
558   {
559   public:
560     MEDLOADER_EXPORT MEDFileFieldNameScope();
561     MEDLOADER_EXPORT MEDFileFieldNameScope(const std::string& fieldName);
562     MEDLOADER_EXPORT std::string getName() const;
563     MEDLOADER_EXPORT void setName(const std::string& fieldName);
564     MEDLOADER_EXPORT std::string getDtUnit() const;
565     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
566     MEDLOADER_EXPORT void copyNameScope(const MEDFileFieldNameScope& other);
567   protected:
568     std::string _name;
569     std::string _dt_unit;
570   };
571
572   class MEDFileMeshes;
573
574   /*!
575    * SDA is for Shared Data Arrays such as profiles.
576    */
577   class MEDFileAnyTypeField1TSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
578   {
579   public:
580     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA();
581     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order);
582     MEDLOADER_EXPORT int getIteration() const { return _iteration; }
583     MEDLOADER_EXPORT int getOrder() const { return _order; }
584     MEDLOADER_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
585     MEDLOADER_EXPORT void setTime(int iteration, int order, double val) { _dt=val; _iteration=iteration; _order=order; }
586     MEDLOADER_EXPORT int getDimension() const;
587     MEDLOADER_EXPORT std::string getMeshName() const;
588     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
589     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
590     MEDLOADER_EXPORT int getMeshIteration() const;
591     MEDLOADER_EXPORT int getMeshOrder() const;
592     MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
593     MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
594     MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
595     MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
596     MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
597     //
598     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
599     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
600     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
601     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
602     MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
603     MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
604     //
605     MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
606     MEDLOADER_EXPORT void convertMedBallIntoClassic();
607     MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
608     MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
609     //
610     MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
611     MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
612     MEDLOADER_EXPORT void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other);
613     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
614   public:
615     MEDLOADER_EXPORT int getNumberOfComponents() const;
616     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
617     MEDLOADER_EXPORT std::vector<std::string>& getInfo();
618     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
619     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
620     MEDLOADER_EXPORT bool onlyStructureElements() const;
621     MEDLOADER_EXPORT void killStructureElements();
622     MEDLOADER_EXPORT void keepOnlyStructureElements();
623     MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
624     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
625     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
626     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
627     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
628     MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
629     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
630     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
631     MEDLOADER_EXPORT virtual void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
632     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *deepCopy() const = 0;
633     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const = 0;
634     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const;
635     MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
636     MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArray() const = 0;
637     MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const = 0;
638     MEDLOADER_EXPORT virtual void setArray(DataArray *arr) = 0;
639     MEDLOADER_EXPORT virtual DataArray *createNewEmptyDataArrayInstance() const = 0;
640     MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
641     MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
642   public:
643     MEDLOADER_EXPORT MEDCouplingFieldDouble *fieldOnMesh(const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const;
644     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
645     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
646     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
647     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
648     DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
649   public:
650     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
651     MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
652     MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
653     MEDLOADER_EXPORT int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its);
654     MEDLOADER_EXPORT int keepOnlyGaussDiscretization(std::size_t idOfDisc, std::vector< std::pair<int,int> >& its);
655   public:
656     MEDLOADER_EXPORT void allocNotFromFile(int newNbOfTuples);
657     MEDLOADER_EXPORT bool allocIfNecessaryTheArrayToReceiveDataFromFile();
658     MEDLOADER_EXPORT void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities);
659     MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
660     MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
661     MEDLOADER_EXPORT void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities);
662     MEDLOADER_EXPORT void unloadArrays();
663     MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const;
664   protected:
665     int getMeshIdFromMeshName(const std::string& mName) const;
666     int addNewEntryIfNecessary(const MEDCouplingMesh *mesh);
667     void updateData(int newLgth, const std::vector< std::pair<int,int> >& oldStartStops);
668   protected:
669     std::vector< MCAuto< MEDFileFieldPerMesh > > _field_per_mesh;
670     int _iteration;
671     int _order;
672     double _dt;
673   public:
674     //! only useable on reading
675     mutable int _csit;
676     // -3 means allocated and build from scratch
677     // -2 means allocated and read from a file
678     // -1 means not allocated and build from scratch
679     // >=0 means not allocated and read from a file
680     mutable int _nb_of_tuples_to_be_allocated;
681   };
682
683   class MEDFileIntField1TSWithoutSDA;
684
685   template<class T>
686   class MEDFileField1TSTemplateWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
687   {
688   protected:
689     MEDFileField1TSTemplateWithoutSDA(const std::string& fieldName, int csit, int iteration, int order):MEDFileAnyTypeField1TSWithoutSDA(fieldName,csit,iteration,order) { }
690     MEDFileField1TSTemplateWithoutSDA():MEDFileAnyTypeField1TSWithoutSDA() { }
691   public:
692     MEDLOADER_EXPORT void setArray(DataArray *arr);
693     MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
694     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getOrCreateAndGetArrayTemplate();
695     MEDLOADER_EXPORT typename Traits<T>::ArrayType const *getOrCreateAndGetArrayTemplate() const;
696     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getUndergroundDataArrayTemplate() const;
697     MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
698     MEDLOADER_EXPORT const DataArray *getOrCreateAndGetArray() const;
699     MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
700     MEDLOADER_EXPORT void aggregate(const typename std::vector< typename MLFieldTraits<T>::F1TSWSDAType const * >& f1tss, const std::vector< std::vector< std::pair<int,int> > >& dts);
701   protected:
702     MCAuto< typename Traits<T>::ArrayType > _arr;
703   };
704
705   /*!
706    * SDA is for Shared Data Arrays such as profiles.
707    */
708   class MEDFileField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<double>
709   {
710   public:
711     MEDLOADER_EXPORT const char *getTypeStr() const;
712     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
713     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDoubleExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
714     MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
715     MEDLOADER_EXPORT static void CheckMeshDimRel(int meshDimRelToMax);
716     MEDLOADER_EXPORT static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh);
717     MEDLOADER_EXPORT static MEDFileField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
718   public:
719     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA();
720     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
721     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *shallowCpy() const;
722     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *deepCopy() const;
723     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const;
724   public:
725     static const char TYPE_STR[];
726   };
727
728   /*!
729    * SDA is for Shared Data Arrays such as profiles.
730    */
731   class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<int>
732   {
733   public:
734     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
735     MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
736     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *deepCopy() const;
737     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *shallowCpy() const;
738     MEDLOADER_EXPORT const char *getTypeStr() const;
739     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
740     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
741     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
742   protected:
743     MEDFileIntField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
744   public:
745     MEDLOADER_EXPORT static const char TYPE_STR[];
746   };
747
748   /*!
749    * User class.
750    */
751   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
752   {
753   protected:
754     MEDLOADER_EXPORT MEDFileAnyTypeField1TS();
755     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
756     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
757     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
758     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
759     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c);
760     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, med_idt fid);
761     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
762     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
763     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
764     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
765     // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
766   public:
767     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
768     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, bool loadAll=true);
769     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
770     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
771     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
772     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
773     MEDLOADER_EXPORT int getDimension() const;
774     MEDLOADER_EXPORT int getIteration() const;
775     MEDLOADER_EXPORT int getOrder() const;
776     MEDLOADER_EXPORT double getTime(int& iteration, int& order) const;
777     MEDLOADER_EXPORT void setTime(int iteration, int order, double val);
778     MEDLOADER_EXPORT std::string getName() const;
779     MEDLOADER_EXPORT void setName(const std::string& name);
780     MEDLOADER_EXPORT std::string simpleRepr() const;
781     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
782     MEDLOADER_EXPORT std::string getDtUnit() const;
783     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
784     MEDLOADER_EXPORT std::string getMeshName() const;
785     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
786     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
787     MEDLOADER_EXPORT int getMeshIteration() const;
788     MEDLOADER_EXPORT int getMeshOrder() const;
789     MEDLOADER_EXPORT int getNumberOfComponents() const;
790     MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
791     MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
792     MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
793     MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
794     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
795     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
796     MEDLOADER_EXPORT std::vector<std::string>& getInfo();
797     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
798     MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
799     MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
800         std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
801     MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
802     MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
803     MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
804     MEDLOADER_EXPORT void convertMedBallIntoClassic();
805     MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
806   public:
807     MEDLOADER_EXPORT void loadArrays();
808     MEDLOADER_EXPORT void loadArraysIfNecessary();
809     MEDLOADER_EXPORT void unloadArrays();
810     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
811     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitComponents() const;
812     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
813     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
814     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCopy() const;
815     MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
816     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
817   public:
818     //! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
819     MEDLOADER_EXPORT void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
820     //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
821     MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
822     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
823     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
824     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
825     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
826     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
827     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
828     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
829     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
830   public:
831     MEDLOADER_EXPORT static int LocateField2(med_idt fid, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
832     MEDLOADER_EXPORT static int LocateField(med_idt fid, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
833   public:
834     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const = 0;
835   public:
836     MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
837     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
838     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const;
839   protected:
840     MCAuto<MEDFileAnyTypeField1TSWithoutSDA> _content;
841   };
842
843   class MEDFileIntField1TS;
844
845   /*!
846    * User class.
847    */
848   class MEDFileField1TS : public MEDFileAnyTypeField1TS
849   {
850   public:
851     MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
852     MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, bool loadAll=true);
853     MEDLOADER_EXPORT static MEDFileField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileField1TS>(db); }
854     MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
855     MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
856     MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
857     MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
858     MEDLOADER_EXPORT static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
859     MEDLOADER_EXPORT static MEDFileField1TS *New();
860     MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
861     //
862     MEDLOADER_EXPORT MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
863     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
864     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
865     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
866     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
867     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
868     MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
869     //
870     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
871     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
872     // direct forwarding to MEDFileField1TSWithoutSDA instance _content
873   public:
874     MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const;
875     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const;
876     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
877
878     MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
879         std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
880   public:
881     MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
882     MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MCAuto<DataArray>& arr);
883   public:
884     MEDLOADER_EXPORT MEDFileField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
885   private:
886     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
887     const MEDFileField1TSWithoutSDA *contentNotNull() const;
888     MEDFileField1TSWithoutSDA *contentNotNull();
889   private:
890     ~MEDFileField1TS() { }
891     MEDFileField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
892     MEDFileField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
893     MEDFileField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
894     MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
895     MEDFileField1TS();
896   };
897
898   class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
899   {
900   public:
901     MEDLOADER_EXPORT static MEDFileIntField1TS *New();
902     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
903     MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, bool loadAll=true);
904     MEDLOADER_EXPORT static MEDFileIntField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntField1TS>(db); }
905     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
906     MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
907     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
908     MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
909     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
910     MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
911     MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const;
912     //
913     MEDLOADER_EXPORT MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
914     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
915     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
916     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
917     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
918     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
919     MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
920     //
921     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
922     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
923     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
924   public:
925     MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr);
926     MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldInt> SetDataArrayDoubleInIntField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
927     MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
928   public:
929     MEDLOADER_EXPORT MEDFileIntField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
930   private:
931     med_field_type getMEDFileFieldType() const { return MED_INT32; }
932     const MEDFileIntField1TSWithoutSDA *contentNotNull() const;
933     MEDFileIntField1TSWithoutSDA *contentNotNull();
934   private:
935     ~MEDFileIntField1TS() { }
936     MEDFileIntField1TS();
937     MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
938     MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
939     MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
940     MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
941   };
942
943   class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
944   {
945   protected:
946     MEDFileAnyTypeFieldMultiTSWithoutSDA();
947     MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName);
948     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
949     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
950   public:
951     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
952     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
953     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCopy() const;
954     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
955     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
956     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
957     MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
958     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const = 0;
959     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const = 0;
960     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const = 0;
961     MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const = 0;
962     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
963     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
964     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
965     MEDLOADER_EXPORT int getTimeStepPos(int iteration, int order) const;
966     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const;
967     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order);
968     MEDLOADER_EXPORT std::string getMeshName() const;
969     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
970     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
971     MEDLOADER_EXPORT int getNumberOfTS() const;
972     MEDLOADER_EXPORT void eraseEmptyTS();
973     MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
974     MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
975     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds(const int *startIds, const int *endIds) const;
976     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds2(int bg, int end, int step) const;
977     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
978     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
979     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
980     MEDLOADER_EXPORT bool onlyStructureElements() const;
981     MEDLOADER_EXPORT void killStructureElements();
982     MEDLOADER_EXPORT void keepOnlyStructureElements();
983     MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
984     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
985     MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
986     MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
987     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
988     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
989     MEDLOADER_EXPORT void pushBackTimeStep(MCAuto<MEDFileAnyTypeField1TSWithoutSDA>& tse);
990     MEDLOADER_EXPORT void synchronizeNameScope();
991     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
992     MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
993     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
994     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob);
995     MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
996     MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
997     MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
998     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
999     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
1000     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
1001     MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1002     MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
1003     MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
1004     MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
1005     MEDLOADER_EXPORT void unloadArrays();
1006   public:
1007     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const;
1008     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos);
1009     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
1010     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
1011     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
1012     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
1013     MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1014     MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1015     MEDLOADER_EXPORT void setIteration(int i, MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ts);
1016   protected:
1017     virtual med_field_type getMEDFileFieldType() const = 0;
1018     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
1019     void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field, const DataArray *arr) const;
1020     void checkThatComponentsMatch(const std::vector<std::string>& compos) const;
1021     void checkThatNbOfCompoOfTSMatchThis() const;
1022   protected:
1023     std::vector<std::string> _infos;
1024     std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
1025   };
1026
1027   class MEDFileIntFieldMultiTSWithoutSDA;
1028
1029   class MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1030   {
1031   public:
1032     MEDLOADER_EXPORT static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1033     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1034     MEDLOADER_EXPORT const char *getTypeStr() const;
1035     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1036     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1037     MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
1038     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
1039   protected:
1040     MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName);
1041     MEDFileFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1042     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
1043     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1044     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1045   public:
1046     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA();
1047   };
1048
1049   class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1050   {
1051   public:
1052     MEDLOADER_EXPORT static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1053     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1054     MEDLOADER_EXPORT const char *getTypeStr() const;
1055     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1056     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1057     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
1058   protected:
1059     MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName);
1060     MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1061     med_field_type getMEDFileFieldType() const { return MED_INT32; }
1062     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1063     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1064   public:
1065     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA();
1066   };
1067
1068   class MEDFileAnyTypeFieldMultiTSIterator;
1069   class MEDFileFastCellSupportComparator;
1070   /*!
1071    * User class.
1072    */
1073   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
1074   {
1075   protected:
1076     MEDFileAnyTypeFieldMultiTS();
1077     MEDFileAnyTypeFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1078     MEDFileAnyTypeFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1079     MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1080     static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, med_idt fid);
1081     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1082     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1083   public:
1084     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1085     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, bool loadAll=true);
1086     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1087     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1088     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c);
1089     MEDLOADER_EXPORT void loadArrays();
1090     MEDLOADER_EXPORT void loadArraysIfNecessary();
1091     MEDLOADER_EXPORT void unloadArrays();
1092     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1093     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1094     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1095     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1096     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCopy() const;
1097     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
1098     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
1099     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
1100     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const = 0;
1101     MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const = 0;
1102     //
1103     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const = 0;
1104     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1105     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1106     MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitIntoCommonTimeSeries(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS);
1107     MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& fsc);
1108     MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
1109   public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
1110     MEDLOADER_EXPORT std::string getName() const;
1111     MEDLOADER_EXPORT void setName(const std::string& name);
1112     MEDLOADER_EXPORT std::string getDtUnit() const;
1113     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
1114     MEDLOADER_EXPORT std::string getMeshName() const;
1115     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
1116     MEDLOADER_EXPORT std::string simpleRepr() const;
1117     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
1118     MEDLOADER_EXPORT int getNumberOfTS() const;
1119     MEDLOADER_EXPORT void eraseEmptyTS();
1120     MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
1121     MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
1122     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPart(const int *startIds, const int *endIds) const;
1123     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPartSlice(int bg, int end, int step) const;
1124     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
1125     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
1126     MEDLOADER_EXPORT void pushBackTimeSteps(const std::vector<MEDFileAnyTypeField1TS *>& f1ts);
1127     MEDLOADER_EXPORT void pushBackTimeSteps(MEDFileAnyTypeFieldMultiTS *fmts);
1128     MEDLOADER_EXPORT void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
1129     MEDLOADER_EXPORT void synchronizeNameScope();
1130     MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
1131     MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
1132     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator *iterator();
1133     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1134     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
1135     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
1136     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
1137     MEDLOADER_EXPORT int getNumberOfComponents() const;
1138     MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
1139     MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
1140     MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
1141     MEDLOADER_EXPORT MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
1142   public:
1143     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const = 0;
1144     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1145     MEDLOADER_EXPORT static MCAuto<MEDFileAnyTypeFieldMultiTS> Aggregate(const std::vector<const MEDFileAnyTypeFieldMultiTS *>& fmtss, const std::vector< std::vector< std::pair<int,int> > >& dts);
1146   public:
1147     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1148     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1149     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1150     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1151     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1152     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1153   protected:
1154     MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase();
1155     const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const;
1156   private:
1157     static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& cmps);
1158   protected:
1159     MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
1160   };
1161
1162   class MEDFileIntFieldMultiTS;
1163
1164   /*!
1165    * User class.
1166    */
1167   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1168   {
1169   public:
1170     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New();
1171     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1172     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, bool loadAll=true);
1173     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFieldMultiTS>(db); }
1174     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1175     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1176     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1177     MEDLOADER_EXPORT static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1178     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1179     MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1180     MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
1181     //
1182     MEDLOADER_EXPORT MEDFileField1TS *getTimeStepAtPos(int pos) const;
1183     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1184     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1185     //
1186     MEDLOADER_EXPORT MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
1187     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1188     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1189     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1190     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1191     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1192     MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1193     //
1194     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
1195     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1196     MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
1197     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
1198     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1199   public:
1200     MEDLOADER_EXPORT MEDFileFieldMultiTS *buildNewEmpty() const;
1201   private:
1202     const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const;
1203     MEDFileFieldMultiTSWithoutSDA *contentNotNull();
1204   private:
1205     ~MEDFileFieldMultiTS() { }
1206     MEDFileFieldMultiTS();
1207     MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1208     MEDFileFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1209     MEDFileFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1210   };
1211
1212   /*!
1213    * User class.
1214    */
1215   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1216   {
1217   public:
1218     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New();
1219     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1220     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, bool loadAll=true);
1221     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntFieldMultiTS>(db); }
1222     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1223     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1224     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1225     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1226     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1227     MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1228     MEDLOADER_EXPORT MEDFileIntField1TS *getTimeStepAtPos(int pos) const;
1229     MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
1230     //
1231     MEDLOADER_EXPORT MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
1232     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1233     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1234     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1235     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1236     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
1237     MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1238     //
1239     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
1240     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1241     //
1242     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
1243   public:
1244     MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const;
1245   private:
1246     const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const;
1247     MEDFileIntFieldMultiTSWithoutSDA *contentNotNull();
1248   private:
1249     ~MEDFileIntFieldMultiTS() { }
1250     MEDFileIntFieldMultiTS();
1251     MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1252     MEDFileIntFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1253     MEDFileIntFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1254   };
1255
1256   class MEDFileAnyTypeFieldMultiTSIterator
1257   {
1258   public:
1259     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator(MEDFileAnyTypeFieldMultiTS *fmts);
1260     MEDLOADER_EXPORT ~MEDFileAnyTypeFieldMultiTSIterator();
1261     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
1262   private:
1263     MCAuto<MEDFileAnyTypeFieldMultiTS> _fmts;
1264     int _iter_id;
1265     int _nb_iter;
1266   };
1267
1268   class MEDFileFieldsIterator;
1269   class MEDFileStructureElements;
1270   
1271   /*!
1272    * Use class.
1273    */
1274   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1275   {
1276   public:
1277     MEDLOADER_EXPORT static MEDFileFields *New();
1278     MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
1279     MEDLOADER_EXPORT static MEDFileFields *New(med_idt fid, bool loadAll=true);
1280     MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
1281     MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(med_idt fid, const MEDFileStructureElements *se, bool loadAll=true);
1282     MEDLOADER_EXPORT static MEDFileFields *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFields>(db); }
1283     MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
1284     MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1285     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1286     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1287     MEDLOADER_EXPORT MEDFileFields *deepCopy() const;
1288     MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
1289     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1290     MEDLOADER_EXPORT void loadArrays();
1291     MEDLOADER_EXPORT void loadArraysIfNecessary();
1292     MEDLOADER_EXPORT void unloadArrays();
1293     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1294     MEDLOADER_EXPORT int getNumberOfFields() const;
1295     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const;
1296     MEDLOADER_EXPORT std::vector<std::string> getFieldsNames() const;
1297     MEDLOADER_EXPORT std::vector<std::string> getMeshesNames() const;
1298     MEDLOADER_EXPORT std::string simpleRepr() const;
1299     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss) const;
1300     //
1301     MEDLOADER_EXPORT void resize(int newSize);
1302     MEDLOADER_EXPORT void pushField(MEDFileAnyTypeFieldMultiTS *field);
1303     MEDLOADER_EXPORT void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields);
1304     MEDLOADER_EXPORT void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
1305     MEDLOADER_EXPORT int getPosFromFieldName(const std::string& fieldName) const;
1306     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
1307     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
1308     MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
1309     MEDLOADER_EXPORT bool removeFieldsWithoutAnyTimeStep();
1310     MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
1311     MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1312     MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1313     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
1314     MEDLOADER_EXPORT void killStructureElements();
1315     MEDLOADER_EXPORT void keepOnlyStructureElements();
1316     MEDLOADER_EXPORT void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
1317     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
1318     MEDLOADER_EXPORT void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
1319     MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisOnStructureElements() const;
1320     MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const;
1321     MEDLOADER_EXPORT void aggregate(const MEDFileFields& other);
1322     MEDLOADER_EXPORT MEDFileFieldsIterator *iterator();
1323     MEDLOADER_EXPORT void destroyFieldAtPos(int i);
1324     MEDLOADER_EXPORT void destroyFieldsAtPos(const int *startIds, const int *endIds);
1325     MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
1326     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1327     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
1328     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
1329   public:
1330     MEDLOADER_EXPORT MEDFileFields *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1331   public:
1332     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1333     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1334     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1335     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1336     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1337     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1338   private:
1339     ~MEDFileFields() { }
1340     MEDFileFields();
1341     MEDFileFields(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1342   private:
1343     std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
1344   };
1345
1346   class MEDFileFieldsIterator
1347   {
1348   public:
1349     MEDLOADER_EXPORT MEDFileFieldsIterator(MEDFileFields *fs);
1350     MEDLOADER_EXPORT ~MEDFileFieldsIterator();
1351     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
1352   private:
1353     MCAuto<MEDFileFields> _fs;
1354     int _iter_id;
1355     int _nb_iter;
1356   };
1357 }
1358
1359 #endif