1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __MEDFILEFIELD_HXX__
22 #define __MEDFILEFIELD_HXX__
24 #include "MEDLoaderDefines.hxx"
26 #include "MEDFileFieldOverView.hxx"
27 #include "MEDFileUtilities.hxx"
29 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
30 #include "MEDCouplingRefCountObject.hxx"
31 #include "MEDCouplingMemArray.hxx"
33 #include "NormalizedUnstructuredMesh.hxx"
34 #include "InterpKernelException.hxx"
45 class MEDFileFieldGlobs;
46 class MEDCouplingMesh;
47 class MEDCouplingFieldDouble;
50 class MEDFileFieldLoc : public RefCountObject
53 MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const;
54 MEDLOADER_EXPORT std::string getName() const { return _name; }
55 MEDLOADER_EXPORT void setName(const std::string& name);
56 static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
57 static MEDFileFieldLoc *New(med_idt fid, int id);
58 static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
59 std::size_t getHeapMemorySizeWithoutChildren() const;
60 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
61 MEDFileFieldLoc *deepCpy() const;
62 MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
63 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
64 MEDLOADER_EXPORT std::string repr() const;
65 MEDLOADER_EXPORT bool isName(const std::string& name) const { return _name==name; }
66 MEDLOADER_EXPORT int getDimension() const { return _dim; }
67 MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
68 MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
69 MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
70 MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
71 MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
72 MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _geo_type; }
73 MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
75 MEDFileFieldLoc(med_idt fid, const std::string& locName);
76 MEDFileFieldLoc(med_idt fid, int id);
77 MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
81 int _nb_node_per_cell;
83 INTERP_KERNEL::NormalizedCellType _geo_type;
84 std::vector<double> _ref_coo;
85 std::vector<double> _gs_coo;
86 std::vector<double> _w;
90 class MEDFileAnyTypeField1TSWithoutSDA;
91 class MEDFileFieldPerMeshPerType;
92 class MEDFileField1TSWithoutSDA;
93 class MEDFileFieldNameScope;
94 class MEDFileFieldGlobsReal;
95 class MEDFileFieldPerMesh;
98 class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
101 static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
102 static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId);
103 static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
104 std::size_t getHeapMemorySizeWithoutChildren() const;
105 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
106 MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const;
107 void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
108 void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
109 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
110 void getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const;
111 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
112 const MEDFileFieldPerMeshPerType *getFather() const;
113 void loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc);
114 void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc);
115 void setNewStart(int newValueOfStart);
116 int getIteration() const;
117 int getOrder() const;
118 double getTime() const;
119 std::string getMeshName() const;
120 TypeOfField getType() const;
121 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
122 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
123 void setType(TypeOfField newType);
124 INTERP_KERNEL::NormalizedCellType getGeoType() const;
125 int getNumberOfComponents() const;
126 int getNumberOfTuples() const;
127 int getStart() const { return _start; }
128 int getEnd() const { return _end; }
129 DataArray *getOrCreateAndGetArray();
130 const DataArray *getOrCreateAndGetArray() const;
131 const std::vector<std::string>& getInfo() const;
132 std::string getProfile() const;
133 void setProfile(const std::string& newPflName);
134 std::string getLocalization() const;
135 void setLocalization(const std::string& newLocName);
136 int getLocId() const { return _loc_id; }
137 void setLocId(int newId) const { _loc_id=newId; }
138 void setFather(MEDFileFieldPerMeshPerType *newFather) { _father=newFather; }
139 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
140 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
141 void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
142 std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
143 void fillValues(int discId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
144 int fillEltIdsFromCode(int offset, const std::vector<int>& codeOfMesh, const MEDFileFieldGlobsReal& glob, int *ptToFill) const;
145 int fillTupleIds(int *ptToFill) const;
146 static int ConvertType(TypeOfField type, int locId);
147 static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
148 static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
149 const DataArrayInt *explicitIdsInMesh, const std::vector<int>& newCode,
150 MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >& result);
151 static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
152 bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
153 MEDFileFieldGlobsReal& glob, bool ¬InExisting);
155 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
156 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt, const std::string& dummy);
157 MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other);
158 MEDFileFieldPerMeshPerTypePerDisc();
160 void goReadZeValuesInFile(med_idt fid, const std::string& fieldName, int nbOfCompo, int iteration, int order, med_entity_type menti, med_geometry_type mgeoti, unsigned char *startFeedingPtr);
163 MEDFileFieldPerMeshPerType *_father;
166 //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi)
168 std::string _profile;
169 std::string _localization;
170 //! only on assignement -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
172 mutable int _profile_it;
173 MEDCouplingAutoRefCountObjectPtr<PartDefinition> _pd;
175 mutable int _tmp_work1;
178 class MEDFileFieldPerMeshPerType : public RefCountObject, public MEDFileWritable
181 static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
182 static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
183 std::size_t getHeapMemorySizeWithoutChildren() const;
184 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
185 MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const;
186 void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
187 void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
188 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
189 void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
190 const MEDFileFieldPerMesh *getFather() const;
191 void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
192 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
193 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
194 void getDimension(int& dim) const;
195 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
196 void fillFieldSplitedByType(std::vector< std::pair<int,int> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const;
197 int getIteration() const;
198 int getOrder() const;
199 double getTime() const;
200 std::string getMeshName() const;
201 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
202 void getSizes(int& globalSz, int& nbOfEntries) const;
203 INTERP_KERNEL::NormalizedCellType getGeoType() const;
204 int getNumberOfComponents() const;
205 bool presenceOfMultiDiscPerGeoType() const;
206 DataArray *getOrCreateAndGetArray();
207 const DataArray *getOrCreateAndGetArray() const;
208 const std::vector<std::string>& getInfo() const;
209 std::vector<std::string> getPflsReallyUsed() const;
210 std::vector<std::string> getLocsReallyUsed() const;
211 std::vector<std::string> getPflsReallyUsedMulti() const;
212 std::vector<std::string> getLocsReallyUsedMulti() const;
213 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
214 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
215 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId);
216 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const;
217 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;
218 void fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
219 void setLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
220 bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
221 bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
222 static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
224 std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
225 std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
226 std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells);
227 std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells);
228 MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
229 MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
231 MEDFileFieldPerMesh *_father;
232 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
233 INTERP_KERNEL::NormalizedCellType _geo_type;
238 class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
241 static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
242 static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm);
243 std::size_t getHeapMemorySizeWithoutChildren() const;
244 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
245 MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
246 void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
247 void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
248 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);
249 void assignFieldNoProfileNoRenum(int& start, const std::vector<int>& code, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
250 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
251 void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
252 void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
253 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
254 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
255 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
256 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;
257 void getDimension(int& dim) const;
258 double getTime() const;
259 int getIteration() const;
260 int getOrder() const;
261 int getMeshIteration() const { return _mesh_iteration; }
262 int getMeshOrder() const { return _mesh_order; }
263 std::string getMeshName() const { return _mesh_name; }
264 int getNumberOfComponents() const;
265 bool presenceOfMultiDiscPerGeoType() const;
266 DataArray *getOrCreateAndGetArray();
267 const DataArray *getOrCreateAndGetArray() const;
268 const std::vector<std::string>& getInfo() const;
269 std::vector<std::string> getPflsReallyUsed() const;
270 std::vector<std::string> getLocsReallyUsed() const;
271 std::vector<std::string> getPflsReallyUsedMulti() const;
272 std::vector<std::string> getLocsReallyUsedMulti() const;
273 bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
274 bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
275 void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
276 void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
277 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
278 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
279 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
280 DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
281 void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
282 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId);
283 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const;
285 int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
286 MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
287 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;
288 MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
289 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
290 const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
291 const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
292 MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
293 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
294 const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
295 DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
296 void assignNewLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
297 static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type,
298 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,
299 std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
300 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);
301 MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm);
302 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
304 std::string _mesh_name;
307 MEDFileAnyTypeField1TSWithoutSDA *_father;
308 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > _field_pm_pt;
311 class MEDFileFieldGlobsReal;
313 class MEDFileFieldGlobs : public RefCountObject
316 static MEDFileFieldGlobs *New(const std::string& fname);
317 static MEDFileFieldGlobs *New();
318 std::size_t getHeapMemorySizeWithoutChildren() const;
319 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
320 MEDFileFieldGlobs *deepCpy() const;
321 MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
322 MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
323 void simpleRepr(std::ostream& oss) const;
324 void appendGlobs(const MEDFileFieldGlobs& other, double eps);
325 void checkGlobsPflsPartCoherency(const std::vector<std::string>& pflsUsed) const;
326 void checkGlobsLocsPartCoherency(const std::vector<std::string>& locsUsed) const;
327 void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
328 void loadProfileInFile(med_idt fid, int id);
329 void loadGlobals(med_idt fid, const MEDFileFieldGlobsReal& real);
330 void loadAllGlobals(med_idt fid);
331 void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
332 std::vector<std::string> getPfls() const;
333 std::vector<std::string> getLocs() const;
334 bool existsPfl(const std::string& pflName) const;
335 bool existsLoc(const std::string& locName) const;
336 std::string createNewNameOfPfl() const;
337 std::string createNewNameOfLoc() const;
338 std::vector< std::vector<int> > whichAreEqualProfiles() const;
339 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
340 void setFileName(const std::string& fileName);
341 void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
342 void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
343 int getNbOfGaussPtPerCell(int locId) const;
344 int getLocalizationId(const std::string& loc) const;
345 std::string getFileName() const { return _file_name; }
346 const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
347 const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
348 const DataArrayInt *getProfileFromId(int pflId) const;
349 const DataArrayInt *getProfile(const std::string& pflName) const;
350 MEDFileFieldLoc& getLocalizationFromId(int locId);
351 MEDFileFieldLoc& getLocalization(const std::string& locName);
352 DataArrayInt *getProfile(const std::string& pflName);
353 DataArrayInt *getProfileFromId(int pflId);
354 void killProfileIds(const std::vector<int>& pflIds);
355 void killLocalizationIds(const std::vector<int>& locIds);
357 void appendProfile(DataArrayInt *pfl);
358 void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
360 static std::string CreateNewNameNotIn(const std::string& prefix, const std::vector<std::string>& namesToAvoid);
362 MEDFileFieldGlobs(const std::string& fname);
364 ~MEDFileFieldGlobs();
366 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _pfls;
367 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> > _locs;
368 std::string _file_name;
371 /// @endcond INTERNAL
373 class MEDFileFieldGlobsReal
376 MEDLOADER_EXPORT MEDFileFieldGlobsReal(const std::string& fname);
377 MEDLOADER_EXPORT MEDFileFieldGlobsReal();
378 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
379 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
380 MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const;
381 MEDLOADER_EXPORT void resetContent();
382 MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
383 MEDLOADER_EXPORT void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
384 MEDLOADER_EXPORT void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
385 MEDLOADER_EXPORT void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
386 MEDLOADER_EXPORT void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
387 MEDLOADER_EXPORT void checkGlobsCoherency() const;
388 MEDLOADER_EXPORT void checkGlobsPflsPartCoherency() const;
389 MEDLOADER_EXPORT void checkGlobsLocsPartCoherency() const;
390 MEDLOADER_EXPORT virtual std::vector<std::string> getPflsReallyUsed() const = 0;
391 MEDLOADER_EXPORT virtual std::vector<std::string> getLocsReallyUsed() const = 0;
392 MEDLOADER_EXPORT virtual std::vector<std::string> getPflsReallyUsedMulti() const = 0;
393 MEDLOADER_EXPORT virtual std::vector<std::string> getLocsReallyUsedMulti() const = 0;
394 MEDLOADER_EXPORT virtual void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
395 MEDLOADER_EXPORT virtual void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
396 MEDLOADER_EXPORT virtual ~MEDFileFieldGlobsReal();
398 MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
399 MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id);
400 MEDLOADER_EXPORT void loadGlobals(med_idt fid);
401 MEDLOADER_EXPORT void loadAllGlobals(med_idt fid);
402 MEDLOADER_EXPORT void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
403 MEDLOADER_EXPORT std::vector<std::string> getPfls() const;
404 MEDLOADER_EXPORT std::vector<std::string> getLocs() const;
405 MEDLOADER_EXPORT bool existsPfl(const std::string& pflName) const;
406 MEDLOADER_EXPORT bool existsLoc(const std::string& locName) const;
407 MEDLOADER_EXPORT std::string createNewNameOfPfl() const;
408 MEDLOADER_EXPORT std::string createNewNameOfLoc() const;
409 MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualProfiles() const;
410 MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
411 MEDLOADER_EXPORT void setFileName(const std::string& fileName);
412 MEDLOADER_EXPORT void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
413 MEDLOADER_EXPORT void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
414 MEDLOADER_EXPORT void changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
415 MEDLOADER_EXPORT void changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
416 MEDLOADER_EXPORT void changePflName(const std::string& oldName, const std::string& newName);
417 MEDLOADER_EXPORT void changeLocName(const std::string& oldName, const std::string& newName);
418 MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipPflsNames();
419 MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipLocsNames(double eps);
420 MEDLOADER_EXPORT int getNbOfGaussPtPerCell(int locId) const;
421 MEDLOADER_EXPORT int getLocalizationId(const std::string& loc) const;
422 MEDLOADER_EXPORT std::string getFileName() const;
423 MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
424 MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
425 MEDLOADER_EXPORT MEDFileFieldLoc& getLocalizationFromId(int locId);
426 MEDLOADER_EXPORT MEDFileFieldLoc& getLocalization(const std::string& locName);
427 MEDLOADER_EXPORT const DataArrayInt *getProfile(const std::string& pflName) const;
428 MEDLOADER_EXPORT const DataArrayInt *getProfileFromId(int pflId) const;
429 MEDLOADER_EXPORT DataArrayInt *getProfile(const std::string& pflName);
430 MEDLOADER_EXPORT DataArrayInt *getProfileFromId(int pflId);
431 MEDLOADER_EXPORT void killProfileIds(const std::vector<int>& pflIds);
432 MEDLOADER_EXPORT void killLocalizationIds(const std::vector<int>& locIds);
434 MEDLOADER_EXPORT void appendProfile(DataArrayInt *pfl);
435 MEDLOADER_EXPORT void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
437 MEDFileFieldGlobs *contentNotNull();
438 const MEDFileFieldGlobs *contentNotNull() const;
440 MEDCouplingAutoRefCountObjectPtr< MEDFileFieldGlobs > _globals;
443 class MEDFileFieldNameScope
446 MEDLOADER_EXPORT MEDFileFieldNameScope();
447 MEDLOADER_EXPORT MEDFileFieldNameScope(const std::string& fieldName);
448 MEDLOADER_EXPORT std::string getName() const;
449 MEDLOADER_EXPORT void setName(const std::string& fieldName);
450 MEDLOADER_EXPORT std::string getDtUnit() const;
451 MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
452 MEDLOADER_EXPORT void copyNameScope(const MEDFileFieldNameScope& other);
455 std::string _dt_unit;
461 * SDA is for Shared Data Arrays such as profiles.
463 class MEDFileAnyTypeField1TSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
466 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA();
467 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order);
468 MEDLOADER_EXPORT int getIteration() const { return _iteration; }
469 MEDLOADER_EXPORT int getOrder() const { return _order; }
470 MEDLOADER_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
471 MEDLOADER_EXPORT void setTime(int iteration, int order, double val) { _dt=val; _iteration=iteration; _order=order; }
472 MEDLOADER_EXPORT int getDimension() const;
473 MEDLOADER_EXPORT std::string getMeshName() const;
474 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
475 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
476 MEDLOADER_EXPORT int getMeshIteration() const;
477 MEDLOADER_EXPORT int getMeshOrder() const;
478 MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
479 MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
480 MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
481 MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
482 MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
484 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
485 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
486 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
487 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
488 MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
489 MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
491 MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
492 MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
494 MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
495 MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
496 MEDLOADER_EXPORT void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other);
498 MEDLOADER_EXPORT int getNumberOfComponents() const;
499 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
500 MEDLOADER_EXPORT std::vector<std::string>& getInfo();
501 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
502 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
503 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
504 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
505 MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
506 MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
507 MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
508 MEDLOADER_EXPORT virtual void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
509 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const = 0;
510 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const = 0;
511 MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const;
512 MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
513 MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArray() const = 0;
514 MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const = 0;
515 MEDLOADER_EXPORT virtual void setArray(DataArray *arr) = 0;
516 MEDLOADER_EXPORT virtual DataArray *createNewEmptyDataArrayInstance() const = 0;
517 MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
518 MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
520 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
521 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
522 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
523 MEDLOADER_EXPORT 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;
524 DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
526 MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
527 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
528 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
529 MEDLOADER_EXPORT int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its);
530 MEDLOADER_EXPORT int keepOnlyGaussDiscretization(std::size_t idOfDisc, std::vector< std::pair<int,int> >& its);
532 MEDLOADER_EXPORT void allocNotFromFile(int newNbOfTuples);
533 MEDLOADER_EXPORT bool allocIfNecessaryTheArrayToReceiveDataFromFile();
534 MEDLOADER_EXPORT void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms);
535 MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
536 MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
537 MEDLOADER_EXPORT void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms);
538 MEDLOADER_EXPORT void unloadArrays();
539 MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const;
541 int getMeshIdFromMeshName(const std::string& mName) const;
542 int addNewEntryIfNecessary(const MEDCouplingMesh *mesh);
543 void updateData(int newLgth, const std::vector< std::pair<int,int> >& oldStartStops);
545 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > > _field_per_mesh;
550 //! only useable on reading
552 // -3 means allocated and build from scratch
553 // -2 means allocated and read from a file
554 // -1 means not allocated and build from scratch
555 // >=0 means not allocated and read from a file
556 mutable int _nb_of_tuples_to_be_allocated;
559 class MEDFileIntField1TSWithoutSDA;
562 * SDA is for Shared Data Arrays such as profiles.
564 class MEDFileField1TSWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
567 MEDLOADER_EXPORT const char *getTypeStr() const;
568 MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
569 MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
570 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDouble() const;
571 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDoubleExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
572 MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
573 MEDLOADER_EXPORT static void CheckMeshDimRel(int meshDimRelToMax);
574 MEDLOADER_EXPORT static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh);
575 MEDLOADER_EXPORT static MEDFileField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
577 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA();
578 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
579 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const;
580 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const;
581 MEDLOADER_EXPORT void setArray(DataArray *arr);
582 MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
583 MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
584 MEDLOADER_EXPORT const DataArray *getOrCreateAndGetArray() const;
585 MEDLOADER_EXPORT DataArrayDouble *getOrCreateAndGetArrayDouble();
586 MEDLOADER_EXPORT const DataArrayDouble *getOrCreateAndGetArrayDouble() const;
587 MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const;
589 MEDCouplingAutoRefCountObjectPtr< DataArrayDouble > _arr;
591 static const char TYPE_STR[];
595 * SDA is for Shared Data Arrays such as profiles.
597 class MEDFileIntField1TSWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
600 MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
601 MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
602 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const;
603 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const;
604 MEDLOADER_EXPORT const char *getTypeStr() const;
605 MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
606 MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
607 MEDLOADER_EXPORT void setArray(DataArray *arr);
608 MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
609 MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
610 MEDLOADER_EXPORT const DataArray *getOrCreateAndGetArray() const;
611 MEDLOADER_EXPORT DataArrayInt *getOrCreateAndGetArrayInt();
612 MEDLOADER_EXPORT const DataArrayInt *getOrCreateAndGetArrayInt() const;
613 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayInt() const;
614 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
615 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
617 MEDFileIntField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
619 MEDCouplingAutoRefCountObjectPtr< DataArrayInt > _arr;
621 MEDLOADER_EXPORT static const char TYPE_STR[];
627 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileWritable, public MEDFileFieldGlobsReal
630 MEDLOADER_EXPORT MEDFileAnyTypeField1TS();
631 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
632 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
633 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
634 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
635 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const std::string& fileName);
636 MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
637 MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
638 MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
639 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
640 // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
642 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
643 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
644 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
645 MEDLOADER_EXPORT int getDimension() const;
646 MEDLOADER_EXPORT int getIteration() const;
647 MEDLOADER_EXPORT int getOrder() const;
648 MEDLOADER_EXPORT double getTime(int& iteration, int& order) const;
649 MEDLOADER_EXPORT void setTime(int iteration, int order, double val);
650 MEDLOADER_EXPORT std::string getName() const;
651 MEDLOADER_EXPORT void setName(const std::string& name);
652 MEDLOADER_EXPORT std::string simpleRepr() const;
653 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
654 MEDLOADER_EXPORT std::string getDtUnit() const;
655 MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
656 MEDLOADER_EXPORT std::string getMeshName() const;
657 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
658 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
659 MEDLOADER_EXPORT int getMeshIteration() const;
660 MEDLOADER_EXPORT int getMeshOrder() const;
661 MEDLOADER_EXPORT int getNumberOfComponents() const;
662 MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
663 MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
664 MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
665 MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
666 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
667 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
668 MEDLOADER_EXPORT std::vector<std::string>& getInfo();
669 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
670 MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
671 MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
672 std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
673 MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
674 MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
675 MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
677 MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
678 MEDLOADER_EXPORT void loadArrays();
679 MEDLOADER_EXPORT void loadArraysIfNecessary();
680 MEDLOADER_EXPORT void unloadArrays();
681 MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
682 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitComponents() const;
683 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
684 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
685 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCpy() const;
686 MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
687 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
689 //! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
690 MEDLOADER_EXPORT void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
691 //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
692 MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
693 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
694 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
695 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
696 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
697 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
698 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
699 MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
700 MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
702 MEDLOADER_EXPORT static int LocateField2(med_idt fid, const std::string& fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
703 MEDLOADER_EXPORT static int LocateField(med_idt fid, const std::string& fileName, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
705 MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
706 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
707 MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const;
709 MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> _content;
712 class MEDFileIntField1TS;
717 class MEDFileField1TS : public MEDFileAnyTypeField1TS
720 MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
721 MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
722 MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
723 MEDLOADER_EXPORT static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
724 MEDLOADER_EXPORT static MEDFileField1TS *New();
725 MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
727 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
728 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
729 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
730 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
731 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
732 MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
734 MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
735 MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
736 // direct forwarding to MEDFileField1TSWithoutSDA instance _content
738 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *shallowCpy() const;
739 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const;
740 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
742 MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
743 std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
745 MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
746 MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
748 med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
749 const MEDFileField1TSWithoutSDA *contentNotNull() const;
750 MEDFileField1TSWithoutSDA *contentNotNull();
752 ~MEDFileField1TS() { }
753 MEDFileField1TS(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
754 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
755 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
756 MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
760 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
763 MEDLOADER_EXPORT static MEDFileIntField1TS *New();
764 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
765 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
766 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
767 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
768 MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
769 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *shallowCpy() const;
771 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
772 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, DataArrayInt* &arrOut, int renumPol=0) const;
773 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
774 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
775 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
776 MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
778 MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals);
779 MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
780 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
782 MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
784 med_field_type getMEDFileFieldType() const { return MED_INT32; }
785 const MEDFileIntField1TSWithoutSDA *contentNotNull() const;
786 MEDFileIntField1TSWithoutSDA *contentNotNull();
788 ~MEDFileIntField1TS() { }
789 MEDFileIntField1TS();
790 MEDFileIntField1TS(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
791 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
792 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
793 MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
796 class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
799 MEDFileAnyTypeFieldMultiTSWithoutSDA();
800 MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName);
801 MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms);
802 MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms);
804 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
805 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
806 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const;
807 MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
808 MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
809 MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
810 MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
811 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const = 0;
812 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const = 0;
813 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const = 0;
814 MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const = 0;
815 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
816 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
817 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
818 MEDLOADER_EXPORT int getTimeStepPos(int iteration, int order) const;
819 MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const;
820 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order);
821 MEDLOADER_EXPORT std::string getMeshName() const;
822 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
823 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
824 MEDLOADER_EXPORT int getNumberOfTS() const;
825 MEDLOADER_EXPORT void eraseEmptyTS();
826 MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
827 MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
828 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds(const int *startIds, const int *endIds) const;
829 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds2(int bg, int end, int step) const;
830 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
831 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
832 MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
833 MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
834 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
835 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
836 MEDLOADER_EXPORT void pushBackTimeStep(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA>& tse);
837 MEDLOADER_EXPORT void synchronizeNameScope();
838 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
839 MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
840 MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
841 MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob);
842 MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
843 MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
844 MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
845 MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
846 MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
847 MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms);
848 MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
849 MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
850 MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
851 MEDLOADER_EXPORT void unloadArrays();
853 MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const;
854 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos);
855 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
856 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
857 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
858 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
859 MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
860 MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
861 MEDLOADER_EXPORT void setIteration(int i, MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ts);
863 virtual med_field_type getMEDFileFieldType() const = 0;
864 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
865 void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field, const DataArray *arr) const;
866 void checkThatComponentsMatch(const std::vector<std::string>& compos) const;
867 void checkThatNbOfCompoOfTSMatchThis() const;
869 std::vector<std::string> _infos;
870 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
873 class MEDFileIntFieldMultiTSWithoutSDA;
875 class MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
878 MEDLOADER_EXPORT static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms);
879 MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms);
880 MEDLOADER_EXPORT const char *getTypeStr() const;
881 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
882 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
883 MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
884 MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
886 MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName);
887 MEDFileFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms);
888 med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
889 MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
890 void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
892 MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA();
895 class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
898 MEDLOADER_EXPORT static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms);
899 MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms);
900 MEDLOADER_EXPORT const char *getTypeStr() const;
901 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
902 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
903 MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
905 MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName);
906 MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms);
907 med_field_type getMEDFileFieldType() const { return MED_INT32; }
908 MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
909 void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
911 MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA();
914 class MEDFileAnyTypeFieldMultiTSIterator;
915 class MEDFileFastCellSupportComparator;
919 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileWritable, public MEDFileFieldGlobsReal
922 MEDFileAnyTypeFieldMultiTS();
923 MEDFileAnyTypeFieldMultiTS(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
924 MEDFileAnyTypeFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
925 MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
926 static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const std::string& fileName);
927 static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
928 static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
930 MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
931 MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
932 MEDLOADER_EXPORT void loadArrays();
933 MEDLOADER_EXPORT void loadArraysIfNecessary();
934 MEDLOADER_EXPORT void unloadArrays();
935 MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
936 MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
937 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
938 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
939 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
940 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const;
941 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
942 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
943 MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
944 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const = 0;
945 MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const = 0;
947 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const = 0;
948 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
949 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
950 MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitIntoCommonTimeSeries(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS);
951 MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> >& fsc);
952 MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
953 public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
954 MEDLOADER_EXPORT std::string getName() const;
955 MEDLOADER_EXPORT void setName(const std::string& name);
956 MEDLOADER_EXPORT std::string getDtUnit() const;
957 MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
958 MEDLOADER_EXPORT std::string getMeshName() const;
959 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
960 MEDLOADER_EXPORT std::string simpleRepr() const;
961 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
962 MEDLOADER_EXPORT int getNumberOfTS() const;
963 MEDLOADER_EXPORT void eraseEmptyTS();
964 MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
965 MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
966 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPart(const int *startIds, const int *endIds) const;
967 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPartSlice(int bg, int end, int step) const;
968 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
969 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
970 MEDLOADER_EXPORT void pushBackTimeSteps(const std::vector<MEDFileAnyTypeField1TS *>& f1ts);
971 MEDLOADER_EXPORT void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
972 MEDLOADER_EXPORT void synchronizeNameScope();
973 MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
974 MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
975 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator *iterator();
976 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
977 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
978 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
979 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
980 MEDLOADER_EXPORT int getNumberOfComponents() const;
981 MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
982 MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
983 MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
984 MEDLOADER_EXPORT MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
986 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
987 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
988 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
989 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
990 MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
991 MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
993 MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase();
994 const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const;
996 static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> >& cmps);
998 MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
1001 class MEDFileIntFieldMultiTS;
1006 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1009 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New();
1010 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1011 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1012 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1013 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1014 MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1015 MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
1017 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
1018 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1019 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1021 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1022 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1023 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1024 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1025 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1026 MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1028 MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
1029 MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1030 MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
1031 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
1032 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1034 const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const;
1035 MEDFileFieldMultiTSWithoutSDA *contentNotNull();
1037 ~MEDFileFieldMultiTS() { }
1038 MEDFileFieldMultiTS();
1039 MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1040 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
1041 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
1047 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1050 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New();
1051 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1052 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1053 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1054 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1055 MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1056 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
1057 MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
1059 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
1060 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, DataArrayInt* &arrOut, int renumPol=0) const;
1061 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
1062 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
1063 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
1064 MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1066 MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals);
1067 MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1069 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
1071 const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const;
1072 MEDFileIntFieldMultiTSWithoutSDA *contentNotNull();
1074 ~MEDFileIntFieldMultiTS() { }
1075 MEDFileIntFieldMultiTS();
1076 MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1077 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
1078 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
1081 class MEDFileAnyTypeFieldMultiTSIterator
1084 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator(MEDFileAnyTypeFieldMultiTS *fmts);
1085 MEDLOADER_EXPORT ~MEDFileAnyTypeFieldMultiTSIterator();
1086 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
1088 MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> _fmts;
1093 class MEDFileFieldsIterator;
1098 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1101 MEDLOADER_EXPORT static MEDFileFields *New();
1102 MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
1103 MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
1104 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1105 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1106 MEDLOADER_EXPORT MEDFileFields *deepCpy() const;
1107 MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
1108 MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
1109 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1110 MEDLOADER_EXPORT void loadArrays();
1111 MEDLOADER_EXPORT void loadArraysIfNecessary();
1112 MEDLOADER_EXPORT void unloadArrays();
1113 MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1114 MEDLOADER_EXPORT int getNumberOfFields() const;
1115 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const;
1116 MEDLOADER_EXPORT std::vector<std::string> getFieldsNames() const;
1117 MEDLOADER_EXPORT std::vector<std::string> getMeshesNames() const;
1118 MEDLOADER_EXPORT std::string simpleRepr() const;
1119 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss) const;
1121 MEDLOADER_EXPORT void resize(int newSize);
1122 MEDLOADER_EXPORT void pushField(MEDFileAnyTypeFieldMultiTS *field);
1123 MEDLOADER_EXPORT void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields);
1124 MEDLOADER_EXPORT void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
1125 MEDLOADER_EXPORT int getPosFromFieldName(const std::string& fieldName) const;
1126 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
1127 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
1128 MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
1129 MEDLOADER_EXPORT bool removeFieldsWithoutAnyTimeStep();
1130 MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
1131 MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1132 MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1133 MEDLOADER_EXPORT MEDFileFieldsIterator *iterator();
1134 MEDLOADER_EXPORT void destroyFieldAtPos(int i);
1135 MEDLOADER_EXPORT void destroyFieldsAtPos(const int *startIds, const int *endIds);
1136 MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
1137 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1138 MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
1140 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1141 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1142 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1143 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1144 MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1145 MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1147 ~MEDFileFields() { }
1149 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms);
1151 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
1154 class MEDFileFieldsIterator
1157 MEDLOADER_EXPORT MEDFileFieldsIterator(MEDFileFields *fs);
1158 MEDLOADER_EXPORT ~MEDFileFieldsIterator();
1159 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
1161 MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fs;