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