1 // Copyright (C) 2007-2012 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.
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
20 #ifndef __MEDFILEMESH_HXX__
21 #define __MEDFILEMESH_HXX__
23 #include "MEDLoaderDefines.hxx"
24 #include "MEDFileMeshLL.hxx"
25 #include "MEDFileUtilities.hxx"
31 class MEDLOADER_EXPORT MEDFileMesh : public RefCountObject, public MEDFileWritable
34 static MEDFileMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
35 static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
36 virtual bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
37 virtual void clearNonDiscrAttributes() const;
38 void setName(const char *name) { _name=name; }
39 bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
40 const char *getName() const { return _name.c_str(); }
41 void setUnivName(const char *name) { _univ_name=name; }
42 const char *getUnivName() const { return _univ_name.c_str(); }
43 void setDescription(const char *name) { _desc_name=name; }
44 const char *getDescription() const { return _desc_name.c_str(); }
45 void setOrder(int order) { _order=order; }
46 int getOrder() const { return _order; }
47 void setIteration(int it) { _iteration=it; }
48 int getIteration() const { return _iteration; }
49 void setTimeValue(double time) { _time=time; }
50 void setTime(int dt, int it, double time) { _time=time; _iteration=dt; _order=it; }
51 double getTime(int& dt, int& it) { dt=_iteration; it=_order; return _time; }
52 double getTimeValue() const { return _time; }
53 void setTimeUnit(const char *unit) { _dt_unit=unit; }
54 const char *getTimeUnit() const { return _dt_unit.c_str(); }
55 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception) = 0;
56 virtual std::vector<int> getNonEmptyLevels() const = 0;
57 virtual std::vector<int> getNonEmptyLevelsExt() const = 0;
58 virtual void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
59 virtual void write(med_idt fid) const throw(INTERP_KERNEL::Exception);
60 virtual int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) = 0;
61 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception) = 0;
63 bool areFamsEqual(const MEDFileMesh *other, std::string& what) const;
64 bool areGrpsEqual(const MEDFileMesh *other, std::string& what) const;
65 bool existsGroup(const char *groupName) const;
66 bool existsFamily(int famId) const;
67 bool existsFamily(const char *familyName) const;
68 void setFamilyId(const char *familyName, int id);
69 void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
70 virtual void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
71 virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
72 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
73 void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
74 std::string findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception);
75 void setFamilyInfo(const std::map<std::string,int>& info);
76 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
77 void copyFamGrpMapsFrom(const MEDFileMesh& other);
78 const std::map<std::string,int>& getFamilyInfo() const { return _families; }
79 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const { return _groups; }
80 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
81 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
82 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
83 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
84 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
85 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
86 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
87 std::vector<std::string> getGroupsNames() const;
88 std::vector<std::string> getFamiliesNames() const;
89 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
90 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
91 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
92 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
93 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
94 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
95 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
96 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
97 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
98 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
99 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
100 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
101 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
102 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
103 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
104 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception) = 0;
105 virtual std::string simpleRepr() const;
106 virtual std::string advancedRepr() const = 0;
108 virtual void setGroupsAtLevel(int meshDimRelToMaxExt, const std::vector<const DataArrayInt *>& grps, bool renum=false) throw(INTERP_KERNEL::Exception);
109 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception) = 0;
110 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception) = 0;
111 virtual const DataArrayInt *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) = 0;
112 virtual const DataArrayInt *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) = 0;
113 virtual const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) = 0;
114 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception) = 0;
115 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
116 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
117 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
118 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
119 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
120 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
121 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
123 virtual bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell) throw(INTERP_KERNEL::Exception) = 0;
126 void addFamilyOnAllGroupsHaving(const char *famName, const char *otherFamName) throw(INTERP_KERNEL::Exception);
127 virtual void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception) = 0;
128 void dealWithTinyInfo(const MEDCouplingMesh *m) throw(INTERP_KERNEL::Exception);
129 virtual void synchronizeTinyInfoOnLeaves() const = 0;
130 void getFamilyRepr(std::ostream& oss) const;
131 virtual void appendFamilyEntries(const std::set<int>& famIds, const std::vector< std::vector<int> >& fidsOfGrps, const std::vector<std::string>& grpNames);
132 virtual void changeFamilyIdArr(int oldId, int newId) throw(INTERP_KERNEL::Exception) = 0;
133 static void TranslateFamilyIds(int offset, DataArrayInt *famArr, std::vector< std::vector<int> >& famIdsPerGrp);
134 static std::string CreateNameNotIn(const std::string& nameTry, const std::vector<std::string>& namesToAvoid) throw(INTERP_KERNEL::Exception);
135 static int PutInThirdComponentOfCodeOffset(std::vector<int>& code, int strt) throw(INTERP_KERNEL::Exception);
140 std::string _dt_unit;
142 std::string _univ_name;
143 std::string _desc_name;
145 std::map<std::string, std::vector<std::string> > _groups;
146 std::map<std::string,int> _families;
148 static const char DFT_FAM_NAME[];
151 class MEDLOADER_EXPORT MEDFileUMesh : public MEDFileMesh
153 friend class MEDFileMesh;
155 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
156 static MEDFileUMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
157 static MEDFileUMesh *New();
158 bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
159 void clearNonDiscrAttributes() const;
162 int getMeshDimension() const throw(INTERP_KERNEL::Exception);
163 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
164 std::string simpleRepr() const;
165 std::string advancedRepr() const;
166 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
167 const DataArrayInt *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
168 const DataArrayInt *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
169 const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
170 int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
171 std::vector<int> getNonEmptyLevels() const;
172 std::vector<int> getNonEmptyLevelsExt() const;
173 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
174 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
175 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
176 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
177 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
178 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
179 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
180 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
181 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
182 DataArrayDouble *getCoords() const;
183 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
184 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
185 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
186 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
187 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
188 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
189 MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
190 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
191 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
192 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
193 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
195 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
196 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
197 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
198 void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
199 void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
200 void addNodeGroup(const std::string& name, const std::vector<int>& ids) throw(INTERP_KERNEL::Exception);
201 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
202 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
203 void setMeshAtLevelGen(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception);
204 void setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
205 void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms, bool renum) throw(INTERP_KERNEL::Exception);
206 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
207 void duplicateNodesOnM1Group(const char *grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified) throw(INTERP_KERNEL::Exception);
209 bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell) throw(INTERP_KERNEL::Exception);
211 void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
213 MEDFileUMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
214 void loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
215 const MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
216 MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
217 void checkMeshDimCoherency(int meshDim, int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
218 DataArrayDouble *checkMultiMesh(const std::vector<const MEDCouplingUMesh *>& ms) const throw(INTERP_KERNEL::Exception);
219 void computeRevNum() const;
220 void synchronizeTinyInfoOnLeaves() const;
221 void changeFamilyIdArr(int oldId, int newId) throw(INTERP_KERNEL::Exception);
223 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> > _ms;
224 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
225 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_coords;
226 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_coords;
227 mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_coords;
230 class MEDLOADER_EXPORT MEDFileCMesh : public MEDFileMesh
232 friend class MEDFileMesh;
234 static MEDFileCMesh *New();
235 static MEDFileCMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception);
236 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
237 bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
238 int getMeshDimension() const throw(INTERP_KERNEL::Exception);
239 std::string simpleRepr() const;
240 std::string advancedRepr() const;
241 void clearNonDiscrAttributes() const;
242 const MEDCouplingCMesh *getMesh() const;
243 MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
244 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
245 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
246 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
247 void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
248 void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
249 int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
250 std::vector<int> getNonEmptyLevels() const;
251 std::vector<int> getNonEmptyLevelsExt() const;
252 const DataArrayInt *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
253 const DataArrayInt *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
254 const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
256 bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell) throw(INTERP_KERNEL::Exception);
258 void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
260 void synchronizeTinyInfoOnLeaves() const;
261 MEDFileCMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
262 void loadCMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception);
263 void changeFamilyIdArr(int oldId, int newId) throw(INTERP_KERNEL::Exception);
265 MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> _cmesh;
266 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_nodes;
267 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_nodes;
268 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_cells;
269 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_cells;
270 mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_nodes;
271 mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_cells;
274 class MEDLOADER_EXPORT MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
277 static MEDFileMeshMultiTS *New();
278 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
279 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
280 const char *getName() const throw(INTERP_KERNEL::Exception);
281 void setName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
282 bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
283 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception);
284 void write(med_idt fid) const throw(INTERP_KERNEL::Exception);
285 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
286 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
288 void loadFromFile(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
289 MEDFileMeshMultiTS();
290 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception);
291 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
293 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> > _mesh_one_ts;
296 class MEDFileMeshesIterator;
298 class MEDLOADER_EXPORT MEDFileMeshes : public RefCountObject, public MEDFileWritable
301 static MEDFileMeshes *New();
302 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
303 std::string simpleRepr() const;
304 void simpleReprWithoutHeader(std::ostream& oss) const;
305 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
306 void write(med_idt fid) const throw(INTERP_KERNEL::Exception);
307 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
308 MEDFileMeshesIterator *iterator() throw(INTERP_KERNEL::Exception);
309 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception);
310 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
312 bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
314 void resize(int newSize) throw(INTERP_KERNEL::Exception);
315 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
316 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
317 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
319 void checkCoherency() const throw(INTERP_KERNEL::Exception);
320 void loadFromFile(const char *fileName) throw(INTERP_KERNEL::Exception);
322 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception);
324 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> > _meshes;
327 class MEDCOUPLING_EXPORT MEDFileMeshesIterator
330 MEDFileMeshesIterator(MEDFileMeshes *ms);
331 ~MEDFileMeshesIterator();
332 MEDFileMesh *nextt();
334 MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _ms;