Salome HOME
MED file loading on demand.
[tools/medcoupling.git] / src / MEDLoader / MEDFileField.hxx
1 // Copyright (C) 2007-2013  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.
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 "MEDFileUtilities.hxx"
27
28 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
29 #include "MEDCouplingRefCountObject.hxx"
30 #include "MEDCouplingMemArray.hxx"
31
32 #include "NormalizedUnstructuredMesh.hxx"
33 #include "InterpKernelException.hxx"
34
35 #include <vector>
36 #include <string>
37 #include <list>
38 #include <set>
39
40 #include "med.h"
41
42 namespace ParaMEDMEM
43 {
44   class MEDFileFieldGlobs;
45   class MEDCouplingMesh;
46   class MEDCouplingFieldDouble;
47   class MEDFileMesh;
48
49   class MEDFileFieldLoc : public RefCountObject
50   {
51   public:
52     void MEDLOADER_EXPORT simpleRepr(std::ostream& oss) const;
53     const MEDLOADER_EXPORT std::string& getName() const { return _name; }
54     void MEDLOADER_EXPORT setName(const char *name);
55     static MEDFileFieldLoc *New(med_idt fid, const char *locName);
56     static MEDFileFieldLoc *New(med_idt fid, int id);
57     static MEDFileFieldLoc *New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
58     std::size_t getHeapMemorySize() const;
59     MEDFileFieldLoc *deepCpy() const;
60     int MEDLOADER_EXPORT getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
61     void MEDLOADER_EXPORT writeLL(med_idt fid) const;
62     std::string MEDLOADER_EXPORT repr() const;
63     bool MEDLOADER_EXPORT isName(const char *name) const { return _name==name; }
64     int MEDLOADER_EXPORT getDimension() const { return _dim; }
65     int MEDLOADER_EXPORT getNumberOfGaussPoints() const { return _nb_gauss_pt; }
66     int MEDLOADER_EXPORT getNumberOfPointsInCells() const { return _nb_node_per_cell; }
67     const MEDLOADER_EXPORT std::vector<double>& getRefCoords() const { return _ref_coo; }
68     const MEDLOADER_EXPORT std::vector<double>& getGaussCoords() const { return _gs_coo; }
69     const MEDLOADER_EXPORT std::vector<double>& getGaussWeights() const { return _w; }
70     bool MEDLOADER_EXPORT isEqual(const MEDFileFieldLoc& other, double eps) const;
71   private:
72     MEDFileFieldLoc(med_idt fid, const char *locName);
73     MEDFileFieldLoc(med_idt fid, int id);
74     MEDFileFieldLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
75   private:
76     int _dim;
77     int _nb_gauss_pt;
78     int _nb_node_per_cell;
79     std::string _name;
80     INTERP_KERNEL::NormalizedCellType _geo_type;
81     std::vector<double> _ref_coo;
82     std::vector<double> _gs_coo;
83     std::vector<double> _w;
84   };
85
86 /// @cond INTERNAL
87   class MEDFileAnyTypeField1TSWithoutSDA;
88   class MEDFileFieldPerMeshPerType;
89   class MEDFileField1TSWithoutSDA;
90   class MEDFileFieldNameScope;
91   class MEDFileFieldGlobsReal;
92   class MEDFileFieldPerMesh;
93
94   class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
95   {
96   public:
97     static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
98     static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId);
99     static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
100     std::size_t getHeapMemorySize() const;
101     MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const throw(INTERP_KERNEL::Exception);
102     void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
103     void assignFieldProfile(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) throw(INTERP_KERNEL::Exception);
104     void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
105     void getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const throw(INTERP_KERNEL::Exception);
106     void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
107     const MEDFileFieldPerMeshPerType *getFather() const;
108     void loadOnlyStructureOfDataRecursively(med_idt fid, int profileIt, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
109     void loadBigArray(med_idt fid, int profileIt, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
110     void setNewStart(int newValueOfStart) throw(INTERP_KERNEL::Exception);
111     int getIteration() const;
112     int getOrder() const;
113     double getTime() const;
114     std::string getMeshName() const;
115     TypeOfField getType() const;
116     void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
117     void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
118     void setType(TypeOfField newType);
119     INTERP_KERNEL::NormalizedCellType getGeoType() const;
120     int getNumberOfComponents() const;
121     int getNumberOfTuples() const;
122     int getStart() const { return _start; }
123     DataArray *getOrCreateAndGetArray();
124     const DataArray *getOrCreateAndGetArray() const;
125     const std::vector<std::string>& getInfo() const;
126     std::string getProfile() const;
127     void setProfile(const char *newPflName);
128     std::string getLocalization() const;
129     void setLocalization(const char *newLocName);
130     int getLocId() const { return _loc_id; }
131     void setLocId(int newId) const { _loc_id=newId; }
132     void setFather(MEDFileFieldPerMeshPerType *newFather) { _father=newFather; }
133     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
134     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
135     void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
136                          std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
137     void fillValues(int discId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
138     int fillEltIdsFromCode(int offset, const std::vector<int>& codeOfMesh, const MEDFileFieldGlobsReal& glob, int *ptToFill) const throw(INTERP_KERNEL::Exception);
139     int fillTupleIds(int *ptToFill) const throw(INTERP_KERNEL::Exception);
140     static int ConvertType(TypeOfField type, int locId) throw(INTERP_KERNEL::Exception);
141     static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
142     static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
143                                const DataArrayInt *explicitIdsInMesh, const std::vector<int>& newCode,
144                                MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >& result);
145     static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
146                                                                           bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
147                                                                           MEDFileFieldGlobsReal& glob, bool &notInExisting) throw(INTERP_KERNEL::Exception);
148   private:
149     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
150     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt, const std::string& dummy);
151     MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other);
152     MEDFileFieldPerMeshPerTypePerDisc();
153   private:
154     TypeOfField _type;
155     MEDFileFieldPerMeshPerType *_father;
156     int _start;
157     int _end;
158     //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi)
159     int _nval;
160     std::string _profile;
161     std::string _localization;
162     //! only on assignement -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
163     mutable int _loc_id;
164   public:
165     mutable int _tmp_work1;
166   };
167
168   class MEDFileFieldPerMeshPerType : public RefCountObject, public MEDFileWritable
169   {
170   public:
171     static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception);
172     static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
173     std::size_t getHeapMemorySize() const;
174     MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const throw(INTERP_KERNEL::Exception);
175     void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
176     void assignFieldProfile(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) throw(INTERP_KERNEL::Exception);
177     void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
178     void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
179     const MEDFileFieldPerMesh *getFather() const;
180     void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
181     void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
182     void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
183     void getDimension(int& dim) const;
184     void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
185     void fillFieldSplitedByType(std::vector< std::pair<int,int> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception);
186     int getIteration() const;
187     int getOrder() const;
188     double getTime() const;
189     std::string getMeshName() const;
190     void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
191     void getSizes(int& globalSz, int& nbOfEntries) const;
192     INTERP_KERNEL::NormalizedCellType getGeoType() const;
193     int getNumberOfComponents() const;
194     DataArray *getOrCreateAndGetArray();
195     const DataArray *getOrCreateAndGetArray() const;
196     const std::vector<std::string>& getInfo() const;
197     std::vector<std::string> getPflsReallyUsed() const;
198     std::vector<std::string> getLocsReallyUsed() const;
199     std::vector<std::string> getPflsReallyUsedMulti() const;
200     std::vector<std::string> getLocsReallyUsedMulti() const;
201     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
202     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
203     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) throw(INTERP_KERNEL::Exception);
204     const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const throw(INTERP_KERNEL::Exception);
205     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;
206     void fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
207     void setLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves) throw(INTERP_KERNEL::Exception);
208     static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
209   private:
210     std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception);
211     std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception);
212     std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells) throw(INTERP_KERNEL::Exception);
213     std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells) throw(INTERP_KERNEL::Exception);
214     MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
215     MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception);
216   private:
217     MEDFileFieldPerMesh *_father;
218     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
219     INTERP_KERNEL::NormalizedCellType _geo_type;
220   };
221
222   class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
223   {
224   public:
225     static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
226     static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
227     std::size_t getHeapMemorySize() const;
228     MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const throw(INTERP_KERNEL::Exception);
229     void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
230     void copyTinyInfoFrom(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
231     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) throw(INTERP_KERNEL::Exception);
232     void assignFieldNoProfileNoRenum(int& start, const std::vector<int>& code, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
233     void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
234     void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
235     void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
236     void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
237     void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
238     void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
239     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 throw(INTERP_KERNEL::Exception);
240     void getDimension(int& dim) const;
241     double getTime() const;
242     int getIteration() const;
243     int getOrder() const;
244     int getMeshIteration() const { return _mesh_iteration; }
245     int getMeshOrder() const { return _mesh_order; }
246     std::string getMeshName() const { return _mesh_name; }
247     int getNumberOfComponents() const;
248     DataArray *getOrCreateAndGetArray();
249     const DataArray *getOrCreateAndGetArray() const;
250     const std::vector<std::string>& getInfo() const;
251     std::vector<std::string> getPflsReallyUsed() const;
252     std::vector<std::string> getLocsReallyUsed() const;
253     std::vector<std::string> getPflsReallyUsedMulti() const;
254     std::vector<std::string> getLocsReallyUsedMulti() const;
255     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
256     bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
257     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
258     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
259     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
260     DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
261     void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
262     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) throw(INTERP_KERNEL::Exception);
263     const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const throw(INTERP_KERNEL::Exception);
264   private:
265     int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
266     MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
267                                         const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
268     MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
269                                          const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
270                                          const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
271                                          const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
272     MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
273                                              const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
274                                              const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
275     DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const throw(INTERP_KERNEL::Exception);
276     void assignNewLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves) throw(INTERP_KERNEL::Exception);
277     static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type, 
278                                   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,
279                                   std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
280     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) throw(INTERP_KERNEL::Exception);
281     MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
282     MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
283   private:
284     std::string _mesh_name;
285     int _mesh_iteration;
286     int _mesh_order;
287     int _mesh_csit;
288     MEDFileAnyTypeField1TSWithoutSDA *_father;
289     std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > _field_pm_pt;
290   };
291
292   class MEDFileFieldGlobsReal;
293
294   class MEDFileFieldGlobs : public RefCountObject
295   {
296   public:
297     static MEDFileFieldGlobs *New(const char *fname);
298     static MEDFileFieldGlobs *New();
299     std::size_t getHeapMemorySize() const;
300     MEDFileFieldGlobs *deepCpy() const throw(INTERP_KERNEL::Exception);
301     MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception);
302     MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception);
303     void simpleRepr(std::ostream& oss) const;
304     void appendGlobs(const MEDFileFieldGlobs& other, double eps) throw(INTERP_KERNEL::Exception);
305     void checkGlobsPflsPartCoherency(const std::vector<std::string>& pflsUsed) const throw(INTERP_KERNEL::Exception);
306     void checkGlobsLocsPartCoherency(const std::vector<std::string>& locsUsed) const throw(INTERP_KERNEL::Exception);
307     void loadProfileInFile(med_idt fid, int id, const char *pflName) throw(INTERP_KERNEL::Exception);
308     void loadProfileInFile(med_idt fid, int id);
309     void loadGlobals(med_idt fid, const MEDFileFieldGlobsReal& real) throw(INTERP_KERNEL::Exception);
310     void loadAllGlobals(med_idt fid) throw(INTERP_KERNEL::Exception);
311     void writeGlobals(med_idt fid, const MEDFileWritable& opt) const throw(INTERP_KERNEL::Exception);
312     std::vector<std::string> getPfls() const;
313     std::vector<std::string> getLocs() const;
314     bool existsPfl(const char *pflName) const;
315     bool existsLoc(const char *locName) const;
316     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
317     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
318     std::vector< std::vector<int> > whichAreEqualProfiles() const;
319     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
320     void setFileName(const char *fileName);
321     void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
322     void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
323     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
324     int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
325     const char *getFileName() const { return _file_name.c_str(); }
326     std::string getFileName2() const { return _file_name; }
327     const MEDFileFieldLoc& getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception);
328     const MEDFileFieldLoc& getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception);
329     const DataArrayInt *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception);
330     const DataArrayInt *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception);
331     MEDFileFieldLoc& getLocalizationFromId(int locId) throw(INTERP_KERNEL::Exception);
332     MEDFileFieldLoc& getLocalization(const char *locName) throw(INTERP_KERNEL::Exception);
333     DataArrayInt *getProfile(const char *pflName) throw(INTERP_KERNEL::Exception);
334     DataArrayInt *getProfileFromId(int pflId) throw(INTERP_KERNEL::Exception);
335     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
336     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
337     //
338     void appendProfile(DataArrayInt *pfl) throw(INTERP_KERNEL::Exception);
339     void appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
340     //
341     static std::string CreateNewNameNotIn(const char *prefix, const std::vector<std::string>& namesToAvoid) throw(INTERP_KERNEL::Exception);
342   protected:
343     MEDFileFieldGlobs(const char *fname);
344     MEDFileFieldGlobs();
345     ~MEDFileFieldGlobs();
346   protected:
347     std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _pfls;
348     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> > _locs;
349     std::string _file_name;
350   };
351
352 /// @endcond INTERNAL
353
354   class MEDLOADER_EXPORT MEDFileFieldGlobsReal
355   {
356   public:
357     MEDFileFieldGlobsReal(const char *fname);
358     MEDFileFieldGlobsReal();
359     std::size_t getHeapMemorySize() const;
360     void simpleReprGlobs(std::ostream& oss) const;
361     void resetContent();
362     void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
363     void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
364     void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
365     void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
366     void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
367     void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
368     void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
369     void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
370     virtual std::vector<std::string> getPflsReallyUsed() const = 0;
371     virtual std::vector<std::string> getLocsReallyUsed() const = 0;
372     virtual std::vector<std::string> getPflsReallyUsedMulti() const = 0;
373     virtual std::vector<std::string> getLocsReallyUsedMulti() const = 0;
374     virtual void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception) = 0;
375     virtual void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception) = 0;
376     virtual ~MEDFileFieldGlobsReal();
377     //
378     void loadProfileInFile(med_idt fid, int id, const char *pflName) throw(INTERP_KERNEL::Exception);
379     void loadProfileInFile(med_idt fid, int id);
380     void loadGlobals(med_idt fid) throw(INTERP_KERNEL::Exception);
381     void loadAllGlobals(med_idt fid) throw(INTERP_KERNEL::Exception);
382     void writeGlobals(med_idt fid, const MEDFileWritable& opt) const throw(INTERP_KERNEL::Exception);
383     std::vector<std::string> getPfls() const;
384     std::vector<std::string> getLocs() const;
385     bool existsPfl(const char *pflName) const;
386     bool existsLoc(const char *locName) const;
387     std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
388     std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
389     std::vector< std::vector<int> > whichAreEqualProfiles() const;
390     std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
391     void setFileName(const char *fileName);
392     void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
393     void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
394     void changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
395     void changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
396     void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
397     void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
398     std::vector< std::pair<std::vector<std::string>, std::string > > zipPflsNames() throw(INTERP_KERNEL::Exception);
399     std::vector< std::pair<std::vector<std::string>, std::string > > zipLocsNames(double eps) throw(INTERP_KERNEL::Exception);
400     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
401     int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
402     const char *getFileName() const;
403     std::string getFileName2() const;
404     const MEDFileFieldLoc& getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception);
405     const MEDFileFieldLoc& getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception);
406     MEDFileFieldLoc& getLocalizationFromId(int locId) throw(INTERP_KERNEL::Exception);
407     MEDFileFieldLoc& getLocalization(const char *locName) throw(INTERP_KERNEL::Exception);
408     const DataArrayInt *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception);
409     const DataArrayInt *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception);
410     DataArrayInt *getProfile(const char *pflName) throw(INTERP_KERNEL::Exception);
411     DataArrayInt *getProfileFromId(int pflId) throw(INTERP_KERNEL::Exception);
412     void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
413     void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
414     //
415     void appendProfile(DataArrayInt *pfl) throw(INTERP_KERNEL::Exception);
416     void appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
417   protected:
418     MEDFileFieldGlobs *contentNotNull() throw(INTERP_KERNEL::Exception);
419     const MEDFileFieldGlobs *contentNotNull() const throw(INTERP_KERNEL::Exception);
420   protected:
421     MEDCouplingAutoRefCountObjectPtr< MEDFileFieldGlobs > _globals;
422   };
423
424   class MEDLOADER_EXPORT MEDFileFieldNameScope
425   {
426   public:
427     MEDFileFieldNameScope();
428     MEDFileFieldNameScope(const char *fieldName);
429     std::string getName() const throw(INTERP_KERNEL::Exception);
430     void setName(const char *fieldName) throw(INTERP_KERNEL::Exception);
431     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
432     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
433     void copyNameScope(const MEDFileFieldNameScope& other);
434   protected:
435     std::string _name;
436     std::string _dt_unit;
437   };
438
439   /*!
440    * SDA is for Shared Data Arrays such as profiles.
441    */
442   class MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
443   {
444   public:
445     MEDFileAnyTypeField1TSWithoutSDA();
446     MEDFileAnyTypeField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order);
447     int getIteration() const { return _iteration; }
448     int getOrder() const { return _order; }
449     double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
450     void setTime(int iteration, int order, double val) { _dt=val; _iteration=iteration; _order=order; }
451     int getDimension() const;
452     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
453     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
454     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
455     int getMeshIteration() const throw(INTERP_KERNEL::Exception);
456     int getMeshOrder() const throw(INTERP_KERNEL::Exception);
457     bool isDealingTS(int iteration, int order) const;
458     std::pair<int,int> getDtIt() const;
459     void fillIteration(std::pair<int,int>& p) const;
460     void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
461     std::vector<TypeOfField> getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
462     //
463     std::vector<std::string> getPflsReallyUsed2() const;
464     std::vector<std::string> getLocsReallyUsed2() const;
465     std::vector<std::string> getPflsReallyUsedMulti2() const;
466     std::vector<std::string> getLocsReallyUsedMulti2() const;
467     void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
468     void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
469     //
470     int getNonEmptyLevels(const char *mname, std::vector<int>& levs) const throw(INTERP_KERNEL::Exception);
471     std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const char *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 throw(INTERP_KERNEL::Exception);
472     //
473     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) throw(INTERP_KERNEL::Exception);
474      const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const throw(INTERP_KERNEL::Exception);
475      void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other) throw(INTERP_KERNEL::Exception);
476   public:
477     int getNumberOfComponents() const;
478     const std::vector<std::string>& getInfo() const;
479     std::vector<std::string>& getInfo();
480     void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
481     std::size_t getHeapMemorySize() const;
482     int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr) throw(INTERP_KERNEL::Exception);
483     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
484     void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
485     virtual void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
486     virtual MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception) = 0;
487     virtual MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0;
488     virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const throw(INTERP_KERNEL::Exception);
489     virtual const char *getTypeStr() const throw(INTERP_KERNEL::Exception) = 0;
490     virtual DataArray *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception) = 0;
491     virtual DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception) = 0;
492     virtual void setArray(DataArray *arr) throw(INTERP_KERNEL::Exception) = 0;
493     virtual DataArray *createNewEmptyDataArrayInstance() const = 0;
494     virtual DataArray *getOrCreateAndGetArray() = 0;
495     virtual const DataArray *getOrCreateAndGetArray() const = 0;
496   public:
497     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
498     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
499     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const char *mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
500     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
501     DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
502   public:
503     bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
504   public:
505     void allocNotFromFile(int newNbOfTuples) throw(INTERP_KERNEL::Exception);
506     void allocIfNecessaryTheArrayToReceiveDataFromFile() throw(INTERP_KERNEL::Exception);
507     void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
508     void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
509     void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
510     void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
511   protected:
512     int getMeshIdFromMeshName(const char *mName) const throw(INTERP_KERNEL::Exception);
513     int addNewEntryIfNecessary(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
514   protected:
515     std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > > _field_per_mesh;
516     int _iteration;
517     int _order;
518     double _dt;
519   public:
520     //! only useable on reading
521     mutable int _csit;
522     // -3 means allocated and build from scratch
523     // -2 means allocated and read from a file
524     // -1 means not allocated and build from scratch
525     // >=0 means not allocated and read from a file
526     mutable int _nb_of_tuples_to_be_allocated;
527   };
528
529   class MEDFileIntField1TSWithoutSDA;
530   
531   /*!
532    * SDA is for Shared Data Arrays such as profiles.
533    */
534   class MEDLOADER_EXPORT MEDFileField1TSWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
535   {
536   public:
537     const char *getTypeStr() const throw(INTERP_KERNEL::Exception);
538     DataArray *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
539     DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
540     DataArrayDouble *getUndergroundDataArrayDouble() const throw(INTERP_KERNEL::Exception);
541     DataArrayDouble *getUndergroundDataArrayDoubleExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
542     std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const char *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 throw(INTERP_KERNEL::Exception);
543     static void CheckMeshDimRel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
544     static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
545     static MEDFileField1TSWithoutSDA *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
546   public:
547     MEDFileField1TSWithoutSDA();
548     MEDFileField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
549     MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception);
550     MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception);
551     void setArray(DataArray *arr) throw(INTERP_KERNEL::Exception);
552     DataArray *createNewEmptyDataArrayInstance() const;
553     DataArray *getOrCreateAndGetArray();
554     const DataArray *getOrCreateAndGetArray() const;
555     DataArrayDouble *getOrCreateAndGetArrayDouble();
556     const DataArrayDouble *getOrCreateAndGetArrayDouble() const;
557     MEDFileIntField1TSWithoutSDA *convertToInt() const throw(INTERP_KERNEL::Exception);
558   protected:
559     MEDCouplingAutoRefCountObjectPtr< DataArrayDouble > _arr;
560   public:
561     static const char TYPE_STR[];
562   };
563
564   /*!
565    * SDA is for Shared Data Arrays such as profiles.
566    */
567   class MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
568   {
569   public:
570     MEDFileIntField1TSWithoutSDA();
571     static MEDFileIntField1TSWithoutSDA *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
572     MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception);
573     MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception);
574     const char *getTypeStr() const throw(INTERP_KERNEL::Exception);
575     DataArray *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
576     DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
577     void setArray(DataArray *arr) throw(INTERP_KERNEL::Exception);
578     DataArray *createNewEmptyDataArrayInstance() const;
579     DataArray *getOrCreateAndGetArray();
580     const DataArray *getOrCreateAndGetArray() const;
581     DataArrayInt *getOrCreateAndGetArrayInt();
582     const DataArrayInt *getOrCreateAndGetArrayInt() const;
583     DataArrayInt *getUndergroundDataArrayInt() const throw(INTERP_KERNEL::Exception);
584     DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
585     MEDFileField1TSWithoutSDA *convertToDouble() const throw(INTERP_KERNEL::Exception);
586   protected:
587     MEDFileIntField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
588   protected:
589     MEDCouplingAutoRefCountObjectPtr< DataArrayInt > _arr;
590   public:
591     static const char TYPE_STR[];
592   };
593
594   /*!
595    * User class.
596    */
597   class MEDLOADER_EXPORT MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileWritable, public MEDFileFieldGlobsReal
598   {
599   protected:
600     MEDFileAnyTypeField1TS();
601     MEDFileAnyTypeField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
602     MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
603     MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception);
604     MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
605     static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const char *fileName) throw(INTERP_KERNEL::Exception);
606     static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
607     static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
608     static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception);
609     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
610     // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
611   public:
612     static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
613     static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
614     static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
615     int getDimension() const;
616     int getIteration() const;
617     int getOrder() const;
618     double getTime(int& iteration, int& order) const;
619     void setTime(int iteration, int order, double val);
620     std::string getName() const;
621     void setName(const char *name);
622     std::string simpleRepr() const;
623     void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
624     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
625     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
626     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
627     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
628     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
629     int getMeshIteration() const throw(INTERP_KERNEL::Exception);
630     int getMeshOrder() const throw(INTERP_KERNEL::Exception);
631     int getNumberOfComponents() const;
632     bool isDealingTS(int iteration, int order) const;
633     std::pair<int,int> getDtIt() const;
634     void fillIteration(std::pair<int,int>& p) const;
635     void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
636     void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
637     const std::vector<std::string>& getInfo() const;
638     std::vector<std::string>& getInfo();
639     std::vector<TypeOfField> getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
640     std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
641                                                                           std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception);
642     MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) throw(INTERP_KERNEL::Exception);
643     const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const throw(INTERP_KERNEL::Exception);
644     int getNonEmptyLevels(const char *mname, std::vector<int>& levs) const throw(INTERP_KERNEL::Exception);
645   public:
646     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
647     std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitComponents() const throw(INTERP_KERNEL::Exception);
648     MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
649     int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr) throw(INTERP_KERNEL::Exception);
650     virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0;
651   public:
652     //! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
653     void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
654     //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
655     void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
656     std::size_t getHeapMemorySize() const;
657     std::vector<std::string> getPflsReallyUsed() const;
658     std::vector<std::string> getLocsReallyUsed() const;
659     std::vector<std::string> getPflsReallyUsedMulti() const;
660     std::vector<std::string> getLocsReallyUsedMulti() const;
661     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
662     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
663   public:
664     static int LocateField2(med_idt fid, const char *fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut) throw(INTERP_KERNEL::Exception);
665     static int LocateField(med_idt fid, const char *fileName, const char *fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut) throw(INTERP_KERNEL::Exception);
666   public:
667     virtual med_field_type getMEDFileFieldType() const = 0;
668     MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() throw(INTERP_KERNEL::Exception);
669     const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const throw(INTERP_KERNEL::Exception);
670   protected:
671     MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> _content;
672   };
673   
674   class MEDFileIntField1TS;
675   
676   /*!
677    * User class.
678    */
679   class MEDLOADER_EXPORT MEDFileField1TS : public MEDFileAnyTypeField1TS
680   {
681   public:
682     static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
683     static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
684     static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
685     static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
686     static MEDFileField1TS *New();
687     MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
688     //
689     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
690     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
691     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
692     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
693     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
694     DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception);
695     //
696     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
697     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
698     // direct forwarding to MEDFileField1TSWithoutSDA instance _content
699   public:
700     MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
701     DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
702     DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
703     
704     std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const char *mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
705                                                                          std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception);
706   public:
707     static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr<DataArray>& arr) throw(INTERP_KERNEL::Exception);
708     static DataArrayDouble *ReturnSafelyDataArrayDouble(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr) throw(INTERP_KERNEL::Exception);
709   private:
710     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
711     const MEDFileField1TSWithoutSDA *contentNotNull() const throw(INTERP_KERNEL::Exception);
712     MEDFileField1TSWithoutSDA *contentNotNull() throw(INTERP_KERNEL::Exception);
713   private:
714     MEDFileField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
715     MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
716     MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception);
717     MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
718     MEDFileField1TS();
719   };
720
721   class MEDLOADER_EXPORT MEDFileIntField1TS : public MEDFileAnyTypeField1TS
722   {
723   public:
724     static MEDFileIntField1TS *New();
725     static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
726     static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
727     static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
728     static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
729     MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
730     MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
731     //
732     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
733     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
734     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
735     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
736     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
737     DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception);
738     //
739     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
740     void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
741     DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
742   public:
743     static DataArrayInt *ReturnSafelyDataArrayInt(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr) throw(INTERP_KERNEL::Exception);
744   private:
745     med_field_type getMEDFileFieldType() const { return MED_INT32; }
746     const MEDFileIntField1TSWithoutSDA *contentNotNull() const throw(INTERP_KERNEL::Exception);
747     MEDFileIntField1TSWithoutSDA *contentNotNull() throw(INTERP_KERNEL::Exception);
748   private:
749     MEDFileIntField1TS();
750     MEDFileIntField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
751     MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
752     MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception);
753     MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
754   };
755   
756   class MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
757   {
758   protected:
759     MEDFileAnyTypeFieldMultiTSWithoutSDA();
760     MEDFileAnyTypeFieldMultiTSWithoutSDA(const char *fieldName);
761     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception);
762     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception);
763   public:
764     std::size_t getHeapMemorySize() const;
765     virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception);
766     virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const throw(INTERP_KERNEL::Exception);
767     virtual const char *getTypeStr() const throw(INTERP_KERNEL::Exception) = 0;
768     virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0;
769     virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const throw(INTERP_KERNEL::Exception) = 0;
770     virtual MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const throw(INTERP_KERNEL::Exception) = 0;
771     virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const throw(INTERP_KERNEL::Exception) = 0;
772     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
773     void setInfo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
774     int getTimeStepPos(int iteration, int order) const throw(INTERP_KERNEL::Exception);
775     const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const throw(INTERP_KERNEL::Exception);
776     MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) throw(INTERP_KERNEL::Exception);
777     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
778     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
779     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
780     int getNumberOfTS() const;
781     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
782     void eraseTimeStepIds(const int *startIds, const int *endIds) throw(INTERP_KERNEL::Exception);
783     void eraseTimeStepIds2(int bg, int end, int step) throw(INTERP_KERNEL::Exception);
784     MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds(const int *startIds, const int *endIds) const throw(INTERP_KERNEL::Exception);
785     MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
786     MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const throw(INTERP_KERNEL::Exception);
787     MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const throw(INTERP_KERNEL::Exception);
788     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
789     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
790     std::vector< std::pair<int,int> > getIterations() const;
791     std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const throw(INTERP_KERNEL::Exception);
792     void pushBackTimeStep(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA>& tse) throw(INTERP_KERNEL::Exception);
793     void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
794     void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
795     int getNonEmptyLevels(int iteration, int order, const char *mname, std::vector<int>& levs) const throw(INTERP_KERNEL::Exception);
796     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
797     void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
798     std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const char *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 throw(INTERP_KERNEL::Exception);
799     std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
800     DataArray *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception);
801     DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
802     bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
803     void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll) throw(INTERP_KERNEL::Exception);
804     void writeLL(med_idt fid, const MEDFileWritable& opts) const throw(INTERP_KERNEL::Exception);
805   public:
806     const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const throw(INTERP_KERNEL::Exception);
807     MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) throw(INTERP_KERNEL::Exception);
808     std::vector<std::string> getPflsReallyUsed2() const;
809     std::vector<std::string> getLocsReallyUsed2() const;
810     std::vector<std::string> getPflsReallyUsedMulti2() const;
811     std::vector<std::string> getLocsReallyUsedMulti2() const;
812     void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
813     void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
814     void setIteration(int i, MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ts) throw(INTERP_KERNEL::Exception);
815   protected:
816     virtual med_field_type getMEDFileFieldType() const = 0;
817     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr) throw(INTERP_KERNEL::Exception);
818     void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field, const DataArray *arr) const throw(INTERP_KERNEL::Exception);
819     void checkThatComponentsMatch(const std::vector<std::string>& compos) const throw(INTERP_KERNEL::Exception);
820     void checkThatNbOfCompoOfTSMatchThis() const throw(INTERP_KERNEL::Exception);
821   protected:
822     std::vector<std::string> _infos;
823     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
824   };
825
826   class MEDFileIntFieldMultiTSWithoutSDA;
827
828   class MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
829   {
830   public:
831     static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception);
832     MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception);
833     const char *getTypeStr() const throw(INTERP_KERNEL::Exception);
834     MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception);
835     MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const throw(INTERP_KERNEL::Exception);
836     std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const char *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 throw(INTERP_KERNEL::Exception);
837     MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const throw(INTERP_KERNEL::Exception);
838   protected:
839     MEDFileFieldMultiTSWithoutSDA(const char *fieldName);
840     MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception);
841     med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
842     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const throw(INTERP_KERNEL::Exception);
843     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const throw(INTERP_KERNEL::Exception);
844   public:
845     MEDFileFieldMultiTSWithoutSDA();
846   };
847
848   class MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
849   {
850   public:
851     static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception);
852     MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception);
853     const char *getTypeStr() const throw(INTERP_KERNEL::Exception);
854     MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception);
855     MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const throw(INTERP_KERNEL::Exception);
856     MEDFileFieldMultiTSWithoutSDA *convertToDouble() const throw(INTERP_KERNEL::Exception);
857   protected:
858     MEDFileIntFieldMultiTSWithoutSDA(const char *fieldName);
859     MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception);
860     med_field_type getMEDFileFieldType() const { return MED_INT32; }
861     MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const throw(INTERP_KERNEL::Exception);
862     void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const throw(INTERP_KERNEL::Exception);
863   public:
864     MEDFileIntFieldMultiTSWithoutSDA();
865   };
866
867   class MEDFileAnyTypeFieldMultiTSIterator;
868   
869   /*!
870    * User class.
871    */
872   class MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileWritable, public MEDFileFieldGlobsReal
873   {
874   protected:
875     MEDFileAnyTypeFieldMultiTS();
876     MEDFileAnyTypeFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
877     MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
878     MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
879     static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const char *fileName) throw(INTERP_KERNEL::Exception);
880     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
881     static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
882   public:
883     static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
884     static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
885     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
886     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
887     std::size_t getHeapMemorySize() const;
888     virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
889     std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const throw(INTERP_KERNEL::Exception);
890     virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0;
891     virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const throw(INTERP_KERNEL::Exception) = 0;
892     //
893     virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception) = 0;
894     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
895     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
896   public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
897     std::string getName() const;
898     void setName(const char *name);
899     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
900     void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
901     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
902     void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
903     std::string simpleRepr() const;
904     void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
905     int getNumberOfTS() const;
906     void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
907     void eraseTimeStepIds(const int *startIds, const int *endIds) throw(INTERP_KERNEL::Exception);
908     void eraseTimeStepIds2(int bg, int end, int step) throw(INTERP_KERNEL::Exception);
909     MEDFileAnyTypeFieldMultiTS *buildSubPart(const int *startIds, const int *endIds) const throw(INTERP_KERNEL::Exception);
910     MEDFileAnyTypeFieldMultiTS *buildSubPartSlice(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
911     std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const throw(INTERP_KERNEL::Exception);
912     std::vector< std::pair<int,int> > getIterations() const;
913     void pushBackTimeSteps(const std::vector<MEDFileAnyTypeField1TS *>& f1ts) throw(INTERP_KERNEL::Exception);
914     void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
915     void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
916     int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
917     int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
918     MEDFileAnyTypeFieldMultiTSIterator *iterator() throw(INTERP_KERNEL::Exception);
919     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
920     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
921     void setInfo(const std::vector<std::string>& info) throw(INTERP_KERNEL::Exception);
922     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
923     int getNonEmptyLevels(int iteration, int order, const char *mname, std::vector<int>& levs) const throw(INTERP_KERNEL::Exception);
924     std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
925     std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const char *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 throw(INTERP_KERNEL::Exception);
926     MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
927   public:
928     std::vector<std::string> getPflsReallyUsed() const;
929     std::vector<std::string> getLocsReallyUsed() const;
930     std::vector<std::string> getPflsReallyUsedMulti() const;
931     std::vector<std::string> getLocsReallyUsedMulti() const;
932     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
933     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
934   protected:
935     MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() throw(INTERP_KERNEL::Exception);
936     const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const throw(INTERP_KERNEL::Exception);
937   protected:
938     MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
939   };
940
941   class MEDFileIntFieldMultiTS;
942
943   /*!
944    * User class.
945    */
946   class MEDLOADER_EXPORT MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
947   {
948   public:
949     static MEDFileFieldMultiTS *New();
950     static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
951     static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
952     static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
953     MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
954     void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const throw(INTERP_KERNEL::Exception);
955     MEDFileIntFieldMultiTS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
956     //
957     MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
958     MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
959     MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
960     //
961     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
962     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
963     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
964     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
965     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
966     DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception);
967     //
968     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
969     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
970 std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const char *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 throw(INTERP_KERNEL::Exception);
971     DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception);
972     DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
973   private:
974     const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const throw(INTERP_KERNEL::Exception);
975     MEDFileFieldMultiTSWithoutSDA *contentNotNull() throw(INTERP_KERNEL::Exception);
976   private:
977     MEDFileFieldMultiTS();
978     MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
979     MEDFileFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
980     MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
981   };
982
983   /*!
984    * User class.
985    */
986   class MEDLOADER_EXPORT MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
987   {
988   public:
989     static MEDFileIntFieldMultiTS *New();
990     static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
991     static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
992     static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
993     MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
994     void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const throw(INTERP_KERNEL::Exception);
995     MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
996     MEDFileFieldMultiTS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
997     //
998     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
999     MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1000     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1001     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1002     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1003     DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception);
1004     //
1005     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1006     void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1007     //
1008     DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1009   private:
1010     const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const throw(INTERP_KERNEL::Exception);
1011     MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() throw(INTERP_KERNEL::Exception);
1012   private:
1013     MEDFileIntFieldMultiTS();
1014     MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1015     MEDFileIntFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
1016     MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception);
1017   };
1018
1019   class MEDCOUPLING_EXPORT MEDFileAnyTypeFieldMultiTSIterator
1020   {
1021   public:
1022     MEDFileAnyTypeFieldMultiTSIterator(MEDFileAnyTypeFieldMultiTS *fmts);
1023     ~MEDFileAnyTypeFieldMultiTSIterator();
1024     MEDFileAnyTypeField1TS *nextt() throw(INTERP_KERNEL::Exception);
1025   private:
1026     MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> _fmts;
1027      int _iter_id;
1028      int _nb_iter;
1029   };
1030
1031   class MEDFileFieldsIterator;
1032
1033   /*!
1034    * Use class.
1035    */
1036   class MEDLOADER_EXPORT MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1037   {
1038   public:
1039     static MEDFileFields *New();
1040     static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1041     std::size_t getHeapMemorySize() const;
1042     MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
1043     MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
1044     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1045     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
1046     int getNumberOfFields() const;
1047     std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const throw(INTERP_KERNEL::Exception);
1048     std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
1049     std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1050     std::string simpleRepr() const;
1051     void simpleRepr(int bkOffset, std::ostream& oss) const;
1052     //
1053     void resize(int newSize) throw(INTERP_KERNEL::Exception);
1054     void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
1055     void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields) throw(INTERP_KERNEL::Exception);
1056     void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
1057     int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
1058     MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
1059     MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
1060     MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const throw(INTERP_KERNEL::Exception);
1061     MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
1062     MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const throw(INTERP_KERNEL::Exception);
1063     MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const throw(INTERP_KERNEL::Exception);
1064     MEDFileFieldsIterator *iterator() throw(INTERP_KERNEL::Exception);
1065     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
1066     void destroyFieldsAtPos(const int *startIds, const int *endIds) throw(INTERP_KERNEL::Exception);
1067     void destroyFieldsAtPos2(int bg, int end, int step) throw(INTERP_KERNEL::Exception);
1068     bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
1069     bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N) throw(INTERP_KERNEL::Exception);
1070   public:
1071     std::vector<std::string> getPflsReallyUsed() const;
1072     std::vector<std::string> getLocsReallyUsed() const;
1073     std::vector<std::string> getPflsReallyUsedMulti() const;
1074     std::vector<std::string> getLocsReallyUsedMulti() const;
1075     void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
1076     void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
1077   private:
1078     MEDFileFields();
1079     MEDFileFields(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception);
1080   private:
1081     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
1082   };
1083
1084   class MEDCOUPLING_EXPORT MEDFileFieldsIterator
1085   {
1086   public:
1087     MEDFileFieldsIterator(MEDFileFields *fs);
1088     ~MEDFileFieldsIterator();
1089     MEDFileAnyTypeFieldMultiTS *nextt();
1090   private:
1091     MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fs;
1092      int _iter_id;
1093      int _nb_iter;
1094   };
1095 }
1096
1097 #endif