]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDLoader/MEDFileField.hxx
Salome HOME
Biking along the template road
[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 typename Traits<T>::ArrayType *getUndergroundDataArrayTemplateExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
699     MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
700     MEDLOADER_EXPORT const DataArray *getOrCreateAndGetArray() const;
701     MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
702     MEDLOADER_EXPORT void aggregate(const typename std::vector< typename MLFieldTraits<T>::F1TSWSDAType const * >& f1tss, const std::vector< std::vector< std::pair<int,int> > >& dts);
703   protected:
704     MCAuto< typename Traits<T>::ArrayType > _arr;
705   };
706
707   /*!
708    * SDA is for Shared Data Arrays such as profiles.
709    */
710   class MEDFileField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<double>
711   {
712   public:
713     MEDLOADER_EXPORT const char *getTypeStr() const;
714     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(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    * SDA is for Shared Data Arrays such as profiles.
751    */
752   class MEDFileFloatField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<float>
753   {
754   public:
755     MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA();
756     MEDLOADER_EXPORT static MEDFileFloatField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
757     MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA *deepCopy() const;
758     MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA *shallowCpy() const;
759     MEDLOADER_EXPORT const char *getTypeStr() const;
760     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
761     MEDLOADER_EXPORT DataArrayFloat *getUndergroundDataArrayFloatExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
762     MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
763   protected:
764     MEDFileFloatField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
765   public:
766     MEDLOADER_EXPORT static const char TYPE_STR[];
767   };
768
769   /*!
770    * User class.
771    */
772   class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
773   {
774   protected:
775     MEDLOADER_EXPORT MEDFileAnyTypeField1TS();
776     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
777     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
778     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
779     MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
780     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c);
781     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, med_idt fid);
782     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
783     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
784     MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
785     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
786     // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
787   public:
788     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
789     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, bool loadAll=true);
790     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
791     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
792     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
793     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
794     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
795     MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
796     MEDLOADER_EXPORT int getDimension() const;
797     MEDLOADER_EXPORT int getIteration() const;
798     MEDLOADER_EXPORT int getOrder() const;
799     MEDLOADER_EXPORT double getTime(int& iteration, int& order) const;
800     MEDLOADER_EXPORT void setTime(int iteration, int order, double val);
801     MEDLOADER_EXPORT std::string getName() const;
802     MEDLOADER_EXPORT void setName(const std::string& name);
803     MEDLOADER_EXPORT std::string simpleRepr() const;
804     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
805     MEDLOADER_EXPORT std::string getDtUnit() const;
806     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
807     MEDLOADER_EXPORT std::string getMeshName() const;
808     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
809     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
810     MEDLOADER_EXPORT int getMeshIteration() const;
811     MEDLOADER_EXPORT int getMeshOrder() const;
812     MEDLOADER_EXPORT int getNumberOfComponents() const;
813     MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
814     MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
815     MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
816     MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
817     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
818     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
819     MEDLOADER_EXPORT std::vector<std::string>& getInfo();
820     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
821     MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
822     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,
823         std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
824     MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
825     MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
826     MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
827     MEDLOADER_EXPORT void convertMedBallIntoClassic();
828     MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
829   public:
830     MEDLOADER_EXPORT void loadArrays();
831     MEDLOADER_EXPORT void loadArraysIfNecessary();
832     MEDLOADER_EXPORT void unloadArrays();
833     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
834     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitComponents() const;
835     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
836     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
837     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCopy() const;
838     MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
839     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
840   public:
841     //! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
842     MEDLOADER_EXPORT void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
843     //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
844     MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
845     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
846     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
847     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
848     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
849     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
850     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
851     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
852     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
853   public:
854     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);
855     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);
856   public:
857     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const = 0;
858   public:
859     MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
860     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
861     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const;
862   protected:
863     MCAuto<MEDFileAnyTypeField1TSWithoutSDA> _content;
864   };
865
866   class MEDFileIntField1TS;
867
868   template<class T>
869   class MEDFileTemplateField1TS : public MEDFileAnyTypeField1TS
870   {
871   public:
872     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New();
873     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(const std::string& fileName, bool loadAll=true);
874     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(med_idt fid, bool loadAll=true);
875     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(DataArrayByte *db) { return BuildFromMemoryChunk<typename MLFieldTraits<T>::F1TSType>(db); }
876     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
877     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
878     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
879     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
880     MEDLOADER_EXPORT static typename MLFieldTraits<T>::F1TSType *New(const typename MLFieldTraits<T>::F1TSWSDAType& other, bool shallowCopyOfContent);
881   public:
882     MEDLOADER_EXPORT static typename Traits<T>::ArrayType *ReturnSafelyTypedDataArray(MCAuto<DataArray>& arr);
883     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
884     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getUndergroundDataArray() const;
885     MEDLOADER_EXPORT typename Traits<T>::ArrayType *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
886   protected:
887     ~MEDFileTemplateField1TS() { }
888     MEDFileTemplateField1TS();
889     MEDFileTemplateField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileAnyTypeField1TS(fid,loadAll,ms) { }
890     MEDFileTemplateField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileAnyTypeField1TS(fid,fieldName,loadAll,ms) { }
891     MEDFileTemplateField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileAnyTypeField1TS(fid,fieldName,iteration,order,loadAll,ms) { }
892     MEDFileTemplateField1TS(const typename MLFieldTraits<T>::F1TSWSDAType& other, bool shallowCopyOfContent):MEDFileAnyTypeField1TS(other,shallowCopyOfContent) { }
893     const typename MLFieldTraits<T>::F1TSWSDAType *contentNotNull() const;
894     typename MLFieldTraits<T>::F1TSWSDAType *contentNotNull();
895   };
896
897   /*!
898    * User class.
899    */
900   class MEDFileField1TS : public MEDFileTemplateField1TS<double>
901   {
902     friend class MEDFileTemplateField1TS<double>;
903   public:
904     MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
905     //
906     MEDLOADER_EXPORT MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
907     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
908     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
909     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
910     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
911     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
912     //
913     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
914     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
915     // direct forwarding to MEDFileField1TSWithoutSDA instance _content
916   public:
917     MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const;
918
919     MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
920         std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
921   public:
922     MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
923   public:
924     MEDLOADER_EXPORT MEDFileField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
925   private:
926     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
927   private:
928     ~MEDFileField1TS() { }
929     MEDFileField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
930     MEDFileField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
931     MEDFileField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
932     MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
933     MEDFileField1TS() { }
934   };
935
936   class MEDFileIntField1TS : public MEDFileTemplateField1TS<int>
937   {
938     friend class MEDFileTemplateField1TS<int>;
939   public:
940     MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
941     MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const;
942     //
943     MEDLOADER_EXPORT MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
944     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
945     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
946     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
947     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
948     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
949     //
950     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
951     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
952   public:
953     MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldInt> SetDataArrayDoubleInIntField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
954     MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
955   public:
956     MEDLOADER_EXPORT MEDFileIntField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
957   private:
958     med_field_type getMEDFileFieldType() const { return MED_INT32; }
959   private:
960     ~MEDFileIntField1TS() { }
961     MEDFileIntField1TS() { }
962     MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
963     MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
964     MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
965     MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
966   };
967
968   class MEDFileFloatField1TS : public MEDFileTemplateField1TS<float>
969   {
970     friend class MEDFileTemplateField1TS<float>;
971   private:
972     ~MEDFileFloatField1TS() { }
973     MEDFileFloatField1TS() { }
974     MEDFileFloatField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
975     MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
976     MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
977     MEDFileFloatField1TS(const MEDFileFloatField1TSWithoutSDA& other, bool shallowCopyOfContent);
978   };
979
980   class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
981   {
982   protected:
983     MEDFileAnyTypeFieldMultiTSWithoutSDA();
984     MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName);
985     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
986     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);
987   public:
988     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
989     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
990     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCopy() const;
991     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
992     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
993     MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
994     MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
995     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const = 0;
996     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const = 0;
997     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const = 0;
998     MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const = 0;
999     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
1000     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
1001     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
1002     MEDLOADER_EXPORT int getTimeStepPos(int iteration, int order) const;
1003     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const;
1004     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order);
1005     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1006     MEDLOADER_EXPORT int getNumberOfTS() const;
1007     MEDLOADER_EXPORT void eraseEmptyTS();
1008     MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
1009     MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
1010     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds(const int *startIds, const int *endIds) const;
1011     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds2(int bg, int end, int step) const;
1012     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1013     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1014     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
1015     MEDLOADER_EXPORT bool onlyStructureElements() const;
1016     MEDLOADER_EXPORT void killStructureElements();
1017     MEDLOADER_EXPORT void keepOnlyStructureElements();
1018     MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
1019     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
1020     MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
1021     MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
1022     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
1023     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
1024     MEDLOADER_EXPORT void pushBackTimeStep(MCAuto<MEDFileAnyTypeField1TSWithoutSDA>& tse);
1025     MEDLOADER_EXPORT void synchronizeNameScope();
1026     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
1027     MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
1028     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
1029     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob);
1030     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;
1031     MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
1032     MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
1033     MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1034     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
1035     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
1036     MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1037     MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
1038     MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
1039     MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
1040     MEDLOADER_EXPORT void unloadArrays();
1041   public:
1042     MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const;
1043     MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos);
1044     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
1045     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
1046     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
1047     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
1048     MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1049     MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1050     MEDLOADER_EXPORT void setIteration(int i, MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ts);
1051   protected:
1052     virtual med_field_type getMEDFileFieldType() const = 0;
1053     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
1054     void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field, const DataArray *arr) const;
1055     void checkThatComponentsMatch(const std::vector<std::string>& compos) const;
1056     void checkThatNbOfCompoOfTSMatchThis() const;
1057   protected:
1058     std::vector<std::string> _infos;
1059     std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
1060   };
1061
1062   class MEDFileIntFieldMultiTSWithoutSDA;
1063
1064   class MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1065   {
1066   public:
1067     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);
1068     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1069     MEDLOADER_EXPORT const char *getTypeStr() const;
1070     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1071     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1072     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;
1073     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
1074   protected:
1075     MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName);
1076     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);
1077     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
1078     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1079     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1080   public:
1081     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA();
1082   };
1083
1084   class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1085   {
1086   public:
1087     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);
1088     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1089     MEDLOADER_EXPORT const char *getTypeStr() const;
1090     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1091     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1092     MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
1093   protected:
1094     MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName);
1095     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);
1096     med_field_type getMEDFileFieldType() const { return MED_INT32; }
1097     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1098     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1099   public:
1100     MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA();
1101   };
1102
1103   class MEDFileAnyTypeFieldMultiTSIterator;
1104   class MEDFileFastCellSupportComparator;
1105   /*!
1106    * User class.
1107    */
1108   class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
1109   {
1110   protected:
1111     MEDFileAnyTypeFieldMultiTS();
1112     MEDFileAnyTypeFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1113     MEDFileAnyTypeFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1114     MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1115     static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, med_idt fid);
1116     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1117     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1118   public:
1119     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1120     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, bool loadAll=true);
1121     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1122     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1123     MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c);
1124     MEDLOADER_EXPORT void loadArrays();
1125     MEDLOADER_EXPORT void loadArraysIfNecessary();
1126     MEDLOADER_EXPORT void unloadArrays();
1127     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1128     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1129     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1130     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1131     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCopy() const;
1132     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
1133     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
1134     MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
1135     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const = 0;
1136     MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const = 0;
1137     //
1138     MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const = 0;
1139     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1140     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1141     MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitIntoCommonTimeSeries(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS);
1142     MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& fsc);
1143     MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
1144   public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
1145     MEDLOADER_EXPORT std::string getName() const;
1146     MEDLOADER_EXPORT void setName(const std::string& name);
1147     MEDLOADER_EXPORT std::string getDtUnit() const;
1148     MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
1149     MEDLOADER_EXPORT std::string getMeshName() const;
1150     MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
1151     MEDLOADER_EXPORT std::string simpleRepr() const;
1152     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
1153     MEDLOADER_EXPORT int getNumberOfTS() const;
1154     MEDLOADER_EXPORT void eraseEmptyTS();
1155     MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
1156     MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
1157     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPart(const int *startIds, const int *endIds) const;
1158     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPartSlice(int bg, int end, int step) const;
1159     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
1160     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
1161     MEDLOADER_EXPORT void pushBackTimeSteps(const std::vector<MEDFileAnyTypeField1TS *>& f1ts);
1162     MEDLOADER_EXPORT void pushBackTimeSteps(MEDFileAnyTypeFieldMultiTS *fmts);
1163     MEDLOADER_EXPORT void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
1164     MEDLOADER_EXPORT void synchronizeNameScope();
1165     MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
1166     MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
1167     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator *iterator();
1168     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1169     MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
1170     MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
1171     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
1172     MEDLOADER_EXPORT int getNumberOfComponents() const;
1173     MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
1174     MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
1175     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;
1176     MEDLOADER_EXPORT MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
1177   public:
1178     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const = 0;
1179     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1180     MEDLOADER_EXPORT static MCAuto<MEDFileAnyTypeFieldMultiTS> Aggregate(const std::vector<const MEDFileAnyTypeFieldMultiTS *>& fmtss, const std::vector< std::vector< std::pair<int,int> > >& dts);
1181   public:
1182     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1183     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1184     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1185     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1186     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1187     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1188   protected:
1189     MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase();
1190     const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const;
1191   private:
1192     static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& cmps);
1193   protected:
1194     MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
1195   };
1196
1197   class MEDFileIntFieldMultiTS;
1198
1199   /*!
1200    * User class.
1201    */
1202   class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1203   {
1204   public:
1205     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New();
1206     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1207     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, bool loadAll=true);
1208     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFieldMultiTS>(db); }
1209     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1210     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1211     MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1212     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);
1213     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1214     MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1215     MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
1216     //
1217     MEDLOADER_EXPORT MEDFileField1TS *getTimeStepAtPos(int pos) const;
1218     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1219     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1220     //
1221     MEDLOADER_EXPORT MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
1222     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1223     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1224     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1225     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1226     MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1227     MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1228     //
1229     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
1230     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1231     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;
1232     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
1233     MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1234   public:
1235     MEDLOADER_EXPORT MEDFileFieldMultiTS *buildNewEmpty() const;
1236   private:
1237     const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const;
1238     MEDFileFieldMultiTSWithoutSDA *contentNotNull();
1239   private:
1240     ~MEDFileFieldMultiTS() { }
1241     MEDFileFieldMultiTS();
1242     MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1243     MEDFileFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1244     MEDFileFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1245   };
1246
1247   /*!
1248    * User class.
1249    */
1250   class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1251   {
1252   public:
1253     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New();
1254     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1255     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, bool loadAll=true);
1256     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntFieldMultiTS>(db); }
1257     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1258     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1259     MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1260     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);
1261     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1262     MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1263     MEDLOADER_EXPORT MEDFileIntField1TS *getTimeStepAtPos(int pos) const;
1264     MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
1265     //
1266     MEDLOADER_EXPORT MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
1267     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1268     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1269     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1270     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1271     MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
1272     MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1273     //
1274     MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
1275     MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1276     //
1277     MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
1278   public:
1279     MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const;
1280   private:
1281     const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const;
1282     MEDFileIntFieldMultiTSWithoutSDA *contentNotNull();
1283   private:
1284     ~MEDFileIntFieldMultiTS() { }
1285     MEDFileIntFieldMultiTS();
1286     MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1287     MEDFileIntFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1288     MEDFileIntFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1289   };
1290
1291   class MEDFileAnyTypeFieldMultiTSIterator
1292   {
1293   public:
1294     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator(MEDFileAnyTypeFieldMultiTS *fmts);
1295     MEDLOADER_EXPORT ~MEDFileAnyTypeFieldMultiTSIterator();
1296     MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
1297   private:
1298     MCAuto<MEDFileAnyTypeFieldMultiTS> _fmts;
1299     int _iter_id;
1300     int _nb_iter;
1301   };
1302
1303   class MEDFileFieldsIterator;
1304   class MEDFileStructureElements;
1305   
1306   /*!
1307    * Use class.
1308    */
1309   class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1310   {
1311   public:
1312     MEDLOADER_EXPORT static MEDFileFields *New();
1313     MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
1314     MEDLOADER_EXPORT static MEDFileFields *New(med_idt fid, bool loadAll=true);
1315     MEDLOADER_EXPORT static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities);
1316     MEDLOADER_EXPORT static MEDFileFields *NewAdv(med_idt fid, bool loadAll, const MEDFileEntities *entities);
1317     MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
1318     MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(med_idt fid, const MEDFileStructureElements *se, bool loadAll=true);
1319     MEDLOADER_EXPORT static MEDFileFields *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFields>(db); }
1320     MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
1321     MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1322     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1323     MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1324     MEDLOADER_EXPORT MEDFileFields *deepCopy() const;
1325     MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
1326     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1327     MEDLOADER_EXPORT void loadArrays();
1328     MEDLOADER_EXPORT void loadArraysIfNecessary();
1329     MEDLOADER_EXPORT void unloadArrays();
1330     MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1331     MEDLOADER_EXPORT int getNumberOfFields() const;
1332     MEDLOADER_EXPORT std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const;
1333     MEDLOADER_EXPORT std::vector<std::string> getFieldsNames() const;
1334     MEDLOADER_EXPORT std::vector<std::string> getMeshesNames() const;
1335     MEDLOADER_EXPORT std::string simpleRepr() const;
1336     MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss) const;
1337     //
1338     MEDLOADER_EXPORT void resize(int newSize);
1339     MEDLOADER_EXPORT void pushField(MEDFileAnyTypeFieldMultiTS *field);
1340     MEDLOADER_EXPORT void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields);
1341     MEDLOADER_EXPORT void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
1342     MEDLOADER_EXPORT int getPosFromFieldName(const std::string& fieldName) const;
1343     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
1344     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
1345     MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
1346     MEDLOADER_EXPORT bool removeFieldsWithoutAnyTimeStep();
1347     MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
1348     MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1349     MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1350     MEDLOADER_EXPORT bool presenceOfStructureElements() const;
1351     MEDLOADER_EXPORT void killStructureElements();
1352     MEDLOADER_EXPORT void keepOnlyStructureElements();
1353     MEDLOADER_EXPORT void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
1354     MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
1355     MEDLOADER_EXPORT void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
1356     MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisOnStructureElements() const;
1357     MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const;
1358     MEDLOADER_EXPORT void aggregate(const MEDFileFields& other);
1359     MEDLOADER_EXPORT MEDFileFieldsIterator *iterator();
1360     MEDLOADER_EXPORT void destroyFieldAtPos(int i);
1361     MEDLOADER_EXPORT void destroyFieldsAtPos(const int *startIds, const int *endIds);
1362     MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
1363     MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1364     MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
1365     MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
1366   public:
1367     MEDLOADER_EXPORT MEDFileFields *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1368   public:
1369     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1370     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1371     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1372     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1373     MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1374     MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1375   private:
1376     ~MEDFileFields() { }
1377     MEDFileFields();
1378     MEDFileFields(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1379   private:
1380     std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
1381   };
1382
1383   class MEDFileFieldsIterator
1384   {
1385   public:
1386     MEDLOADER_EXPORT MEDFileFieldsIterator(MEDFileFields *fs);
1387     MEDLOADER_EXPORT ~MEDFileFieldsIterator();
1388     MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
1389   private:
1390     MCAuto<MEDFileFields> _fs;
1391     int _iter_id;
1392     int _nb_iter;
1393   };
1394 }
1395
1396 #endif