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