Salome HOME
Improve swig generation process on Windows platform.
[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;
367     void setMeshName(const std::string& meshName);
368     int getNumberOfComponents() const;
369     bool presenceOfMultiDiscPerGeoType() const;
370     bool presenceOfStructureElements() const;
371     bool onlyStructureElements() const;
372     void killStructureElements();
373     void keepOnlyStructureElements();
374     void keepOnlyOnSE(const std::string& seName);
375     void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
376     DataArray *getOrCreateAndGetArray();
377     const DataArray *getOrCreateAndGetArray() const;
378     const std::vector<std::string>& getInfo() const;
379     std::vector<std::string> getPflsReallyUsed() const;
380     std::vector<std::string> getLocsReallyUsed() const;
381     std::vector<std::string> getPflsReallyUsedMulti() const;
382     std::vector<std::string> getLocsReallyUsedMulti() const;
383     void convertMedBallIntoClassic();
384     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
385     bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
386     void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
387     void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
388     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
389     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
390     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
391     DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
392     void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
393     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId);
394     const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const;
395     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);
396   private:
397     int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
398     MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
399                                         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;
400     MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
401                                          const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
402                                          const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
403                                          const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
404     MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
405                                              const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
406                                              const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
407     DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
408     void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
409     static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type, 
410                                   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,
411                                   std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
412     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);
413     MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
414     MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
415     MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_father(fath),_mesh_iteration(meshIt),_mesh_order(meshOrd) { }
416   private:
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, const std::string& meshName);
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     MEDLOADER_EXPORT std::string getMeshName() const;
568     MEDLOADER_EXPORT void setMeshName(const std::string& meshName);
569   protected:
570     std::string _name;
571     std::string _dt_unit;
572     std::string _mesh_name;
573   };
574
575   class MEDFileMeshes;
576
577   /*!
578    * SDA is for Shared Data Arrays such as profiles.
579    */
580   class MEDFileAnyTypeField1TSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
581   {
582   public:
583     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA();
584     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order);
585     MEDLOADER_EXPORT int getIteration() const { return _iteration; }
586     MEDLOADER_EXPORT int getOrder() const { return _order; }
587     MEDLOADER_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
588     MEDLOADER_EXPORT void setTime(int iteration, int order, double val) { _dt=val; _iteration=iteration; _order=order; }
589     MEDLOADER_EXPORT int getDimension() const;
590     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
591     MEDLOADER_EXPORT int getMeshIteration() const;
592     MEDLOADER_EXPORT int getMeshOrder() const;
593     MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
594     MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
595     MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
596     MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
597     MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
598     //
599     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
600     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
601     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
602     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
603     MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
604     MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
605     //
606     MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
607     MEDLOADER_EXPORT void convertMedBallIntoClassic();
608     MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
609     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;
610     //
611     MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
612     MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
613     MEDLOADER_EXPORT void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other);
614     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
615   public:
616     MEDLOADER_EXPORT int getNumberOfComponents() const;
617     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
618     MEDLOADER_EXPORT std::vector<std::string>& getInfo();
619     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
620     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
621     MEDLOADER_EXPORT bool onlyStructureElements() const;
622     MEDLOADER_EXPORT void killStructureElements();
623     MEDLOADER_EXPORT void keepOnlyStructureElements();
624     MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
625     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
626     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
627     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
628     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
629     MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
630     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
631     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
632     MEDLOADER_EXPORT virtual void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
633     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *deepCopy() const = 0;
634     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const = 0;
635     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const;
636     MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
637     MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArray() const = 0;
638     MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const = 0;
639     MEDLOADER_EXPORT virtual void setArray(DataArray *arr) = 0;
640     MEDLOADER_EXPORT virtual DataArray *createNewEmptyDataArrayInstance() const = 0;
641     MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
642     MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
643   public:
644     MEDLOADER_EXPORT MEDCouplingFieldDouble *fieldOnMesh(const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const;
645     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
646     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
647     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
648     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;
649     DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
650   public:
651     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
652     MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
653     MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
654     MEDLOADER_EXPORT int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its);
655     MEDLOADER_EXPORT int keepOnlyGaussDiscretization(std::size_t idOfDisc, std::vector< std::pair<int,int> >& its);
656   public:
657     MEDLOADER_EXPORT void allocNotFromFile(int newNbOfTuples);
658     MEDLOADER_EXPORT bool allocIfNecessaryTheArrayToReceiveDataFromFile();
659     MEDLOADER_EXPORT void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities);
660     MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
661     MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
662     MEDLOADER_EXPORT void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities);
663     MEDLOADER_EXPORT void unloadArrays();
664     MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const;
665   protected:
666     int getMeshIdFromMeshName(const std::string& mName) const;
667     int addNewEntryIfNecessary(const MEDCouplingMesh *mesh);
668     void updateData(int newLgth, const std::vector< std::pair<int,int> >& oldStartStops);
669   protected:
670     std::vector< MCAuto< MEDFileFieldPerMesh > > _field_per_mesh;
671     int _iteration;
672     int _order;
673     double _dt;
674   public:
675     //! only useable on reading
676     mutable int _csit;
677     // -3 means allocated and build from scratch
678     // -2 means allocated and read from a file
679     // -1 means not allocated and build from scratch
680     // >=0 means not allocated and read from a file
681     mutable int _nb_of_tuples_to_be_allocated;
682   };
683
684   class MEDFileIntField1TSWithoutSDA;
685
686   template<class T>
687   class MEDFileField1TSTemplateWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
688   {
689   protected:
690     MEDFileField1TSTemplateWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order):MEDFileAnyTypeField1TSWithoutSDA(fieldName,meshName,csit,iteration,order) { }
691     MEDFileField1TSTemplateWithoutSDA():MEDFileAnyTypeField1TSWithoutSDA() { }
692   public:
693     MEDLOADER_EXPORT void setArray(DataArray *arr);
694     MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
695     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getOrCreateAndGetArrayTemplate();
696     MEDLOADER_EXPORT typename Traits<T>::ArrayType const *getOrCreateAndGetArrayTemplate() const;
697     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getUndergroundDataArrayTemplate() const;
698     MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
699     MEDLOADER_EXPORT const DataArray *getOrCreateAndGetArray() const;
700     MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
701     MEDLOADER_EXPORT void aggregate(const typename std::vector< typename MLFieldTraits<T>::F1TSWSDAType const * >& f1tss, const std::vector< std::vector< std::pair<int,int> > >& dts);
702   protected:
703     MCAuto< typename Traits<T>::ArrayType > _arr;
704   };
705
706   /*!
707    * SDA is for Shared Data Arrays such as profiles.
708    */
709   class MEDFileField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<double>
710   {
711   public:
712     MEDLOADER_EXPORT const char *getTypeStr() const;
713     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
714     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDoubleExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
715     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;
716     MEDLOADER_EXPORT static void CheckMeshDimRel(int meshDimRelToMax);
717     MEDLOADER_EXPORT static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh);
718     MEDLOADER_EXPORT static MEDFileField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
719   public:
720     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA();
721     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
722     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *shallowCpy() const;
723     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *deepCopy() const;
724     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const;
725   public:
726     static const char TYPE_STR[];
727   };
728
729   /*!
730    * SDA is for Shared Data Arrays such as profiles.
731    */
732   class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<int>
733   {
734   public:
735     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
736     MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
737     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *deepCopy() const;
738     MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *shallowCpy() const;
739     MEDLOADER_EXPORT const char *getTypeStr() const;
740     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
741     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
742     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
743   protected:
744     MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
745   public:
746     MEDLOADER_EXPORT static const char TYPE_STR[];
747   };
748
749   /*!
750    * User class.
751    */
752   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
753   {
754   protected:
755     MEDLOADER_EXPORT MEDFileAnyTypeField1TS();
756     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
757     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
758     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
759     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
760     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c);
761     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, med_idt fid);
762     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
763     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
764     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
765     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
766     // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
767   public:
768     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
769     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, bool loadAll=true);
770     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
771     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
772     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
773     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
774     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
775     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
776     MEDLOADER_EXPORT int getDimension() const;
777     MEDLOADER_EXPORT int getIteration() const;
778     MEDLOADER_EXPORT int getOrder() const;
779     MEDLOADER_EXPORT double getTime(int& iteration, int& order) const;
780     MEDLOADER_EXPORT void setTime(int iteration, int order, double val);
781     MEDLOADER_EXPORT std::string getName() const;
782     MEDLOADER_EXPORT void setName(const std::string& name);
783     MEDLOADER_EXPORT std::string simpleRepr() const;
784     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
785     MEDLOADER_EXPORT std::string getDtUnit() const;
786     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
787     MEDLOADER_EXPORT std::string getMeshName() const;
788     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
789     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
790     MEDLOADER_EXPORT int getMeshIteration() const;
791     MEDLOADER_EXPORT int getMeshOrder() const;
792     MEDLOADER_EXPORT int getNumberOfComponents() const;
793     MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
794     MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
795     MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
796     MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
797     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
798     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
799     MEDLOADER_EXPORT std::vector<std::string>& getInfo();
800     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
801     MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
802     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,
803         std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
804     MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
805     MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
806     MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
807     MEDLOADER_EXPORT void convertMedBallIntoClassic();
808     MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
809   public:
810     MEDLOADER_EXPORT void loadArrays();
811     MEDLOADER_EXPORT void loadArraysIfNecessary();
812     MEDLOADER_EXPORT void unloadArrays();
813     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
814     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitComponents() const;
815     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
816     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
817     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCopy() const;
818     MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
819     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
820   public:
821     //! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
822     MEDLOADER_EXPORT void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
823     //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
824     MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
825     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
826     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
827     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
828     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
829     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
830     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
831     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
832     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
833   public:
834     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, std::string& meshName);
835     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, std::string& meshName);
836   public:
837     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const = 0;
838   public:
839     MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
840     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
841     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const;
842   protected:
843     MCAuto<MEDFileAnyTypeField1TSWithoutSDA> _content;
844   };
845
846   class MEDFileIntField1TS;
847
848   /*!
849    * User class.
850    */
851   class MEDFileField1TS : public MEDFileAnyTypeField1TS
852   {
853   public:
854     MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
855     MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, bool loadAll=true);
856     MEDLOADER_EXPORT static MEDFileField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileField1TS>(db); }
857     MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
858     MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
859     MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
860     MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
861     MEDLOADER_EXPORT static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
862     MEDLOADER_EXPORT static MEDFileField1TS *New();
863     MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
864     //
865     MEDLOADER_EXPORT MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
866     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
867     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
868     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
869     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
870     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
871     MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
872     //
873     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
874     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
875     // direct forwarding to MEDFileField1TSWithoutSDA instance _content
876   public:
877     MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const;
878     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const;
879     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
880
881     MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
882         std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
883   public:
884     MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
885     MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MCAuto<DataArray>& arr);
886   public:
887     MEDLOADER_EXPORT MEDFileField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
888   private:
889     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
890     const MEDFileField1TSWithoutSDA *contentNotNull() const;
891     MEDFileField1TSWithoutSDA *contentNotNull();
892   private:
893     ~MEDFileField1TS() { }
894     MEDFileField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
895     MEDFileField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
896     MEDFileField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
897     MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
898     MEDFileField1TS();
899   };
900
901   class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
902   {
903   public:
904     MEDLOADER_EXPORT static MEDFileIntField1TS *New();
905     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
906     MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, bool loadAll=true);
907     MEDLOADER_EXPORT static MEDFileIntField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntField1TS>(db); }
908     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
909     MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
910     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
911     MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
912     MEDLOADER_EXPORT static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
913     MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
914     MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const;
915     //
916     MEDLOADER_EXPORT MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
917     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
918     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
919     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
920     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
921     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
922     MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
923     //
924     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
925     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
926     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
927   public:
928     MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr);
929     MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldInt> SetDataArrayDoubleInIntField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
930     MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
931   public:
932     MEDLOADER_EXPORT MEDFileIntField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
933   private:
934     med_field_type getMEDFileFieldType() const { return MED_INT32; }
935     const MEDFileIntField1TSWithoutSDA *contentNotNull() const;
936     MEDFileIntField1TSWithoutSDA *contentNotNull();
937   private:
938     ~MEDFileIntField1TS() { }
939     MEDFileIntField1TS();
940     MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
941     MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
942     MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
943     MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
944   };
945
946   class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
947   {
948   protected:
949     MEDFileAnyTypeFieldMultiTSWithoutSDA();
950     MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName);
951     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
952     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
953   public:
954     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
955     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
956     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCopy() const;
957     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
958     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
959     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
960     MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
961     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const = 0;
962     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const = 0;
963     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const = 0;
964     MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const = 0;
965     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
966     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
967     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
968     MEDLOADER_EXPORT int getTimeStepPos(int iteration, int order) const;
969     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const;
970     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order);
971     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
972     MEDLOADER_EXPORT int getNumberOfTS() const;
973     MEDLOADER_EXPORT void eraseEmptyTS();
974     MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
975     MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
976     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds(const int *startIds, const int *endIds) const;
977     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds2(int bg, int end, int step) const;
978     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
979     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
980     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
981     MEDLOADER_EXPORT bool onlyStructureElements() const;
982     MEDLOADER_EXPORT void killStructureElements();
983     MEDLOADER_EXPORT void keepOnlyStructureElements();
984     MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
985     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
986     MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
987     MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
988     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
989     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
990     MEDLOADER_EXPORT void pushBackTimeStep(MCAuto<MEDFileAnyTypeField1TSWithoutSDA>& tse);
991     MEDLOADER_EXPORT void synchronizeNameScope();
992     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
993     MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
994     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
995     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob);
996     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;
997     MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
998     MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
999     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1000     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
1001     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
1002     MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1003     MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
1004     MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
1005     MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
1006     MEDLOADER_EXPORT void unloadArrays();
1007   public:
1008     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const;
1009     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos);
1010     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
1011     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
1012     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
1013     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
1014     MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1015     MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1016     MEDLOADER_EXPORT void setIteration(int i, MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ts);
1017   protected:
1018     virtual med_field_type getMEDFileFieldType() const = 0;
1019     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
1020     void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field, const DataArray *arr) const;
1021     void checkThatComponentsMatch(const std::vector<std::string>& compos) const;
1022     void checkThatNbOfCompoOfTSMatchThis() const;
1023   protected:
1024     std::vector<std::string> _infos;
1025     std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
1026   };
1027
1028   class MEDFileIntFieldMultiTSWithoutSDA;
1029
1030   class MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1031   {
1032   public:
1033     MEDLOADER_EXPORT static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1034     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1035     MEDLOADER_EXPORT const char *getTypeStr() const;
1036     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1037     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1038     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;
1039     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
1040   protected:
1041     MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName);
1042     MEDFileFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1043     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
1044     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1045     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1046   public:
1047     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA();
1048   };
1049
1050   class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1051   {
1052   public:
1053     MEDLOADER_EXPORT static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1054     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1055     MEDLOADER_EXPORT const char *getTypeStr() const;
1056     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1057     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1058     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
1059   protected:
1060     MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName);
1061     MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1062     med_field_type getMEDFileFieldType() const { return MED_INT32; }
1063     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1064     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1065   public:
1066     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA();
1067   };
1068
1069   class MEDFileAnyTypeFieldMultiTSIterator;
1070   class MEDFileFastCellSupportComparator;
1071   /*!
1072    * User class.
1073    */
1074   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
1075   {
1076   protected:
1077     MEDFileAnyTypeFieldMultiTS();
1078     MEDFileAnyTypeFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1079     MEDFileAnyTypeFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1080     MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1081     static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, med_idt fid);
1082     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1083     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1084   public:
1085     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1086     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, bool loadAll=true);
1087     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1088     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1089     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c);
1090     MEDLOADER_EXPORT void loadArrays();
1091     MEDLOADER_EXPORT void loadArraysIfNecessary();
1092     MEDLOADER_EXPORT void unloadArrays();
1093     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1094     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1095     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1096     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1097     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCopy() const;
1098     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
1099     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
1100     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
1101     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const = 0;
1102     MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const = 0;
1103     //
1104     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const = 0;
1105     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1106     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1107     MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitIntoCommonTimeSeries(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS);
1108     MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& fsc);
1109     MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
1110   public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
1111     MEDLOADER_EXPORT std::string getName() const;
1112     MEDLOADER_EXPORT void setName(const std::string& name);
1113     MEDLOADER_EXPORT std::string getDtUnit() const;
1114     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
1115     MEDLOADER_EXPORT std::string getMeshName() const;
1116     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
1117     MEDLOADER_EXPORT std::string simpleRepr() const;
1118     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
1119     MEDLOADER_EXPORT int getNumberOfTS() const;
1120     MEDLOADER_EXPORT void eraseEmptyTS();
1121     MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
1122     MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
1123     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPart(const int *startIds, const int *endIds) const;
1124     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPartSlice(int bg, int end, int step) const;
1125     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
1126     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
1127     MEDLOADER_EXPORT void pushBackTimeSteps(const std::vector<MEDFileAnyTypeField1TS *>& f1ts);
1128     MEDLOADER_EXPORT void pushBackTimeSteps(MEDFileAnyTypeFieldMultiTS *fmts);
1129     MEDLOADER_EXPORT void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
1130     MEDLOADER_EXPORT void synchronizeNameScope();
1131     MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
1132     MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
1133     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator *iterator();
1134     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1135     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
1136     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
1137     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
1138     MEDLOADER_EXPORT int getNumberOfComponents() const;
1139     MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
1140     MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
1141     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;
1142     MEDLOADER_EXPORT MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
1143   public:
1144     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const = 0;
1145     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1146     MEDLOADER_EXPORT static MCAuto<MEDFileAnyTypeFieldMultiTS> Aggregate(const std::vector<const MEDFileAnyTypeFieldMultiTS *>& fmtss, const std::vector< std::vector< std::pair<int,int> > >& dts);
1147   public:
1148     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1149     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1150     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1151     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1152     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1153     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1154   protected:
1155     MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase();
1156     const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const;
1157   private:
1158     static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& cmps);
1159   protected:
1160     MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
1161   };
1162
1163   class MEDFileIntFieldMultiTS;
1164
1165   /*!
1166    * User class.
1167    */
1168   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1169   {
1170   public:
1171     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New();
1172     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1173     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, bool loadAll=true);
1174     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFieldMultiTS>(db); }
1175     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1176     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1177     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1178     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);
1179     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1180     MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1181     MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
1182     //
1183     MEDLOADER_EXPORT MEDFileField1TS *getTimeStepAtPos(int pos) const;
1184     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1185     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1186     //
1187     MEDLOADER_EXPORT MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
1188     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1189     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1190     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1191     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1192     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1193     MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1194     //
1195     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
1196     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1197     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;
1198     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
1199     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1200   public:
1201     MEDLOADER_EXPORT MEDFileFieldMultiTS *buildNewEmpty() const;
1202   private:
1203     const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const;
1204     MEDFileFieldMultiTSWithoutSDA *contentNotNull();
1205   private:
1206     ~MEDFileFieldMultiTS() { }
1207     MEDFileFieldMultiTS();
1208     MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1209     MEDFileFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1210     MEDFileFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1211   };
1212
1213   /*!
1214    * User class.
1215    */
1216   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1217   {
1218   public:
1219     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New();
1220     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1221     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, bool loadAll=true);
1222     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntFieldMultiTS>(db); }
1223     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1224     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1225     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1226     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);
1227     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1228     MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1229     MEDLOADER_EXPORT MEDFileIntField1TS *getTimeStepAtPos(int pos) const;
1230     MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
1231     //
1232     MEDLOADER_EXPORT MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
1233     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1234     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1235     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1236     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1237     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
1238     MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1239     //
1240     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
1241     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1242     //
1243     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
1244   public:
1245     MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const;
1246   private:
1247     const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const;
1248     MEDFileIntFieldMultiTSWithoutSDA *contentNotNull();
1249   private:
1250     ~MEDFileIntFieldMultiTS() { }
1251     MEDFileIntFieldMultiTS();
1252     MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1253     MEDFileIntFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1254     MEDFileIntFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1255   };
1256
1257   class MEDFileAnyTypeFieldMultiTSIterator
1258   {
1259   public:
1260     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator(MEDFileAnyTypeFieldMultiTS *fmts);
1261     MEDLOADER_EXPORT ~MEDFileAnyTypeFieldMultiTSIterator();
1262     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
1263   private:
1264     MCAuto<MEDFileAnyTypeFieldMultiTS> _fmts;
1265     int _iter_id;
1266     int _nb_iter;
1267   };
1268
1269   class MEDFileFieldsIterator;
1270   class MEDFileStructureElements;
1271   
1272   /*!
1273    * Use class.
1274    */
1275   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1276   {
1277   public:
1278     MEDLOADER_EXPORT static MEDFileFields *New();
1279     MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
1280     MEDLOADER_EXPORT static MEDFileFields *New(med_idt fid, bool loadAll=true);
1281     MEDLOADER_EXPORT static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
1282     MEDLOADER_EXPORT static MEDFileFields *NewAdv(med_idt fid, bool loadAll, const MEDFileEntities *entities);
1283     MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
1284     MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(med_idt fid, const MEDFileStructureElements *se, bool loadAll=true);
1285     MEDLOADER_EXPORT static MEDFileFields *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFields>(db); }
1286     MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
1287     MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1288     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1289     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1290     MEDLOADER_EXPORT MEDFileFields *deepCopy() const;
1291     MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
1292     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1293     MEDLOADER_EXPORT void loadArrays();
1294     MEDLOADER_EXPORT void loadArraysIfNecessary();
1295     MEDLOADER_EXPORT void unloadArrays();
1296     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1297     MEDLOADER_EXPORT int getNumberOfFields() const;
1298     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const;
1299     MEDLOADER_EXPORT std::vector<std::string> getFieldsNames() const;
1300     MEDLOADER_EXPORT std::vector<std::string> getMeshesNames() const;
1301     MEDLOADER_EXPORT std::string simpleRepr() const;
1302     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss) const;
1303     //
1304     MEDLOADER_EXPORT void resize(int newSize);
1305     MEDLOADER_EXPORT void pushField(MEDFileAnyTypeFieldMultiTS *field);
1306     MEDLOADER_EXPORT void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields);
1307     MEDLOADER_EXPORT void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
1308     MEDLOADER_EXPORT int getPosFromFieldName(const std::string& fieldName) const;
1309     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
1310     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
1311     MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
1312     MEDLOADER_EXPORT bool removeFieldsWithoutAnyTimeStep();
1313     MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
1314     MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1315     MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1316     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
1317     MEDLOADER_EXPORT void killStructureElements();
1318     MEDLOADER_EXPORT void keepOnlyStructureElements();
1319     MEDLOADER_EXPORT void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
1320     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
1321     MEDLOADER_EXPORT void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
1322     MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisOnStructureElements() const;
1323     MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const;
1324     MEDLOADER_EXPORT void aggregate(const MEDFileFields& other);
1325     MEDLOADER_EXPORT MEDFileFieldsIterator *iterator();
1326     MEDLOADER_EXPORT void destroyFieldAtPos(int i);
1327     MEDLOADER_EXPORT void destroyFieldsAtPos(const int *startIds, const int *endIds);
1328     MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
1329     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1330     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
1331     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
1332   public:
1333     MEDLOADER_EXPORT MEDFileFields *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1334   public:
1335     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1336     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1337     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1338     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1339     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1340     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1341   private:
1342     ~MEDFileFields() { }
1343     MEDFileFields();
1344     MEDFileFields(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1345   private:
1346     std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
1347   };
1348
1349   class MEDFileFieldsIterator
1350   {
1351   public:
1352     MEDLOADER_EXPORT MEDFileFieldsIterator(MEDFileFields *fs);
1353     MEDLOADER_EXPORT ~MEDFileFieldsIterator();
1354     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
1355   private:
1356     MCAuto<MEDFileFields> _fs;
1357     int _iter_id;
1358     int _nb_iter;
1359   };
1360 }
1361
1362 #endif