1 // Copyright (C) 2007-2023 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 (EDF R&D)
21 #ifndef __MEDFILEFIELDINTERNAL_HXX__
22 #define __MEDFILEFIELDINTERNAL_HXX__
24 #include "MEDLoaderDefines.hxx"
25 #include "MEDFileUtilities.hxx"
26 #include "NormalizedGeometricTypes"
27 #include "InterpKernelAutoPtr.hxx"
40 virtual MEDFileGTKeeper *deepCopy() const = 0;
41 virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
42 virtual std::string getRepr() const = 0;
43 virtual bool isEqual(const MEDFileGTKeeper *other) const = 0;
44 virtual ~MEDFileGTKeeper();
47 class MEDFileGTKeeperSta : public MEDFileGTKeeper
50 MEDFileGTKeeperSta(INTERP_KERNEL::NormalizedCellType gt):_geo_type(gt) { }
51 MEDFileGTKeeper *deepCopy() const;
52 INTERP_KERNEL::NormalizedCellType getGeoType() const;
53 std::string getRepr() const;
54 bool isEqual(const MEDFileGTKeeper *other) const;
56 INTERP_KERNEL::NormalizedCellType _geo_type;
60 class MEDFileStructureElement;
63 class MEDFileGTKeeperDyn : public MEDFileGTKeeper
66 MEDFileGTKeeperDyn(const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileStructureElement *se);
67 MEDFileGTKeeper *deepCopy() const;
68 INTERP_KERNEL::NormalizedCellType getGeoType() const;
69 std::string getRepr() const;
70 bool isEqual(const MEDFileGTKeeper *other) const;
71 const MEDFileUMesh *getMesh() const { return _mesh; }
72 const MEDFileUMesh *getSection() const { return _section; }
73 const MEDFileStructureElement *getSE() const { return _se; }
75 MCConstAuto<MEDFileUMesh> _mesh;
76 MCConstAuto<MEDFileUMesh> _section;
77 MCConstAuto<MEDFileStructureElement> _se;
80 class MEDFileEntities;
82 class MEDFileFieldLoc : public RefCountObject
85 MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const;
86 MEDLOADER_EXPORT std::string getName() const { return _name; }
87 MEDLOADER_EXPORT void setName(const std::string& name);
88 std::string getClassName() const override { return std::string("MEDFileFieldLoc"); }
89 static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
90 static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities);
91 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);
92 std::size_t getHeapMemorySizeWithoutChildren() const;
93 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
94 MEDFileFieldLoc *deepCopy() const;
95 bool isOnStructureElement() const;
96 const MEDFileGTKeeper *getUndergroundGTKeeper() const { return _gt; }
97 MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
98 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
99 MEDLOADER_EXPORT std::string repr() const;
100 MEDLOADER_EXPORT bool isName(const std::string& name) const { return _name==name; }
101 MEDLOADER_EXPORT int getDimension() const { return _dim; }
102 MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
103 MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
104 MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
105 MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
106 MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
107 MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _gt->getGeoType(); }
108 MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
110 MEDFileFieldLoc(const MEDFileFieldLoc& other);
111 MEDFileFieldLoc(med_idt fid, const std::string& locName);
112 MEDFileFieldLoc(med_idt fid, int id, const MEDFileEntities *entities);
113 MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
117 INTERP_KERNEL::AutoCppPtr<MEDFileGTKeeper> _gt;
118 int _nb_node_per_cell;
120 std::vector<double> _ref_coo;
121 std::vector<double> _gs_coo;
122 std::vector<double> _w;
126 class MEDFileFieldPerMeshPerTypeCommon;
127 class MEDFileFieldPerMeshPerType;
128 class MEDCouplingFieldTemplate;
129 class MEDFileFieldNameScope;
130 class MEDFileFieldGlobsReal;
131 class MEDCouplingMesh;
133 class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
136 static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
137 static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType locId);
138 static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
139 std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypePerDisc"); }
140 std::size_t getHeapMemorySizeWithoutChildren() const;
141 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
142 MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerTypeCommon *father) const;
143 void assignFieldNoProfile(mcIdType& start, mcIdType offset, mcIdType nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
144 void assignFieldProfile(bool isPflAlone, mcIdType& start, const DataArrayIdType *multiTypePfl, const DataArrayIdType *idsInPfl, DataArrayIdType *locIds, mcIdType nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
145 void assignNodeFieldNoProfile(mcIdType& start, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
146 void getCoarseData(TypeOfField& type, std::pair<mcIdType,mcIdType>& dad, std::string& pfl, std::string& loc) const;
147 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
148 const MEDFileFieldPerMeshPerTypeCommon *getFather() const;
149 void loadOnlyStructureOfDataRecursively(med_idt fid, mcIdType& start, const MEDFileFieldNameScope& nasc);
150 void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc);
151 void setNewStart(mcIdType newValueOfStart);
152 int getIteration() const;
153 int getOrder() const;
154 double getTime() const;
155 std::string getMeshName() const;
156 TypeOfField getType() const;
157 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
158 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
159 void setType(TypeOfField newType);
160 INTERP_KERNEL::NormalizedCellType getGeoType() const;
161 INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const;
162 std::size_t getNumberOfComponents() const;
163 mcIdType getNumberOfTuples() const;
164 mcIdType getStart() const { return _start; }
165 mcIdType getEnd() const { return _end; }
166 void setEnd(mcIdType endd) { _end=endd; }
167 mcIdType getNumberOfVals() const { return _nval; }
168 void incrementNbOfVals(mcIdType deltaNbVal);
169 DataArray *getOrCreateAndGetArray();
170 const DataArray *getOrCreateAndGetArray() const;
171 const std::vector<std::string>& getInfo() const;
172 std::string getProfile() const;
173 void setProfile(const std::string& newPflName);
174 std::string getLocalization() const;
175 void setLocalization(const std::string& newLocName);
176 mcIdType getLocId() const { return _loc_id; }
177 void setLocId(mcIdType newId) const { _loc_id=newId; }
178 void setFather(MEDFileFieldPerMeshPerTypeCommon *newFather) { _father=newFather; }
179 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
180 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
181 void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<mcIdType,mcIdType> >& dads, std::vector<const DataArrayIdType *>& pfls, std::vector<int>& locs,
182 std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
183 void fillValues(int discId, mcIdType& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
184 mcIdType fillEltIdsFromCode(mcIdType offset, const std::vector<mcIdType>& codeOfMesh, const MEDFileFieldGlobsReal& glob, mcIdType *ptToFill) const;
185 mcIdType fillTupleIds(mcIdType *ptToFill) const;
186 static int ConvertType(TypeOfField type, mcIdType locId);
187 static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
188 static bool RenumberChunks(mcIdType offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
189 const DataArrayIdType *explicitIdsInMesh, const std::vector<mcIdType>& newCode,
190 MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >& result);
191 static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayIdType *idsOfMeshElt,
192 bool isPfl, mcIdType nbi, mcIdType offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
193 MEDFileFieldGlobsReal& glob, bool ¬InExisting);
194 static MCAuto<MEDFileFieldPerMeshPerTypePerDisc> Aggregate(mcIdType &start, const std::vector<std::pair<int,const MEDFileFieldPerMeshPerTypePerDisc *> >& pms, const std::vector< std::vector< std::pair<int,mcIdType> > >& dts, TypeOfField tof, MEDFileFieldPerMeshPerType *father, std::vector<std::pair< int, std::pair<mcIdType,mcIdType> > >& extractInfo);
195 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type):_type(type),_father(fath),_start(-1),_end(-1),_nval(-1),_loc_id(-5),_profile_it(-1) { }
197 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType profileIt, const PartDefinition *pd);
198 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType profileIt, const std::string& dummy);
199 MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other);
200 MEDFileFieldPerMeshPerTypePerDisc();
202 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);
205 MEDFileFieldPerMeshPerTypeCommon *_father;
208 //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi)
210 std::string _profile;
211 std::string _localization;
212 //! only on assignment -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
213 mutable mcIdType _loc_id;
214 mutable mcIdType _profile_it;
215 MCAuto<PartDefinition> _pd;
217 mutable mcIdType _tmp_work1;
220 class MEDFileFieldVisitor;
221 class MEDFileFieldPerMesh;
223 class MEDFileFieldPerMeshPerTypeCommon : public RefCountObject, public MEDFileWritable
226 std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypeCommon"); }
227 std::size_t getHeapMemorySizeWithoutChildren() const;
228 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
229 void assignFieldNoProfile(mcIdType& start, mcIdType offset, mcIdType nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
230 void assignFieldProfile(bool isPflAlone, mcIdType& start, const DataArrayIdType *multiTypePfl, const DataArrayIdType *idsInPfl, DataArrayIdType *locIds, mcIdType nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
231 void assignNodeFieldNoProfile(mcIdType& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
232 void assignNodeFieldProfile(mcIdType& start, const DataArrayIdType *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
233 const MEDFileFieldPerMesh *getFather() const;
234 void loadOnlyStructureOfDataRecursively(med_idt fid, mcIdType &start, const MEDFileFieldNameScope& nasc);
235 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
236 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
237 bool isUniqueLevel(int& dim) const;
238 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
239 void fillFieldSplitedByType(std::vector< std::pair<mcIdType,mcIdType> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const;
240 int getIteration() const;
241 int getOrder() const;
242 double getTime() const;
243 std::string getMeshName() const;
244 void getSizes(mcIdType& globalSz, mcIdType& nbOfEntries) const;
245 std::size_t getNumberOfComponents() const;
246 bool presenceOfMultiDiscPerGeoType() const;
247 void pushDiscretization(MEDFileFieldPerMeshPerTypePerDisc *disc);
248 DataArray *getOrCreateAndGetArray();
249 const DataArray *getOrCreateAndGetArray() const;
250 const std::vector<std::string>& getInfo() const;
251 std::vector<std::string> getPflsReallyUsed() const;
252 std::vector<std::string> getLocsReallyUsed() const;
253 std::vector<std::string> getPflsReallyUsedMulti() const;
254 std::vector<std::string> getLocsReallyUsedMulti() const;
255 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
256 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
257 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(mcIdType locId);
258 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(mcIdType locId) const;
259 int getNumberOfLoc() const { return (int)_field_pm_pt_pd.size(); }
260 int locIdOfLeaf(const MEDFileFieldPerMeshPerTypePerDisc *leaf) const;
261 void fillValues(mcIdType& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
262 void setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
263 bool keepOnlySpatialDiscretization(TypeOfField tof, mcIdType &globalNum, std::vector< std::pair<mcIdType,mcIdType> >& its);
264 bool keepOnlyGaussDiscretization(std::size_t idOfDisc, mcIdType &globalNum, std::vector< std::pair<mcIdType,mcIdType> >& 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);
268 void accept(MEDFileFieldVisitor& visitor) const;
270 virtual ~MEDFileFieldPerMeshPerTypeCommon();
271 virtual void getDimension(int& dim) const = 0;
272 virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
273 virtual INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const = 0;
274 virtual void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const = 0;
275 virtual void simpleRepr(int bkOffset, std::ostream& oss, int id) const = 0;
276 virtual std::string getGeoTypeRepr() const = 0;
277 virtual MEDFileFieldPerMeshPerTypeCommon *deepCopy(MEDFileFieldPerMesh *father) const = 0;
278 virtual void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<mcIdType,mcIdType> >& dads, std::vector<const DataArrayIdType *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const = 0;
280 void deepCopyElements();
281 std::vector<mcIdType> addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, mcIdType offset, mcIdType nbOfCells);
282 std::vector<mcIdType> addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, mcIdType offset, mcIdType nbOfCells);
283 std::vector<mcIdType> addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, const DataArrayIdType *subCells);
284 std::vector<mcIdType> addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, const DataArrayIdType *subCells);
286 MEDFileFieldPerMesh *_father;
288 std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
291 class MEDFileFieldPerMeshPerType : public MEDFileFieldPerMeshPerTypeCommon
294 std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerType"); }
295 static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
296 static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
297 static MCAuto<MEDFileFieldPerMeshPerType> Aggregate(mcIdType &start, const std::vector< std::pair<int,const MEDFileFieldPerMeshPerType *> >& pms, const std::vector< std::vector< std::pair<int,mcIdType> > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector<std::pair< int, std::pair<mcIdType,mcIdType> > >& extractInfo);
298 public:// overload of abstract methods
299 void getDimension(int& dim) const;
300 INTERP_KERNEL::NormalizedCellType getGeoType() const override;
301 INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const override;
302 void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
303 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
304 std::string getGeoTypeRepr() const;
305 MEDFileFieldPerMeshPerType *deepCopy(MEDFileFieldPerMesh *father) const;
306 void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<mcIdType,mcIdType> >& dads, std::vector<const DataArrayIdType *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
308 MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
309 MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *father, INTERP_KERNEL::NormalizedCellType gt);
311 INTERP_KERNEL::NormalizedCellType _geo_type;
314 class MEDFileFieldPerMeshPerTypeDyn : public MEDFileFieldPerMeshPerTypeCommon
317 static MEDFileFieldPerMeshPerTypeDyn *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileEntities *entities, int idGT, const MEDFileFieldNameScope& nasc);
318 std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypeDyn"); }
319 int getDynGT() const;
320 std::string getModelName() const;
322 void getDimension(int& dim) const;
323 INTERP_KERNEL::NormalizedCellType getGeoType() const override;
324 INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const override;
325 void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
326 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
327 std::string getGeoTypeRepr() const;
328 MEDFileFieldPerMeshPerTypeDyn *deepCopy(MEDFileFieldPerMesh *father) const;
329 void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<mcIdType,mcIdType> >& dads, std::vector<const DataArrayIdType *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
331 MEDFileFieldPerMeshPerTypeDyn(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileStructureElement *se, const MEDFileFieldNameScope& nasc);
333 MCConstAuto<MEDFileStructureElement> _se;
337 class MEDFileAnyTypeField1TSWithoutSDA;
338 class MEDFileField1TSWithoutSDA;
340 class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
343 static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
344 static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
345 static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities);
346 std::string getClassName() const override { return std::string("MEDFileFieldPerMesh"); }
347 std::size_t getHeapMemorySizeWithoutChildren() const;
348 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
349 MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
350 void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
351 void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
352 void assignFieldProfile(mcIdType& start, const DataArrayIdType *multiTypePfl, const std::vector<mcIdType>& code, const std::vector<mcIdType>& code2, const std::vector<DataArrayIdType *>& idsInPflPerType, const std::vector<DataArrayIdType *>& idsPerType, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
353 void assignFieldNoProfileNoRenum(mcIdType& start, const std::vector<mcIdType>& code, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
354 void assignNodeFieldNoProfile(mcIdType& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
355 void assignNodeFieldProfile(mcIdType& start, const DataArrayIdType *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
356 void loadOnlyStructureOfDataRecursively(med_idt fid, mcIdType &start, const MEDFileFieldNameScope& nasc);
357 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
358 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
359 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
360 std::vector< std::vector< std::pair<mcIdType,mcIdType> > > 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;
361 void accept(MEDFileFieldVisitor& visitor) const;
362 void getDimension(int& dim) const;
363 bool isUniqueLevel(int& dim) const;
364 double getTime() const;
365 int getIteration() const;
366 int getOrder() const;
367 int getMeshIteration() const { return _mesh_iteration; }
368 int getMeshOrder() const { return _mesh_order; }
369 std::string getMeshName() const;
370 void setMeshName(const std::string& meshName);
371 std::size_t getNumberOfComponents() const;
372 bool presenceOfMultiDiscPerGeoType() const;
373 bool presenceOfStructureElements() const;
374 bool onlyStructureElements() const;
375 void killStructureElements();
376 void keepOnlyStructureElements();
377 void keepOnlyOnSE(const std::string& seName);
378 void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
379 DataArray *getOrCreateAndGetArray();
380 const DataArray *getOrCreateAndGetArray() const;
381 const std::vector<std::string>& getInfo() const;
382 std::vector<std::string> getPflsReallyUsed() const;
383 std::vector<std::string> getLocsReallyUsed() const;
384 std::vector<std::string> getPflsReallyUsedMulti() const;
385 std::vector<std::string> getLocsReallyUsedMulti() const;
386 void convertMedBallIntoClassic();
387 bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
388 bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<mcIdType>& oldCode, const std::vector<mcIdType>& newCode, const DataArrayIdType *renumO2N, MEDFileFieldGlobsReal& glob);
389 void keepOnlySpatialDiscretization(TypeOfField tof, mcIdType &globalNum, std::vector< std::pair<mcIdType,mcIdType> >& its);
390 void keepOnlyGaussDiscretization(std::size_t idOfDisc, mcIdType &globalNum, std::vector< std::pair<mcIdType,mcIdType> >& its);
391 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
392 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
393 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
394 DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayIdType *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
395 void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
396 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, mcIdType locId);
397 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, mcIdType locId) const;
398 static MCAuto<MEDFileFieldPerMesh> Aggregate(mcIdType &start, const std::vector<const MEDFileFieldPerMesh *>& pms, const std::vector< std::vector< std::pair<int,mcIdType> > >& dts, MEDFileAnyTypeField1TSWithoutSDA *father, std::vector<std::pair< int, std::pair<mcIdType,mcIdType> > >& extractInfo);
400 int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
401 MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
402 const std::vector< std::pair<mcIdType,mcIdType> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
403 MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
404 const std::vector< std::pair<mcIdType,mcIdType> >& dads, const std::vector<int>& locs,
405 const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
406 const MEDCouplingMesh *mesh, const DataArrayIdType *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
407 MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
408 const std::vector< std::pair<mcIdType,mcIdType> >& dads, const std::vector<int>& locs,
409 const MEDCouplingMesh *mesh, const DataArrayIdType *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
410 DataArray *finishField4(const std::vector< std::pair<mcIdType,mcIdType> >& dads, const DataArrayIdType *pflIn, mcIdType nbOfElems, DataArrayIdType *&pflOut) const;
411 void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
412 static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type,
413 const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes, const std::vector< std::pair<mcIdType,mcIdType> >& dads, const std::vector<const DataArrayIdType *>& pfls, const std::vector<int>& locs,
414 std::vector<mcIdType>& code, std::vector<DataArrayIdType *>& notNullPfls);
415 static mcIdType ComputeNbOfElems(const MEDFileFieldGlobsReal *glob, TypeOfField type, const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes, const std::vector< std::pair<mcIdType,mcIdType> >& dads, const std::vector<int>& locs);
416 MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
417 MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities);
418 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
419 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_mesh_iteration(meshIt),_mesh_order(meshOrd),_father(fath) { }
423 MEDFileAnyTypeField1TSWithoutSDA *_father;
424 std::vector< MCAuto< MEDFileFieldPerMeshPerTypeCommon > > _field_pm_pt;