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