1 // Copyright (C) 2007-2016 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.txx"
28 #include "MEDFileEntities.hxx"
31 #include "MEDLoaderTraits.hxx"
32 #include "MEDCouplingTraits.hxx"
33 #include "MEDCouplingRefCountObject.hxx"
34 #include "MEDCouplingFieldInt.hxx"
35 #include "MEDCouplingMemArray.hxx"
37 #include "NormalizedUnstructuredMesh.hxx"
38 #include "InterpKernelException.hxx"
49 class MEDFileFieldGlobs;
50 class MEDCouplingMesh;
51 class MEDCouplingFieldDouble;
57 virtual MEDFileGTKeeper *deepCopy() const = 0;
58 virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
59 virtual std::string getRepr() const = 0;
60 virtual bool isEqual(const MEDFileGTKeeper *other) const = 0;
61 virtual ~MEDFileGTKeeper();
64 class MEDFileGTKeeperSta : public MEDFileGTKeeper
67 MEDFileGTKeeperSta(INTERP_KERNEL::NormalizedCellType gt):_geo_type(gt) { }
68 MEDFileGTKeeper *deepCopy() const;
69 INTERP_KERNEL::NormalizedCellType getGeoType() const;
70 std::string getRepr() const;
71 bool isEqual(const MEDFileGTKeeper *other) const;
73 INTERP_KERNEL::NormalizedCellType _geo_type;
77 class MEDFileGTKeeperDyn : public MEDFileGTKeeper
80 MEDFileGTKeeperDyn(const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileStructureElement *se);
81 MEDFileGTKeeper *deepCopy() const;
82 INTERP_KERNEL::NormalizedCellType getGeoType() const;
83 std::string getRepr() const;
84 bool isEqual(const MEDFileGTKeeper *other) const;
86 MCConstAuto<MEDFileUMesh> _mesh;
87 MCConstAuto<MEDFileUMesh> _section;
88 MCConstAuto<MEDFileStructureElement> _se;
91 class MEDFileFieldLoc : public RefCountObject
94 MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const;
95 MEDLOADER_EXPORT std::string getName() const { return _name; }
96 MEDLOADER_EXPORT void setName(const std::string& name);
97 static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
98 static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities);
99 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);
100 std::size_t getHeapMemorySizeWithoutChildren() const;
101 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
102 MEDFileFieldLoc *deepCopy() const;
103 MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
104 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
105 MEDLOADER_EXPORT std::string repr() const;
106 MEDLOADER_EXPORT bool isName(const std::string& name) const { return _name==name; }
107 MEDLOADER_EXPORT int getDimension() const { return _dim; }
108 MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
109 MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
110 MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
111 MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
112 MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
113 MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _gt->getGeoType(); }
114 MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
116 MEDFileFieldLoc(const MEDFileFieldLoc& other);
117 MEDFileFieldLoc(med_idt fid, const std::string& locName);
118 MEDFileFieldLoc(med_idt fid, int id, const MEDFileEntities *entities);
119 MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
123 INTERP_KERNEL::AutoCppPtr<MEDFileGTKeeper> _gt;
124 int _nb_node_per_cell;
126 std::vector<double> _ref_coo;
127 std::vector<double> _gs_coo;
128 std::vector<double> _w;
132 class MEDFileAnyTypeField1TSWithoutSDA;
133 class MEDFileFieldPerMeshPerTypeCommon;
134 class MEDFileFieldPerMeshPerType;
135 class MEDFileField1TSWithoutSDA;
136 class MEDFileFieldNameScope;
137 class MEDFileFieldGlobsReal;
138 class MEDFileFieldPerMesh;
139 class PartDefinition;
141 class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
144 static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
145 static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int locId);
146 static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
147 std::size_t getHeapMemorySizeWithoutChildren() const;
148 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
149 MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerTypeCommon *father) const;
150 void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
151 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);
152 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
153 void getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const;
154 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
155 const MEDFileFieldPerMeshPerTypeCommon *getFather() const;
156 void loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc);
157 void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc);
158 void setNewStart(int newValueOfStart);
159 int getIteration() const;
160 int getOrder() const;
161 double getTime() const;
162 std::string getMeshName() const;
163 TypeOfField getType() const;
164 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
165 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
166 void setType(TypeOfField newType);
167 INTERP_KERNEL::NormalizedCellType getGeoType() const;
168 int getNumberOfComponents() const;
169 int getNumberOfTuples() const;
170 int getStart() const { return _start; }
171 int getEnd() const { return _end; }
172 void setEnd(int endd) { _end=endd; }
173 int getNumberOfVals() const { return _nval; }
174 DataArray *getOrCreateAndGetArray();
175 const DataArray *getOrCreateAndGetArray() const;
176 const std::vector<std::string>& getInfo() const;
177 std::string getProfile() const;
178 void setProfile(const std::string& newPflName);
179 std::string getLocalization() const;
180 void setLocalization(const std::string& newLocName);
181 int getLocId() const { return _loc_id; }
182 void setLocId(int newId) const { _loc_id=newId; }
183 void setFather(MEDFileFieldPerMeshPerTypeCommon *newFather) { _father=newFather; }
184 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
185 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
186 void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
187 std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
188 void fillValues(int discId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
189 int fillEltIdsFromCode(int offset, const std::vector<int>& codeOfMesh, const MEDFileFieldGlobsReal& glob, int *ptToFill) const;
190 int fillTupleIds(int *ptToFill) const;
191 static int ConvertType(TypeOfField type, int locId);
192 static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
193 static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
194 const DataArrayInt *explicitIdsInMesh, const std::vector<int>& newCode,
195 MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >& result);
196 static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
197 bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
198 MEDFileFieldGlobsReal& glob, bool ¬InExisting);
199 static MCAuto<MEDFileFieldPerMeshPerTypePerDisc> Aggregate(int &start, const std::vector<std::pair<int,const MEDFileFieldPerMeshPerTypePerDisc *> >& pms, const std::vector< std::vector< std::pair<int,int> > >& dts, TypeOfField tof, MEDFileFieldPerMeshPerType *father, std::vector<std::pair< int, std::pair<int,int> > >& extractInfo);
200 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type):_type(type),_father(fath),_start(-1),_end(-1),_nval(-1),_loc_id(-5),_profile_it(-1) { }
202 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
203 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const std::string& dummy);
204 MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other);
205 MEDFileFieldPerMeshPerTypePerDisc();
207 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);
210 MEDFileFieldPerMeshPerTypeCommon *_father;
213 //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi)
215 std::string _profile;
216 std::string _localization;
217 //! only on assignement -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
219 mutable int _profile_it;
220 MCAuto<PartDefinition> _pd;
222 mutable int _tmp_work1;
225 class MEDFileFieldPerMeshPerTypeCommon : public RefCountObject, public MEDFileWritable
228 std::size_t getHeapMemorySizeWithoutChildren() const;
229 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
230 void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
231 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);
232 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
233 void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
234 const MEDFileFieldPerMesh *getFather() const;
235 void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
236 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
237 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
238 bool isUniqueLevel(int& dim) const;
239 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
240 void fillFieldSplitedByType(std::vector< std::pair<int,int> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const;
241 int getIteration() const;
242 int getOrder() const;
243 double getTime() const;
244 std::string getMeshName() const;
245 void getSizes(int& globalSz, int& nbOfEntries) const;
246 int getNumberOfComponents() const;
247 bool presenceOfMultiDiscPerGeoType() const;
248 void pushDiscretization(MEDFileFieldPerMeshPerTypePerDisc *disc);
249 DataArray *getOrCreateAndGetArray();
250 const DataArray *getOrCreateAndGetArray() const;
251 const std::vector<std::string>& getInfo() const;
252 std::vector<std::string> getPflsReallyUsed() const;
253 std::vector<std::string> getLocsReallyUsed() const;
254 std::vector<std::string> getPflsReallyUsedMulti() const;
255 std::vector<std::string> getLocsReallyUsedMulti() const;
256 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
257 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
258 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId);
259 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const;
260 int getNumberOfLoc() const { return _field_pm_pt_pd.size(); }
261 void fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
262 void setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
263 bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
264 bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
265 static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
266 MEDFileFieldPerMeshPerTypeCommon(MEDFileFieldPerMesh *father):_father(father) { }
267 void setFather(MEDFileFieldPerMesh *father);
269 virtual ~MEDFileFieldPerMeshPerTypeCommon();
270 virtual void getDimension(int& dim) const = 0;
271 virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
272 virtual void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const = 0;
273 virtual void simpleRepr(int bkOffset, std::ostream& oss, int id) const = 0;
274 virtual std::string getGeoTypeRepr() const = 0;
275 virtual MEDFileFieldPerMeshPerTypeCommon *deepCopy(MEDFileFieldPerMesh *father) const = 0;
276 virtual 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 = 0;
278 void deepCopyElements();
279 std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
280 std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
281 std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells);
282 std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells);
284 MEDFileFieldPerMesh *_father;
286 std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
289 class MEDFileFieldPerMeshPerType : public MEDFileFieldPerMeshPerTypeCommon
292 static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
293 static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
294 static MCAuto<MEDFileFieldPerMeshPerType> Aggregate(int &start, const std::vector< std::pair<int,const MEDFileFieldPerMeshPerType *> >& pms, const std::vector< std::vector< std::pair<int,int> > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector<std::pair< int, std::pair<int,int> > >& extractInfo);
295 public:// overload of abstract methods
296 void getDimension(int& dim) const;
297 INTERP_KERNEL::NormalizedCellType getGeoType() const;
298 void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
299 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
300 std::string getGeoTypeRepr() const;
301 MEDFileFieldPerMeshPerType *deepCopy(MEDFileFieldPerMesh *father) const;
302 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;
304 MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
305 MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *father, INTERP_KERNEL::NormalizedCellType gt);
307 INTERP_KERNEL::NormalizedCellType _geo_type;
310 class MEDFileFieldPerMeshPerTypeDyn : public MEDFileFieldPerMeshPerTypeCommon
313 static MEDFileFieldPerMeshPerTypeDyn *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileEntities *entities, int idGT, const MEDFileFieldNameScope& nasc);
314 int getDynGT() const;
315 std::string getModelName() const;
317 void getDimension(int& dim) const;
318 INTERP_KERNEL::NormalizedCellType getGeoType() const;
319 void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
320 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
321 std::string getGeoTypeRepr() const;
322 MEDFileFieldPerMeshPerTypeDyn *deepCopy(MEDFileFieldPerMesh *father) const;
323 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;
325 MEDFileFieldPerMeshPerTypeDyn(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileStructureElement *se, const MEDFileFieldNameScope& nasc);
327 MCConstAuto<MEDFileStructureElement> _se;
332 class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
335 static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
336 static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
337 std::size_t getHeapMemorySizeWithoutChildren() const;
338 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
339 MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
340 void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
341 void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
342 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);
343 void assignFieldNoProfileNoRenum(int& start, const std::vector<int>& code, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
344 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
345 void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
346 void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
347 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
348 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
349 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
350 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;
351 void getDimension(int& dim) const;
352 bool isUniqueLevel(int& dim) const;
353 double getTime() const;
354 int getIteration() const;
355 int getOrder() const;
356 int getMeshIteration() const { return _mesh_iteration; }
357 int getMeshOrder() const { return _mesh_order; }
358 std::string getMeshName() const { return _mesh_name; }
359 int getNumberOfComponents() const;
360 bool presenceOfMultiDiscPerGeoType() const;
361 bool presenceOfStructureElements() const;
362 bool onlyStructureElements() const;
363 void killStructureElements();
364 void keepOnlyStructureElements();
365 void keepOnlyOnSE(const std::string& seName);
366 void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
367 DataArray *getOrCreateAndGetArray();
368 const DataArray *getOrCreateAndGetArray() const;
369 const std::vector<std::string>& getInfo() const;
370 std::vector<std::string> getPflsReallyUsed() const;
371 std::vector<std::string> getLocsReallyUsed() const;
372 std::vector<std::string> getPflsReallyUsedMulti() const;
373 std::vector<std::string> getLocsReallyUsedMulti() const;
374 void convertMedBallIntoClassic();
375 bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
376 bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
377 void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
378 void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
379 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
380 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
381 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
382 DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
383 void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
384 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId);
385 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const;
386 static MCAuto<MEDFileFieldPerMesh> Aggregate(int &start, const std::vector<const MEDFileFieldPerMesh *>& pms, const std::vector< std::vector< std::pair<int,int> > >& dts, MEDFileAnyTypeField1TSWithoutSDA *father, std::vector<std::pair< int, std::pair<int,int> > >& extractInfo);
388 int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
389 MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
390 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
391 MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
392 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
393 const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
394 const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
395 MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
396 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
397 const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
398 DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
399 void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
400 static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type,
401 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,
402 std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
403 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);
404 MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
405 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
406 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_father(fath),_mesh_name(meshName),_mesh_iteration(meshIt),_mesh_order(meshOrd) { }
408 std::string _mesh_name;
411 MEDFileAnyTypeField1TSWithoutSDA *_father;
412 std::vector< MCAuto< MEDFileFieldPerMeshPerTypeCommon > > _field_pm_pt;
415 class MEDFileFieldGlobsReal;
417 class MEDFileFieldGlobs : public RefCountObject
420 static MEDFileFieldGlobs *New(med_idt fid);
421 static MEDFileFieldGlobs *New();
422 std::size_t getHeapMemorySizeWithoutChildren() const;
423 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
424 MEDFileFieldGlobs *deepCopy() const;
425 MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
426 MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
427 void simpleRepr(std::ostream& oss) const;
428 void appendGlobs(const MEDFileFieldGlobs& other, double eps);
429 void checkGlobsPflsPartCoherency(const std::vector<std::string>& pflsUsed) const;
430 void checkGlobsLocsPartCoherency(const std::vector<std::string>& locsUsed) const;
431 void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
432 void loadProfileInFile(med_idt fid, int id);
433 void loadGlobals(med_idt fid, const MEDFileFieldGlobsReal& real);
434 void loadAllGlobals(med_idt fid, const MEDFileEntities *entities);
435 void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
436 std::vector<std::string> getPfls() const;
437 std::vector<std::string> getLocs() const;
438 bool existsPfl(const std::string& pflName) const;
439 bool existsLoc(const std::string& locName) const;
440 std::string createNewNameOfPfl() const;
441 std::string createNewNameOfLoc() const;
442 std::vector< std::vector<int> > whichAreEqualProfiles() const;
443 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
444 void setFileName(const std::string& fileName) { _file_name=fileName; }
445 void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
446 void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
447 int getNbOfGaussPtPerCell(int locId) const;
448 int getLocalizationId(const std::string& loc) const;
449 std::string getFileName() const { return _file_name; }
450 const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
451 const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
452 const DataArrayInt *getProfileFromId(int pflId) const;
453 const DataArrayInt *getProfile(const std::string& pflName) const;
454 MEDFileFieldLoc& getLocalizationFromId(int locId);
455 MEDFileFieldLoc& getLocalization(const std::string& locName);
456 DataArrayInt *getProfile(const std::string& pflName);
457 DataArrayInt *getProfileFromId(int pflId);
458 void killProfileIds(const std::vector<int>& pflIds);
459 void killLocalizationIds(const std::vector<int>& locIds);
461 void appendProfile(DataArrayInt *pfl);
462 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);
464 static std::string CreateNewNameNotIn(const std::string& prefix, const std::vector<std::string>& namesToAvoid);
466 MEDFileFieldGlobs(med_idt fid);
468 ~MEDFileFieldGlobs();
470 std::vector< MCAuto<DataArrayInt> > _pfls;
471 std::vector< MCAuto<MEDFileFieldLoc> > _locs;
472 std::string _file_name;
475 /// @endcond INTERNAL
477 class MEDFileFieldGlobsReal
480 MEDLOADER_EXPORT MEDFileFieldGlobsReal(med_idt fid);
481 MEDLOADER_EXPORT MEDFileFieldGlobsReal();
482 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
483 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
484 MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const;
485 MEDLOADER_EXPORT void resetContent();
486 MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
487 MEDLOADER_EXPORT void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
488 MEDLOADER_EXPORT void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
489 MEDLOADER_EXPORT void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
490 MEDLOADER_EXPORT void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
491 MEDLOADER_EXPORT void checkGlobsCoherency() const;
492 MEDLOADER_EXPORT void checkGlobsPflsPartCoherency() const;
493 MEDLOADER_EXPORT void checkGlobsLocsPartCoherency() const;
494 MEDLOADER_EXPORT virtual std::vector<std::string> getPflsReallyUsed() const = 0;
495 MEDLOADER_EXPORT virtual std::vector<std::string> getLocsReallyUsed() const = 0;
496 MEDLOADER_EXPORT virtual std::vector<std::string> getPflsReallyUsedMulti() const = 0;
497 MEDLOADER_EXPORT virtual std::vector<std::string> getLocsReallyUsedMulti() const = 0;
498 MEDLOADER_EXPORT virtual void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
499 MEDLOADER_EXPORT virtual void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) = 0;
500 MEDLOADER_EXPORT virtual ~MEDFileFieldGlobsReal();
502 MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
503 MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id);
504 MEDLOADER_EXPORT void loadGlobals(med_idt fid);
505 MEDLOADER_EXPORT void loadAllGlobals(med_idt fid, const MEDFileEntities *entities=0);
506 MEDLOADER_EXPORT void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
507 MEDLOADER_EXPORT std::vector<std::string> getPfls() const;
508 MEDLOADER_EXPORT std::vector<std::string> getLocs() const;
509 MEDLOADER_EXPORT bool existsPfl(const std::string& pflName) const;
510 MEDLOADER_EXPORT bool existsLoc(const std::string& locName) const;
511 MEDLOADER_EXPORT std::string createNewNameOfPfl() const;
512 MEDLOADER_EXPORT std::string createNewNameOfLoc() const;
513 MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualProfiles() const;
514 MEDLOADER_EXPORT std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
515 MEDLOADER_EXPORT void setFileName(const std::string& fileName);
516 MEDLOADER_EXPORT void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
517 MEDLOADER_EXPORT void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
518 MEDLOADER_EXPORT void changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
519 MEDLOADER_EXPORT void changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
520 MEDLOADER_EXPORT void changePflName(const std::string& oldName, const std::string& newName);
521 MEDLOADER_EXPORT void changeLocName(const std::string& oldName, const std::string& newName);
522 MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipPflsNames();
523 MEDLOADER_EXPORT std::vector< std::pair<std::vector<std::string>, std::string > > zipLocsNames(double eps);
524 MEDLOADER_EXPORT int getNbOfGaussPtPerCell(int locId) const;
525 MEDLOADER_EXPORT int getLocalizationId(const std::string& loc) const;
526 MEDLOADER_EXPORT std::string getFileName() const;
527 MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
528 MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
529 MEDLOADER_EXPORT MEDFileFieldLoc& getLocalizationFromId(int locId);
530 MEDLOADER_EXPORT MEDFileFieldLoc& getLocalization(const std::string& locName);
531 MEDLOADER_EXPORT const DataArrayInt *getProfile(const std::string& pflName) const;
532 MEDLOADER_EXPORT const DataArrayInt *getProfileFromId(int pflId) const;
533 MEDLOADER_EXPORT DataArrayInt *getProfile(const std::string& pflName);
534 MEDLOADER_EXPORT DataArrayInt *getProfileFromId(int pflId);
535 MEDLOADER_EXPORT void killProfileIds(const std::vector<int>& pflIds);
536 MEDLOADER_EXPORT void killLocalizationIds(const std::vector<int>& locIds);
538 MEDLOADER_EXPORT void appendProfile(DataArrayInt *pfl);
539 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);
541 MEDFileFieldGlobs *contentNotNull();
542 const MEDFileFieldGlobs *contentNotNull() const;
544 MCAuto< MEDFileFieldGlobs > _globals;
547 class MEDFileFieldNameScope
550 MEDLOADER_EXPORT MEDFileFieldNameScope();
551 MEDLOADER_EXPORT MEDFileFieldNameScope(const std::string& fieldName);
552 MEDLOADER_EXPORT std::string getName() const;
553 MEDLOADER_EXPORT void setName(const std::string& fieldName);
554 MEDLOADER_EXPORT std::string getDtUnit() const;
555 MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
556 MEDLOADER_EXPORT void copyNameScope(const MEDFileFieldNameScope& other);
559 std::string _dt_unit;
565 * SDA is for Shared Data Arrays such as profiles.
567 class MEDFileAnyTypeField1TSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
570 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA();
571 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order);
572 MEDLOADER_EXPORT int getIteration() const { return _iteration; }
573 MEDLOADER_EXPORT int getOrder() const { return _order; }
574 MEDLOADER_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
575 MEDLOADER_EXPORT void setTime(int iteration, int order, double val) { _dt=val; _iteration=iteration; _order=order; }
576 MEDLOADER_EXPORT int getDimension() const;
577 MEDLOADER_EXPORT std::string getMeshName() const;
578 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
579 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
580 MEDLOADER_EXPORT int getMeshIteration() const;
581 MEDLOADER_EXPORT int getMeshOrder() const;
582 MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
583 MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
584 MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
585 MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
586 MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
588 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
589 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
590 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
591 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
592 MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
593 MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
595 MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
596 MEDLOADER_EXPORT void convertMedBallIntoClassic();
597 MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
598 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;
600 MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
601 MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
602 MEDLOADER_EXPORT void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other);
604 MEDLOADER_EXPORT int getNumberOfComponents() const;
605 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
606 MEDLOADER_EXPORT std::vector<std::string>& getInfo();
607 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
608 MEDLOADER_EXPORT bool presenceOfStructureElements() const;
609 MEDLOADER_EXPORT bool onlyStructureElements() const;
610 MEDLOADER_EXPORT void killStructureElements();
611 MEDLOADER_EXPORT void keepOnlyStructureElements();
612 MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
613 MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
614 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
615 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
616 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
617 MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
618 MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
619 MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
620 MEDLOADER_EXPORT virtual void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
621 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *deepCopy() const = 0;
622 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const = 0;
623 MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const;
624 MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
625 MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArray() const = 0;
626 MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const = 0;
627 MEDLOADER_EXPORT virtual void setArray(DataArray *arr) = 0;
628 MEDLOADER_EXPORT virtual DataArray *createNewEmptyDataArrayInstance() const = 0;
629 MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
630 MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
632 MEDLOADER_EXPORT MEDCouplingFieldDouble *fieldOnMesh(const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const;
633 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
634 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
635 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
636 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
637 DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
639 MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
640 MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
641 MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
642 MEDLOADER_EXPORT int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its);
643 MEDLOADER_EXPORT int keepOnlyGaussDiscretization(std::size_t idOfDisc, std::vector< std::pair<int,int> >& its);
645 MEDLOADER_EXPORT void allocNotFromFile(int newNbOfTuples);
646 MEDLOADER_EXPORT bool allocIfNecessaryTheArrayToReceiveDataFromFile();
647 MEDLOADER_EXPORT void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities);
648 MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
649 MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
650 MEDLOADER_EXPORT void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities);
651 MEDLOADER_EXPORT void unloadArrays();
652 MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const;
654 int getMeshIdFromMeshName(const std::string& mName) const;
655 int addNewEntryIfNecessary(const MEDCouplingMesh *mesh);
656 void updateData(int newLgth, const std::vector< std::pair<int,int> >& oldStartStops);
658 std::vector< MCAuto< MEDFileFieldPerMesh > > _field_per_mesh;
663 //! only useable on reading
665 // -3 means allocated and build from scratch
666 // -2 means allocated and read from a file
667 // -1 means not allocated and build from scratch
668 // >=0 means not allocated and read from a file
669 mutable int _nb_of_tuples_to_be_allocated;
672 class MEDFileIntField1TSWithoutSDA;
675 class MEDFileField1TSTemplateWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
678 MEDFileField1TSTemplateWithoutSDA(const std::string& fieldName, int csit, int iteration, int order):MEDFileAnyTypeField1TSWithoutSDA(fieldName,csit,iteration,order) { }
679 MEDFileField1TSTemplateWithoutSDA():MEDFileAnyTypeField1TSWithoutSDA() { }
681 MEDLOADER_EXPORT void setArray(DataArray *arr);
682 MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
683 MEDLOADER_EXPORT typename Traits<T>::ArrayType *getOrCreateAndGetArrayTemplate();
684 MEDLOADER_EXPORT typename Traits<T>::ArrayType const *getOrCreateAndGetArrayTemplate() const;
685 MEDLOADER_EXPORT typename Traits<T>::ArrayType *getUndergroundDataArrayTemplate() const;
686 MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
687 MEDLOADER_EXPORT const DataArray *getOrCreateAndGetArray() const;
688 MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
689 MEDLOADER_EXPORT void aggregate(const typename std::vector< typename MLFieldTraits<T>::F1TSWSDAType const * >& f1tss, const std::vector< std::vector< std::pair<int,int> > >& dts);
691 MCAuto< typename Traits<T>::ArrayType > _arr;
695 * SDA is for Shared Data Arrays such as profiles.
697 class MEDFileField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<double>
700 MEDLOADER_EXPORT const char *getTypeStr() const;
701 MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
702 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayDoubleExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
703 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;
704 MEDLOADER_EXPORT static void CheckMeshDimRel(int meshDimRelToMax);
705 MEDLOADER_EXPORT static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh);
706 MEDLOADER_EXPORT static MEDFileField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
708 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA();
709 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
710 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *shallowCpy() const;
711 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *deepCopy() const;
712 MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const;
714 static const char TYPE_STR[];
718 * SDA is for Shared Data Arrays such as profiles.
720 class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<int>
723 MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
724 MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
725 MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *deepCopy() const;
726 MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *shallowCpy() const;
727 MEDLOADER_EXPORT const char *getTypeStr() const;
728 MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
729 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
730 MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
732 MEDFileIntField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
734 MEDLOADER_EXPORT static const char TYPE_STR[];
740 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
743 MEDLOADER_EXPORT MEDFileAnyTypeField1TS();
744 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
745 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
746 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
747 MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent);
748 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c);
749 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, med_idt fid);
750 MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
751 MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
752 MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
753 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
754 // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content
756 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
757 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, bool loadAll=true);
758 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
759 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
760 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
761 MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
762 MEDLOADER_EXPORT int getDimension() const;
763 MEDLOADER_EXPORT int getIteration() const;
764 MEDLOADER_EXPORT int getOrder() const;
765 MEDLOADER_EXPORT double getTime(int& iteration, int& order) const;
766 MEDLOADER_EXPORT void setTime(int iteration, int order, double val);
767 MEDLOADER_EXPORT std::string getName() const;
768 MEDLOADER_EXPORT void setName(const std::string& name);
769 MEDLOADER_EXPORT std::string simpleRepr() const;
770 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
771 MEDLOADER_EXPORT std::string getDtUnit() const;
772 MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
773 MEDLOADER_EXPORT std::string getMeshName() const;
774 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
775 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
776 MEDLOADER_EXPORT int getMeshIteration() const;
777 MEDLOADER_EXPORT int getMeshOrder() const;
778 MEDLOADER_EXPORT int getNumberOfComponents() const;
779 MEDLOADER_EXPORT bool isDealingTS(int iteration, int order) const;
780 MEDLOADER_EXPORT std::pair<int,int> getDtIt() const;
781 MEDLOADER_EXPORT void fillIteration(std::pair<int,int>& p) const;
782 MEDLOADER_EXPORT void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const;
783 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
784 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
785 MEDLOADER_EXPORT std::vector<std::string>& getInfo();
786 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
787 MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
788 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,
789 std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
790 MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
791 MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
792 MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
793 MEDLOADER_EXPORT void convertMedBallIntoClassic();
794 MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
796 MEDLOADER_EXPORT void loadArrays();
797 MEDLOADER_EXPORT void loadArraysIfNecessary();
798 MEDLOADER_EXPORT void unloadArrays();
799 MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
800 MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitComponents() const;
801 MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
802 MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
803 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCopy() const;
804 MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
805 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
807 //! underground method see MEDFileField1TSWithoutSDA::setProfileNameOnLeaf
808 MEDLOADER_EXPORT void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
809 //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
810 MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
811 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
812 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
813 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
814 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
815 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
816 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
817 MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
818 MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
820 MEDLOADER_EXPORT static int LocateField2(med_idt fid, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
821 MEDLOADER_EXPORT static int LocateField(med_idt fid, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
823 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const = 0;
825 MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
826 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
827 MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const;
829 MCAuto<MEDFileAnyTypeField1TSWithoutSDA> _content;
832 class MEDFileIntField1TS;
837 class MEDFileField1TS : public MEDFileAnyTypeField1TS
840 MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
841 MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, bool loadAll=true);
842 MEDLOADER_EXPORT static MEDFileField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileField1TS>(db); }
843 MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
844 MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
845 MEDLOADER_EXPORT static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
846 MEDLOADER_EXPORT static MEDFileField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
847 MEDLOADER_EXPORT static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
848 MEDLOADER_EXPORT static MEDFileField1TS *New();
849 MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
851 MEDLOADER_EXPORT MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
852 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
853 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
854 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
855 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
856 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
857 MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
859 MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
860 MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
861 // direct forwarding to MEDFileField1TSWithoutSDA instance _content
863 MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const;
864 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const;
865 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
867 MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
868 std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
870 MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
871 MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MCAuto<DataArray>& arr);
873 MEDLOADER_EXPORT MEDFileField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
875 med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
876 const MEDFileField1TSWithoutSDA *contentNotNull() const;
877 MEDFileField1TSWithoutSDA *contentNotNull();
879 ~MEDFileField1TS() { }
880 MEDFileField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
881 MEDFileField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
882 MEDFileField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
883 MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent);
887 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
890 MEDLOADER_EXPORT static MEDFileIntField1TS *New();
891 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
892 MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, bool loadAll=true);
893 MEDLOADER_EXPORT static MEDFileIntField1TS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntField1TS>(db); }
894 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
895 MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
896 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
897 MEDLOADER_EXPORT static MEDFileIntField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true);
898 MEDLOADER_EXPORT static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
899 MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
900 MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const;
902 MEDLOADER_EXPORT MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
903 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
904 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
905 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
906 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
907 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
908 MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
910 MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
911 MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
912 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
914 MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr);
915 MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldInt> SetDataArrayDoubleInIntField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
916 MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
918 MEDLOADER_EXPORT MEDFileIntField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
920 med_field_type getMEDFileFieldType() const { return MED_INT32; }
921 const MEDFileIntField1TSWithoutSDA *contentNotNull() const;
922 MEDFileIntField1TSWithoutSDA *contentNotNull();
924 ~MEDFileIntField1TS() { }
925 MEDFileIntField1TS();
926 MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
927 MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
928 MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
929 MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
932 class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
935 MEDFileAnyTypeFieldMultiTSWithoutSDA();
936 MEDFileAnyTypeFieldMultiTSWithoutSDA(const std::string& fieldName);
937 MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
938 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, const MEDFileEntities *entities);
940 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
941 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
942 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCopy() const;
943 MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
944 MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
945 MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
946 MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
947 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const = 0;
948 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const = 0;
949 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const = 0;
950 MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const = 0;
951 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
952 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
953 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
954 MEDLOADER_EXPORT int getTimeStepPos(int iteration, int order) const;
955 MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order) const;
956 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA& getTimeStepEntry(int iteration, int order);
957 MEDLOADER_EXPORT std::string getMeshName() const;
958 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
959 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
960 MEDLOADER_EXPORT int getNumberOfTS() const;
961 MEDLOADER_EXPORT void eraseEmptyTS();
962 MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
963 MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
964 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds(const int *startIds, const int *endIds) const;
965 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *buildFromTimeStepIds2(int bg, int end, int step) const;
966 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
967 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
968 MEDLOADER_EXPORT bool presenceOfStructureElements() const;
969 MEDLOADER_EXPORT bool onlyStructureElements() const;
970 MEDLOADER_EXPORT void killStructureElements();
971 MEDLOADER_EXPORT void keepOnlyStructureElements();
972 MEDLOADER_EXPORT void keepOnlyOnSE(const std::string& seName);
973 MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
974 MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
975 MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
976 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
977 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
978 MEDLOADER_EXPORT void pushBackTimeStep(MCAuto<MEDFileAnyTypeField1TSWithoutSDA>& tse);
979 MEDLOADER_EXPORT void synchronizeNameScope();
980 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
981 MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
982 MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
983 MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob);
984 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;
985 MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
986 MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
987 MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
988 MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
989 MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
990 MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
991 MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
992 MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc);
993 MEDLOADER_EXPORT void unloadArrays();
995 MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const;
996 MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos);
997 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed2() const;
998 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed2() const;
999 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti2() const;
1000 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
1001 MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1002 MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1003 MEDLOADER_EXPORT void setIteration(int i, MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ts);
1005 virtual med_field_type getMEDFileFieldType() const = 0;
1006 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
1007 void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field, const DataArray *arr) const;
1008 void checkThatComponentsMatch(const std::vector<std::string>& compos) const;
1009 void checkThatNbOfCompoOfTSMatchThis() const;
1011 std::vector<std::string> _infos;
1012 std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
1015 class MEDFileIntFieldMultiTSWithoutSDA;
1017 class MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1020 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, const MEDFileEntities *entities);
1021 MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1022 MEDLOADER_EXPORT const char *getTypeStr() const;
1023 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1024 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1025 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;
1026 MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
1028 MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName);
1029 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, const MEDFileEntities *entities);
1030 med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
1031 MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1032 void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1034 MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA();
1037 class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
1040 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, const MEDFileEntities *entities);
1041 MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1042 MEDLOADER_EXPORT const char *getTypeStr() const;
1043 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const;
1044 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const;
1045 MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
1047 MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName);
1048 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, const MEDFileEntities *entities);
1049 med_field_type getMEDFileFieldType() const { return MED_INT32; }
1050 MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const;
1051 void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const;
1053 MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA();
1056 class MEDFileAnyTypeFieldMultiTSIterator;
1057 class MEDFileFastCellSupportComparator;
1061 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileFieldGlobsReal
1064 MEDFileAnyTypeFieldMultiTS();
1065 MEDFileAnyTypeFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1066 MEDFileAnyTypeFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1067 MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1068 static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c);
1069 static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, med_idt fid);
1070 static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1071 static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1073 MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1074 MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, bool loadAll=true);
1075 MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1076 MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1077 MEDLOADER_EXPORT void loadArrays();
1078 MEDLOADER_EXPORT void loadArraysIfNecessary();
1079 MEDLOADER_EXPORT void unloadArrays();
1080 MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1081 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1082 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1083 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1084 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCopy() const;
1085 MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
1086 MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
1087 MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
1088 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const = 0;
1089 MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const = 0;
1091 MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const = 0;
1092 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1093 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1094 MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitIntoCommonTimeSeries(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS);
1095 MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& fsc);
1096 MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
1097 public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
1098 MEDLOADER_EXPORT std::string getName() const;
1099 MEDLOADER_EXPORT void setName(const std::string& name);
1100 MEDLOADER_EXPORT std::string getDtUnit() const;
1101 MEDLOADER_EXPORT void setDtUnit(const std::string& dtUnit);
1102 MEDLOADER_EXPORT std::string getMeshName() const;
1103 MEDLOADER_EXPORT void setMeshName(const std::string& newMeshName);
1104 MEDLOADER_EXPORT std::string simpleRepr() const;
1105 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
1106 MEDLOADER_EXPORT int getNumberOfTS() const;
1107 MEDLOADER_EXPORT void eraseEmptyTS();
1108 MEDLOADER_EXPORT void eraseTimeStepIds(const int *startIds, const int *endIds);
1109 MEDLOADER_EXPORT void eraseTimeStepIds2(int bg, int end, int step);
1110 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPart(const int *startIds, const int *endIds) const;
1111 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *buildSubPartSlice(int bg, int end, int step) const;
1112 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
1113 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
1114 MEDLOADER_EXPORT void pushBackTimeSteps(const std::vector<MEDFileAnyTypeField1TS *>& f1ts);
1115 MEDLOADER_EXPORT void pushBackTimeSteps(MEDFileAnyTypeFieldMultiTS *fmts);
1116 MEDLOADER_EXPORT void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
1117 MEDLOADER_EXPORT void synchronizeNameScope();
1118 MEDLOADER_EXPORT int getPosOfTimeStep(int iteration, int order) const;
1119 MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
1120 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator *iterator();
1121 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1122 MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
1123 MEDLOADER_EXPORT bool presenceOfMultiDiscPerGeoType() const;
1124 MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& info);
1125 MEDLOADER_EXPORT int getNumberOfComponents() const;
1126 MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
1127 MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
1128 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;
1129 MEDLOADER_EXPORT MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
1131 MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const = 0;
1132 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1133 MEDLOADER_EXPORT static MCAuto<MEDFileAnyTypeFieldMultiTS> Aggregate(const std::vector<const MEDFileAnyTypeFieldMultiTS *>& fmtss, const std::vector< std::vector< std::pair<int,int> > >& dts);
1135 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1136 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1137 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1138 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1139 MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1140 MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1142 MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase();
1143 const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const;
1145 static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& cmps);
1147 MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
1150 class MEDFileIntFieldMultiTS;
1155 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1158 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New();
1159 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1160 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, bool loadAll=true);
1161 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFieldMultiTS>(db); }
1162 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1163 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1164 MEDLOADER_EXPORT static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1165 MEDLOADER_EXPORT static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1166 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1167 MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1168 MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
1170 MEDLOADER_EXPORT MEDFileField1TS *getTimeStepAtPos(int pos) const;
1171 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
1172 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
1174 MEDLOADER_EXPORT MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
1175 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1176 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1177 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1178 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1179 MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1180 MEDLOADER_EXPORT DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1182 MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
1183 MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1184 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;
1185 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
1186 MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
1188 MEDLOADER_EXPORT MEDFileFieldMultiTS *buildNewEmpty() const;
1190 const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const;
1191 MEDFileFieldMultiTSWithoutSDA *contentNotNull();
1193 ~MEDFileFieldMultiTS() { }
1194 MEDFileFieldMultiTS();
1195 MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1196 MEDFileFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1197 MEDFileFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1203 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1206 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New();
1207 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
1208 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, bool loadAll=true);
1209 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileIntFieldMultiTS>(db); }
1210 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
1211 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
1212 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1213 MEDLOADER_EXPORT static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1214 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
1215 MEDLOADER_EXPORT void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const;
1216 MEDLOADER_EXPORT MEDFileIntField1TS *getTimeStepAtPos(int pos) const;
1217 MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
1219 MEDLOADER_EXPORT MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
1220 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
1221 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
1222 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
1223 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
1224 MEDLOADER_EXPORT MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
1225 MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
1227 MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
1228 MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
1230 MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
1232 MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const;
1234 const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const;
1235 MEDFileIntFieldMultiTSWithoutSDA *contentNotNull();
1237 ~MEDFileIntFieldMultiTS() { }
1238 MEDFileIntFieldMultiTS();
1239 MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
1240 MEDFileIntFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
1241 MEDFileIntFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
1244 class MEDFileAnyTypeFieldMultiTSIterator
1247 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSIterator(MEDFileAnyTypeFieldMultiTS *fmts);
1248 MEDLOADER_EXPORT ~MEDFileAnyTypeFieldMultiTSIterator();
1249 MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
1251 MCAuto<MEDFileAnyTypeFieldMultiTS> _fmts;
1256 class MEDFileFieldsIterator;
1257 class MEDFileStructureElements;
1262 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1265 MEDLOADER_EXPORT static MEDFileFields *New();
1266 MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
1267 MEDLOADER_EXPORT static MEDFileFields *New(med_idt fid, bool loadAll=true);
1268 MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true);
1269 MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(med_idt fid, const MEDFileStructureElements *se, bool loadAll=true);
1270 MEDLOADER_EXPORT static MEDFileFields *New(DataArrayByte *db) { return BuildFromMemoryChunk<MEDFileFields>(db); }
1271 MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0);
1272 MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
1273 MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
1274 MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
1275 MEDLOADER_EXPORT MEDFileFields *deepCopy() const;
1276 MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
1277 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
1278 MEDLOADER_EXPORT void loadArrays();
1279 MEDLOADER_EXPORT void loadArraysIfNecessary();
1280 MEDLOADER_EXPORT void unloadArrays();
1281 MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
1282 MEDLOADER_EXPORT int getNumberOfFields() const;
1283 MEDLOADER_EXPORT std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const;
1284 MEDLOADER_EXPORT std::vector<std::string> getFieldsNames() const;
1285 MEDLOADER_EXPORT std::vector<std::string> getMeshesNames() const;
1286 MEDLOADER_EXPORT std::string simpleRepr() const;
1287 MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss) const;
1289 MEDLOADER_EXPORT void resize(int newSize);
1290 MEDLOADER_EXPORT void pushField(MEDFileAnyTypeFieldMultiTS *field);
1291 MEDLOADER_EXPORT void pushFields(const std::vector<MEDFileAnyTypeFieldMultiTS *>& fields);
1292 MEDLOADER_EXPORT void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field);
1293 MEDLOADER_EXPORT int getPosFromFieldName(const std::string& fieldName) const;
1294 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
1295 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
1296 MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
1297 MEDLOADER_EXPORT bool removeFieldsWithoutAnyTimeStep();
1298 MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
1299 MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1300 MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
1301 MEDLOADER_EXPORT bool presenceOfStructureElements() const;
1302 MEDLOADER_EXPORT void killStructureElements();
1303 MEDLOADER_EXPORT void keepOnlyStructureElements();
1304 MEDLOADER_EXPORT void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
1305 MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
1306 MEDLOADER_EXPORT void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
1307 MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisOnStructureElements() const;
1308 MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const;
1309 MEDLOADER_EXPORT void aggregate(const MEDFileFields& other);
1310 MEDLOADER_EXPORT MEDFileFieldsIterator *iterator();
1311 MEDLOADER_EXPORT void destroyFieldAtPos(int i);
1312 MEDLOADER_EXPORT void destroyFieldsAtPos(const int *startIds, const int *endIds);
1313 MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
1314 MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
1315 MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
1317 MEDLOADER_EXPORT MEDFileFields *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
1319 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
1320 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
1321 MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
1322 MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti() const;
1323 MEDLOADER_EXPORT void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1324 MEDLOADER_EXPORT void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
1326 ~MEDFileFields() { }
1328 MEDFileFields(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
1330 std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
1333 class MEDFileFieldsIterator
1336 MEDLOADER_EXPORT MEDFileFieldsIterator(MEDFileFields *fs);
1337 MEDLOADER_EXPORT ~MEDFileFieldsIterator();
1338 MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
1340 MCAuto<MEDFileFields> _fs;