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 (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 static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
89 static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities);
90 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);
91 std::size_t getHeapMemorySizeWithoutChildren() const;
92 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
93 MEDFileFieldLoc *deepCopy() const;
94 bool isOnStructureElement() const;
95 const MEDFileGTKeeper *getUndergroundGTKeeper() const { return _gt; }
96 MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
97 MEDLOADER_EXPORT void writeLL(med_idt fid) const;
98 MEDLOADER_EXPORT std::string repr() const;
99 MEDLOADER_EXPORT bool isName(const std::string& name) const { return _name==name; }
100 MEDLOADER_EXPORT int getDimension() const { return _dim; }
101 MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
102 MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
103 MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
104 MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
105 MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
106 MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _gt->getGeoType(); }
107 MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
109 MEDFileFieldLoc(const MEDFileFieldLoc& other);
110 MEDFileFieldLoc(med_idt fid, const std::string& locName);
111 MEDFileFieldLoc(med_idt fid, int id, const MEDFileEntities *entities);
112 MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
116 INTERP_KERNEL::AutoCppPtr<MEDFileGTKeeper> _gt;
117 int _nb_node_per_cell;
119 std::vector<double> _ref_coo;
120 std::vector<double> _gs_coo;
121 std::vector<double> _w;
125 class MEDFileFieldPerMeshPerTypeCommon;
126 class MEDFileFieldPerMeshPerType;
127 class MEDCouplingFieldTemplate;
128 class MEDFileFieldNameScope;
129 class MEDFileFieldGlobsReal;
130 class MEDCouplingMesh;
132 class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
135 static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
136 static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int locId);
137 static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
138 std::size_t getHeapMemorySizeWithoutChildren() const;
139 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
140 MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerTypeCommon *father) const;
141 void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
142 void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
143 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
144 void getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const;
145 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
146 const MEDFileFieldPerMeshPerTypeCommon *getFather() const;
147 void loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc);
148 void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc);
149 void setNewStart(int newValueOfStart);
150 int getIteration() const;
151 int getOrder() const;
152 double getTime() const;
153 std::string getMeshName() const;
154 TypeOfField getType() const;
155 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
156 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
157 void setType(TypeOfField newType);
158 INTERP_KERNEL::NormalizedCellType getGeoType() const;
159 int getNumberOfComponents() const;
160 int getNumberOfTuples() const;
161 int getStart() const { return _start; }
162 int getEnd() const { return _end; }
163 void setEnd(int endd) { _end=endd; }
164 int getNumberOfVals() const { return _nval; }
165 void incrementNbOfVals(int deltaNbVal);
166 DataArray *getOrCreateAndGetArray();
167 const DataArray *getOrCreateAndGetArray() const;
168 const std::vector<std::string>& getInfo() const;
169 std::string getProfile() const;
170 void setProfile(const std::string& newPflName);
171 std::string getLocalization() const;
172 void setLocalization(const std::string& newLocName);
173 int getLocId() const { return _loc_id; }
174 void setLocId(int newId) const { _loc_id=newId; }
175 void setFather(MEDFileFieldPerMeshPerTypeCommon *newFather) { _father=newFather; }
176 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
177 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
178 void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
179 std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
180 void fillValues(int discId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
181 int fillEltIdsFromCode(int offset, const std::vector<int>& codeOfMesh, const MEDFileFieldGlobsReal& glob, int *ptToFill) const;
182 int fillTupleIds(int *ptToFill) const;
183 static int ConvertType(TypeOfField type, int locId);
184 static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
185 static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
186 const DataArrayInt *explicitIdsInMesh, const std::vector<int>& newCode,
187 MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >& result);
188 static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
189 bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
190 MEDFileFieldGlobsReal& glob, bool ¬InExisting);
191 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);
192 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type):_type(type),_father(fath),_start(-1),_end(-1),_nval(-1),_loc_id(-5),_profile_it(-1) { }
194 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd);
195 MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const std::string& dummy);
196 MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other);
197 MEDFileFieldPerMeshPerTypePerDisc();
199 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);
202 MEDFileFieldPerMeshPerTypeCommon *_father;
205 //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi)
207 std::string _profile;
208 std::string _localization;
209 //! only on assignment -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
211 mutable int _profile_it;
212 MCAuto<PartDefinition> _pd;
214 mutable int _tmp_work1;
217 class MEDFileFieldVisitor;
218 class MEDFileFieldPerMesh;
220 class MEDFileFieldPerMeshPerTypeCommon : public RefCountObject, public MEDFileWritable
223 std::size_t getHeapMemorySizeWithoutChildren() const;
224 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
225 void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
226 void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
227 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
228 void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
229 const MEDFileFieldPerMesh *getFather() const;
230 void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
231 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
232 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
233 bool isUniqueLevel(int& dim) const;
234 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
235 void fillFieldSplitedByType(std::vector< std::pair<int,int> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const;
236 int getIteration() const;
237 int getOrder() const;
238 double getTime() const;
239 std::string getMeshName() const;
240 void getSizes(int& globalSz, int& nbOfEntries) const;
241 int getNumberOfComponents() const;
242 bool presenceOfMultiDiscPerGeoType() const;
243 void pushDiscretization(MEDFileFieldPerMeshPerTypePerDisc *disc);
244 DataArray *getOrCreateAndGetArray();
245 const DataArray *getOrCreateAndGetArray() const;
246 const std::vector<std::string>& getInfo() const;
247 std::vector<std::string> getPflsReallyUsed() const;
248 std::vector<std::string> getLocsReallyUsed() const;
249 std::vector<std::string> getPflsReallyUsedMulti() const;
250 std::vector<std::string> getLocsReallyUsedMulti() const;
251 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
252 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
253 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId);
254 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const;
255 int getNumberOfLoc() const { return _field_pm_pt_pd.size(); }
256 int locIdOfLeaf(const MEDFileFieldPerMeshPerTypePerDisc *leaf) const;
257 void fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
258 void setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
259 bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
260 bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
261 static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
262 MEDFileFieldPerMeshPerTypeCommon(MEDFileFieldPerMesh *father):_father(father) { }
263 void setFather(MEDFileFieldPerMesh *father);
264 void accept(MEDFileFieldVisitor& visitor) const;
266 virtual ~MEDFileFieldPerMeshPerTypeCommon();
267 virtual void getDimension(int& dim) const = 0;
268 virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
269 virtual void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const = 0;
270 virtual void simpleRepr(int bkOffset, std::ostream& oss, int id) const = 0;
271 virtual std::string getGeoTypeRepr() const = 0;
272 virtual MEDFileFieldPerMeshPerTypeCommon *deepCopy(MEDFileFieldPerMesh *father) const = 0;
273 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;
275 void deepCopyElements();
276 std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, int offset, int nbOfCells);
277 std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, int offset, int nbOfCells);
278 std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, const DataArrayInt *subCells);
279 std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, const DataArrayInt *subCells);
281 MEDFileFieldPerMesh *_father;
283 std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
286 class MEDFileFieldPerMeshPerType : public MEDFileFieldPerMeshPerTypeCommon
289 static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
290 static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
291 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);
292 public:// overload of abstract methods
293 void getDimension(int& dim) const;
294 INTERP_KERNEL::NormalizedCellType getGeoType() const;
295 void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
296 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
297 std::string getGeoTypeRepr() const;
298 MEDFileFieldPerMeshPerType *deepCopy(MEDFileFieldPerMesh *father) const;
299 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;
301 MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
302 MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *father, INTERP_KERNEL::NormalizedCellType gt);
304 INTERP_KERNEL::NormalizedCellType _geo_type;
307 class MEDFileFieldPerMeshPerTypeDyn : public MEDFileFieldPerMeshPerTypeCommon
310 static MEDFileFieldPerMeshPerTypeDyn *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileEntities *entities, int idGT, const MEDFileFieldNameScope& nasc);
311 int getDynGT() const;
312 std::string getModelName() const;
314 void getDimension(int& dim) const;
315 INTERP_KERNEL::NormalizedCellType getGeoType() const;
316 void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
317 void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
318 std::string getGeoTypeRepr() const;
319 MEDFileFieldPerMeshPerTypeDyn *deepCopy(MEDFileFieldPerMesh *father) const;
320 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;
322 MEDFileFieldPerMeshPerTypeDyn(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileStructureElement *se, const MEDFileFieldNameScope& nasc);
324 MCConstAuto<MEDFileStructureElement> _se;
328 class MEDFileAnyTypeField1TSWithoutSDA;
329 class MEDFileField1TSWithoutSDA;
331 class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
334 static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
335 static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
336 std::size_t getHeapMemorySizeWithoutChildren() const;
337 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
338 MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
339 void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
340 void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
341 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 MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
342 void assignFieldNoProfileNoRenum(int& start, const std::vector<int>& code, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
343 void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
344 void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
345 void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc);
346 void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
347 void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
348 void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
349 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;
350 void accept(MEDFileFieldVisitor& visitor) 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;
359 void setMeshName(const std::string& meshName);
360 int getNumberOfComponents() const;
361 bool presenceOfMultiDiscPerGeoType() const;
362 bool presenceOfStructureElements() const;
363 bool onlyStructureElements() const;
364 void killStructureElements();
365 void keepOnlyStructureElements();
366 void keepOnlyOnSE(const std::string& seName);
367 void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
368 DataArray *getOrCreateAndGetArray();
369 const DataArray *getOrCreateAndGetArray() const;
370 const std::vector<std::string>& getInfo() const;
371 std::vector<std::string> getPflsReallyUsed() const;
372 std::vector<std::string> getLocsReallyUsed() const;
373 std::vector<std::string> getPflsReallyUsedMulti() const;
374 std::vector<std::string> getLocsReallyUsedMulti() const;
375 void convertMedBallIntoClassic();
376 bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
377 bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
378 void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
379 void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
380 void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
381 void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
382 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
383 DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
384 void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
385 MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId);
386 const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const;
387 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);
389 int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
390 MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
391 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;
392 MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
393 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
394 const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
395 const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
396 MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
397 const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
398 const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
399 DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
400 void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
401 static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type,
402 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,
403 std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
404 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);
405 MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities);
406 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
407 MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_father(fath),_mesh_iteration(meshIt),_mesh_order(meshOrd) { }
411 MEDFileAnyTypeField1TSWithoutSDA *_father;
412 std::vector< MCAuto< MEDFileFieldPerMeshPerTypeCommon > > _field_pm_pt;