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)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileEntities.hxx"
41 #include "MEDFileMeshReadSelector.hxx"
42 #include "MEDFileFieldOverView.hxx"
43 #include "MEDLoaderTypemaps.i"
44 #include "SauvReader.hxx"
45 #include "SauvWriter.hxx"
47 using namespace MEDCoupling;
50 #if SWIG_VERSION >= 0x010329
51 %template() std::vector<std::string>;
54 %typemap(out) MEDCoupling::MEDFileMesh*
56 $result=convertMEDFileMesh($1,$owner);
59 %typemap(out) MEDCoupling::MEDFileParameter1TS*
61 $result=convertMEDFileParameter1TS($1,$owner);
64 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
66 $result=convertMEDFileFieldMultiTS($1,$owner);
69 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
71 $result=convertMEDFileField1TS($1,$owner);
74 %typemap(out) MEDCoupling::MEDMeshMultiLev*
76 $result=convertMEDMeshMultiLev($1,$owner);
79 %newobject ReadUMeshFromFamiliesSwig;
80 %newobject ReadUMeshFromGroupsSwig;
81 %newobject ReadFieldSwig;
82 %newobject MEDCoupling::ReadUMeshFromFile;
83 %newobject MEDCoupling::ReadMeshFromFile;
84 %newobject MEDCoupling::ReadFieldCell;
85 %newobject MEDCoupling::ReadFieldNode;
86 %newobject MEDCoupling::ReadFieldGauss;
87 %newobject MEDCoupling::ReadFieldGaussNE;
88 %newobject MEDCoupling::MEDFileMesh::New;
89 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
90 %newobject MEDCoupling::MEDFileMesh::deepCopy;
91 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
92 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
93 %newobject MEDCoupling::MEDFileMesh::__getitem__;
94 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
95 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
102 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
103 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
104 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
105 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
106 %newobject MEDCoupling::MEDFileMesh::cartesianize;
107 %newobject MEDCoupling::MEDFileData::getJoints;
108 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
109 %newobject MEDCoupling::MEDFileUMesh::New;
110 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
111 %newobject MEDCoupling::MEDFileUMesh::getCoords;
112 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
113 %newobject MEDCoupling::MEDFileUMesh::getGroup;
114 %newobject MEDCoupling::MEDFileUMesh::getGroups;
115 %newobject MEDCoupling::MEDFileUMesh::getFamily;
116 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
117 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
122 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
124 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
125 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
126 %newobject MEDCoupling::MEDFileUMesh::extractPart;
127 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
128 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
129 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
130 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
131 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
132 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
133 %newobject MEDCoupling::MEDFileCMesh::New;
134 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
137 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
138 %newobject MEDCoupling::MEDFileMeshes::New;
139 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
141 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
142 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
143 %newobject MEDCoupling::MEDFileMeshes::__iter__;
145 %newobject MEDCoupling::MEDFileMeshSupports::New;
146 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
148 %newobject MEDCoupling::MEDFileStructureElements::New;
150 %newobject MEDCoupling::MEDFileFields::New;
151 %newobject MEDCoupling::MEDFileFields::NewAdv;
152 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
153 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
154 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
155 %newobject MEDCoupling::MEDFileFields::deepCopy;
156 %newobject MEDCoupling::MEDFileFields::shallowCpy;
157 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
158 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
160 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
162 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
163 %newobject MEDCoupling::MEDFileFields::__iter__;
164 %newobject MEDCoupling::MEDFileFields::extractPart;
166 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
193 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
194 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
196 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
197 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
198 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
199 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
200 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
201 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
202 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
203 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
204 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
206 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
207 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
208 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
209 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
210 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
211 %newobject MEDCoupling::MEDFileField1TS::New;
212 %newobject MEDCoupling::MEDFileField1TS::field;
213 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
214 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
215 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
216 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
217 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
218 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
220 %newobject MEDCoupling::MEDFileIntField1TS::New;
221 %newobject MEDCoupling::MEDFileIntField1TS::field;
222 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
223 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
224 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
225 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
226 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
227 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
229 %newobject MEDCoupling::MEDFileFloatField1TS::New;
230 %newobject MEDCoupling::MEDFileFloatField1TS::field;
231 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
232 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
233 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
234 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
235 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
236 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
238 %newobject MEDCoupling::MEDFileData::New;
239 %newobject MEDCoupling::MEDFileData::deepCopy;
240 %newobject MEDCoupling::MEDFileData::getMeshes;
241 %newobject MEDCoupling::MEDFileData::getFields;
242 %newobject MEDCoupling::MEDFileData::getParams;
243 %newobject MEDCoupling::MEDFileData::Aggregate;
245 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
247 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
248 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
249 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
250 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
251 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
252 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
253 %newobject MEDCoupling::MEDFileParameters::New;
254 %newobject MEDCoupling::MEDFileParameters::deepCopy;
255 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
256 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
257 %newobject MEDCoupling::MEDFileParameters::__getitem__;
259 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
260 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
261 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
262 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
263 %newobject MEDCoupling::MEDFileJointOneStep::New;
264 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
265 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
266 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
267 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
268 %newobject MEDCoupling::MEDFileJoint::New;
269 %newobject MEDCoupling::MEDFileJoint::deepCopy;
270 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
271 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
272 %newobject MEDCoupling::MEDFileJoint::__getitem__;
273 %newobject MEDCoupling::MEDFileJoints::New;
274 %newobject MEDCoupling::MEDFileJoints::deepCopy;
275 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
276 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
277 %newobject MEDCoupling::MEDFileJoints::__getitem__;
278 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
279 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
280 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
281 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
282 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
283 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
284 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
285 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
286 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
288 %newobject MEDCoupling::SauvWriter::New;
289 %newobject MEDCoupling::SauvReader::New;
290 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
292 %newobject MEDCoupling::MEDFileMeshStruct::New;
293 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
294 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
295 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
296 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
297 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
299 %feature("unref") MEDFileMesh "$this->decrRef();"
300 %feature("unref") MEDFileUMesh "$this->decrRef();"
301 %feature("unref") MEDFileCMesh "$this->decrRef();"
302 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
303 %feature("unref") MEDFileMeshes "$this->decrRef();"
304 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
305 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
306 %feature("unref") MEDFileField1TS "$this->decrRef();"
307 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
308 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
309 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
310 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
311 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
312 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
313 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
314 %feature("unref") MEDFileStructureElements "$this->decrRef();"
315 %feature("unref") MEDFileFields "$this->decrRef();"
316 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
317 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
318 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
319 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
320 %feature("unref") MEDFileParameters "$this->decrRef();"
321 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
322 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
323 %feature("unref") MEDFileJoint "$this->decrRef();"
324 %feature("unref") MEDFileJoints "$this->decrRef();"
325 %feature("unref") MEDFileEquivalences "$this->decrRef();"
326 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
327 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
328 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
329 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
330 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
331 %feature("unref") MEDFileData "$this->decrRef();"
332 %feature("unref") SauvReader "$this->decrRef();"
333 %feature("unref") SauvWriter "$this->decrRef();"
334 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
335 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
336 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
337 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
338 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
339 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
341 namespace MEDCoupling
344 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
345 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
346 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
347 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
348 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
349 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
350 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
351 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
352 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
353 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
354 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
355 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
356 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
357 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
358 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
359 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
360 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
361 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
362 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
363 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
364 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
365 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
366 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
367 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
368 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
369 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
370 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
371 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
372 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
373 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
374 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
375 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
376 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
377 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f) throw(INTERP_KERNEL::Exception);
380 %rename (MEDFileVersion) MEDFileVersionSwig;
381 %rename (GetFieldIterations) GetFieldIterationsSwig;
382 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
383 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
384 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
385 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
386 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
387 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
388 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
389 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
390 %rename (WriteUMeshes) WriteUMeshesSwig;
391 %rename (GetTypesOfField) GetTypesOfFieldSwig;
392 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
393 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
394 %rename (ReadField) ReadFieldSwig;
398 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
400 int major,minor,release;
401 MEDCoupling::MEDFileVersion(major,minor,release);
402 PyObject *ret(PyTuple_New(3));
403 PyTuple_SetItem(ret,0,SWIG_From_int(major));
404 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
405 PyTuple_SetItem(ret,2,SWIG_From_int(release));
409 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
411 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
415 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
417 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
421 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
423 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
427 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
429 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
433 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
435 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
436 PyObject *ret=PyList_New(res.size());
438 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
440 PyObject *elt=PyTuple_New(2);
441 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
442 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
443 PyList_SetItem(ret,rk,elt);
448 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
450 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
451 PyObject *ret=PyList_New(res.size());
453 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
455 PyObject *elt=PyTuple_New(3);
456 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
457 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
458 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
459 PyList_SetItem(ret,rk,elt);
464 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
466 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
467 PyObject *ret=PyList_New(res.size());
469 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
471 PyObject *elt=PyTuple_New(2);
472 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
473 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
474 PyList_SetItem(ret,rk,elt);
479 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
481 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
482 PyObject *ret=PyList_New(res.size());
484 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
486 PyObject *elt=PyTuple_New(2);
487 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
488 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
489 PyList_SetItem(ret,rk,elt);
494 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
496 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
497 PyObject *ret=PyList_New(res.size());
499 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
501 PyObject *elt=PyTuple_New(2);
502 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
503 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
504 PyList_SetItem(ret,rk,elt);
509 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
511 int meshDim,spaceDim,numberOfNodes;
512 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
513 PyObject *ret=PyTuple_New(4);
514 PyObject *elt0=PyList_New(res.size());
516 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
518 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
520 PyObject *elt1=PyList_New(obj2.size());
521 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
523 PyObject *elt2=PyTuple_New(2);
524 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
525 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
526 PyList_SetItem(elt1,j,elt2);
528 PyList_SetItem(elt0,i,elt1);
530 PyTuple_SetItem(ret,0,elt0);
531 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
532 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
533 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
537 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
538 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
540 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
541 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
542 return convertFieldDoubleVecToPy(res);
545 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
547 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
548 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
549 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
552 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
554 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
555 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
556 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
559 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
561 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
562 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
563 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
566 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
568 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
570 PyObject *ret=PyList_New(size);
571 for(int i=0;i<size;i++)
572 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
576 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
578 std::vector<std::string> grps;
579 converPyListToVecString(li,grps);
580 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
583 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
585 std::vector<std::string> fams;
586 converPyListToVecString(li,fams);
587 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
591 namespace MEDCoupling
593 class MEDFileWritable
596 void copyOptionsFrom(const MEDFileWritable& other) const;
597 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
598 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
599 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
600 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
603 class MEDFileWritableStandAlone : public MEDFileWritable
606 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
607 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
610 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
612 MCAuto<DataArrayByte> ret(self->serialize());
616 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
618 PyObject *ret(PyList_New(0));
622 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
628 class MEDFileMeshReadSelector
631 MEDFileMeshReadSelector();
632 MEDFileMeshReadSelector(unsigned int code);
633 unsigned int getCode() const;
634 void setCode(unsigned int newCode);
635 bool isCellFamilyFieldReading() const;
636 bool isNodeFamilyFieldReading() const;
637 bool isCellNameFieldReading() const;
638 bool isNodeNameFieldReading() const;
639 bool isCellNumFieldReading() const;
640 bool isNodeNumFieldReading() const;
641 bool isGlobalNodeNumFieldReading() const;
642 void setCellFamilyFieldReading(bool b);
643 void setNodeFamilyFieldReading(bool b);
644 void setCellNameFieldReading(bool b);
645 void setNodeNameFieldReading(bool b);
646 void setCellNumFieldReading(bool b);
647 void setNodeNumFieldReading(bool b);
648 void setGlobalNodeNumFieldReading(bool b);
651 std::string __str__() const throw(INTERP_KERNEL::Exception)
653 std::ostringstream oss;
658 std::string __repr__() const throw(INTERP_KERNEL::Exception)
660 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
666 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
669 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
670 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
671 throw(INTERP_KERNEL::Exception);
672 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
673 INTERP_KERNEL::NormalizedCellType loc_geo_type,
674 INTERP_KERNEL::NormalizedCellType rem_geo_type)
675 throw(INTERP_KERNEL::Exception);
676 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
677 MEDFileJointCorrespondence *deepCopy() const;
678 MEDFileJointCorrespondence *shallowCpy() const;
679 void setIsNodal(bool isNodal);
680 bool getIsNodal() const;
681 bool isEqual(const MEDFileJointCorrespondence *other) const;
682 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
683 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
684 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
685 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
686 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
687 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const throw(INTERP_KERNEL::Exception);
688 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
691 MEDFileJointCorrespondence()
693 return MEDFileJointCorrespondence::New();
695 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
697 return MEDFileJointCorrespondence::New(correspondence);
699 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
700 INTERP_KERNEL::NormalizedCellType loc_geo_type,
701 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
703 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
706 std::string __str__() const throw(INTERP_KERNEL::Exception)
708 return self->simpleRepr();
711 DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception)
713 const DataArrayInt *ret(self->getCorrespondence());
716 return const_cast<DataArrayInt *>(ret);
721 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
724 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
725 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
726 MEDFileJointOneStep *deepCopy() const;
727 MEDFileJointOneStep *shallowCpy() const;
728 bool isEqual(const MEDFileJointOneStep *other) const;
729 void setOrder(int order);
730 int getOrder() const;
731 void setIteration(int it);
732 int getIteration() const;
733 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
734 int getNumberOfCorrespondences() const;
735 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
736 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
739 MEDFileJointOneStep()
741 return MEDFileJointOneStep::New();
744 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
746 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
749 std::string __str__() const throw(INTERP_KERNEL::Exception)
751 return self->simpleRepr();
754 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const throw(INTERP_KERNEL::Exception)
756 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
762 MEDFileJointCorrespondence *__getitem__(int i) const throw(INTERP_KERNEL::Exception)
764 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
769 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
772 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
773 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
774 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
775 MEDFileJoint *deepCopy() const;
776 MEDFileJoint *shallowCpy() const;
777 bool isEqual(const MEDFileJoint *other) const;
778 void setLocalMeshName(const std::string& name);
779 std::string getLocalMeshName() const;
780 void setRemoteMeshName(const std::string& name);
781 std::string getRemoteMeshName() const;
782 void setDescription(const std::string& name);
783 std::string getDescription() const;
784 void setJointName(const std::string& name);
785 std::string getJointName() const;
786 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
787 void setDomainNumber(const int& number);
788 int getDomainNumber() const;
789 void pushStep(MEDFileJointOneStep* step);
790 int getNumberOfSteps() const;
791 std::string simpleRepr() const;
796 return MEDFileJoint::New();
799 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
801 return MEDFileJoint::New(fileName,mName,num);
804 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
806 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
809 std::string __str__() const throw(INTERP_KERNEL::Exception)
811 return self->simpleRepr();
814 MEDFileJointOneStep *getStepAtPos(int i) const throw(INTERP_KERNEL::Exception)
816 MEDFileJointOneStep *ret(self->getStepAtPos(i));
822 MEDFileJointOneStep *__getitem__(int i) throw(INTERP_KERNEL::Exception)
824 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
829 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
832 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
833 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
834 MEDFileJoints *deepCopy() const;
835 std::string simpleRepr() const;
836 std::string getMeshName() const;
837 int getNumberOfJoints() const;
838 std::vector<std::string> getJointsNames() const;
839 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
840 void resize(int newSize) throw(INTERP_KERNEL::Exception);
841 void pushJoint(MEDFileJoint *joint);
842 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
843 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
848 return MEDFileJoints::New();
851 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
853 return MEDFileJoints::New(fileName,meshName);
856 std::string __str__() const throw(INTERP_KERNEL::Exception)
858 return self->simpleRepr();
861 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
863 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
866 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
871 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
877 int __len__() const throw(INTERP_KERNEL::Exception)
879 return self->getNumberOfJoints();
882 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
884 MEDFileJoint *ret=self->getJointAtPos(i);
890 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
892 MEDFileJoint *ret=self->getJointWithName(paramName);
900 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
903 MEDFileEquivalenceBase();
906 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
909 MEDFileEquivalenceData();
911 void setArray(DataArrayInt *data);
914 DataArrayInt *getArray()
916 DataArrayInt *ret(self->getArray());
917 if(ret) ret->incrRef();
923 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
926 MEDFileEquivalenceNode();
929 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
932 MEDFileEquivalenceCell();
935 std::size_t size() const;
936 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
937 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
940 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
942 DataArrayInt *ret(self->getArray(type));
943 if(ret) ret->incrRef();
947 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
949 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
950 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
951 PyObject *res=PyList_New(result.size());
952 for(int i=0;iL!=result.end(); i++, iL++)
953 PyList_SetItem(res,i,PyInt_FromLong(*iL));
959 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
962 MEDFileEquivalencePair();
964 std::string getName() const;
965 void setName(const std::string& name);
966 std::string getDescription() const;
967 void setDescription(const std::string& descr);
968 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
971 MEDFileEquivalenceCell *initCell()
973 MEDFileEquivalenceCell *ret(self->initCell());
974 if(ret) ret->incrRef();
978 MEDFileEquivalenceNode *initNode()
980 MEDFileEquivalenceNode *ret(self->initNode());
981 if(ret) ret->incrRef();
985 MEDFileEquivalenceCell *getCell()
987 MEDFileEquivalenceCell *ret(self->getCell());
988 if(ret) ret->incrRef();
992 MEDFileEquivalenceNode *getNode()
994 MEDFileEquivalenceNode *ret(self->getNode());
995 if(ret) ret->incrRef();
1001 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1004 MEDFileEquivalences();
1007 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
1008 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
1009 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
1013 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
1015 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1016 if(ret) ret->incrRef();
1019 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1021 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1022 if(ret) ret->incrRef();
1026 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1028 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1029 if(ret) ret->incrRef();
1035 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1038 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1039 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1040 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1041 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1042 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1043 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1044 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1045 void setName(const std::string& name);
1046 std::string getName();
1047 std::string getUnivName() const;
1048 bool getUnivNameWrStatus() const;
1049 void setUnivNameWrStatus(bool newStatus);
1050 void setDescription(const std::string& name);
1051 std::string getDescription() const;
1052 void setOrder(int order);
1053 int getOrder() const;
1054 void setIteration(int it);
1056 void setTimeValue(double time);
1057 void setTime(int dt, int it, double time);
1058 double getTimeValue() const;
1059 void setTimeUnit(const std::string& unit);
1060 std::string getTimeUnit() const;
1061 void setAxisType(MEDCouplingAxisType at);
1062 MEDCouplingAxisType getAxisType() const;
1063 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1064 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1065 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1066 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1067 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1068 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1069 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1070 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1071 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1072 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1073 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1074 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1075 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1076 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1078 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1079 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1080 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1081 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1082 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1083 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1084 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1085 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1086 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1087 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1088 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1089 void clearFamMap() throw(INTERP_KERNEL::Exception);
1090 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1091 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1092 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1093 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1094 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1095 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1096 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1097 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1098 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1099 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1100 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1101 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1102 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1103 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1104 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1105 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1106 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1107 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1108 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1109 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1110 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1111 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1112 static std::string GetMagicFamilyStr();
1113 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1114 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1115 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1116 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1117 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1118 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1119 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1120 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1121 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1122 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1123 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1124 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1125 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1126 void setFamilyInfo(const std::map<std::string,int>& info);
1127 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1128 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1129 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1130 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1131 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1132 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1133 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1134 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1135 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1136 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1137 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1138 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1139 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1140 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1141 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1142 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1143 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1144 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1145 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1146 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1147 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1149 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1150 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1151 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1152 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1153 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1154 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1155 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1156 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1157 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1158 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1159 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1160 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1161 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1162 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1163 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1164 int getNumberOfJoints();
1165 MEDFileJoints *getJoints();
1166 void setJoints( MEDFileJoints* joints );
1167 void initializeEquivalences();
1168 void killEquivalences();
1169 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1170 void killStructureElements() throw(INTERP_KERNEL::Exception);
1173 std::string __str__() const throw(INTERP_KERNEL::Exception)
1175 return self->simpleRepr();
1178 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1180 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1183 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1186 double tmp0=self->getTime(tmp1,tmp2);
1187 PyObject *res = PyList_New(3);
1188 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1189 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1190 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1194 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1197 bool ret0=self->isEqual(other,eps,what);
1198 PyObject *res=PyList_New(2);
1199 PyObject *ret0Py=ret0?Py_True:Py_False;
1201 PyList_SetItem(res,0,ret0Py);
1202 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1206 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1208 std::vector<const DataArrayInt *> grps;
1209 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1210 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1213 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1216 bool ret0=self->areFamsEqual(other,what);
1217 PyObject *res=PyList_New(2);
1218 PyObject *ret0Py=ret0?Py_True:Py_False;
1220 PyList_SetItem(res,0,ret0Py);
1221 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1225 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1228 bool ret0=self->areGrpsEqual(other,what);
1229 PyObject *res=PyList_New(2);
1230 PyObject *ret0Py=ret0?Py_True:Py_False;
1232 PyList_SetItem(res,0,ret0Py);
1233 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1237 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1239 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1240 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1241 PyObject *res=PyList_New(result.size());
1242 for(int i=0;iL!=result.end(); i++, iL++)
1243 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1247 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1249 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1250 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1251 PyObject *res=PyList_New(result.size());
1252 for(int i=0;iL!=result.end(); i++, iL++)
1253 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1257 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1259 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1262 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1265 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1267 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1270 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1273 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1275 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1278 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1281 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1283 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1286 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1289 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1291 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1294 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1297 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1300 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1301 PyObject *ret=PyTuple_New(2);
1302 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1303 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1307 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1309 DataArrayInt *ret3=0;
1310 std::vector<int> ret1,ret2;
1311 bool ret0=self->unPolyze(ret1,ret2,ret3);
1312 PyObject *ret=PyTuple_New(4);
1313 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1315 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1316 for(int j=0;j<(int)ret1.size()/3;j++)
1318 PyObject *retLev2=PyList_New(3);
1319 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1320 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1321 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1322 PyList_SetItem(retLev1_0,j,retLev2);
1324 PyTuple_SetItem(ret,1,retLev1_0);
1326 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1327 for(int j=0;j<(int)ret2.size()/3;j++)
1329 PyObject *retLev2=PyList_New(3);
1330 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1331 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1332 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1333 PyList_SetItem(retLev1_1,j,retLev2);
1335 PyTuple_SetItem(ret,2,retLev1_1);
1337 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1341 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1343 MEDFileEquivalences *ret(self->getEquivalences());
1344 if(ret) ret->incrRef();
1348 virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1350 MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1356 class MEDFileUMesh : public MEDFileMesh
1359 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1360 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1361 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1362 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1363 static MEDFileUMesh *New();
1364 static const char *GetSpeStr4ExtMesh();
1366 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1367 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1368 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1369 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1370 void clearNodeAndCellNumbers();
1372 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1373 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1374 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1375 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1376 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1377 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1378 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1379 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1380 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1381 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1383 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1384 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1385 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1386 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1387 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1388 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1389 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1390 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1391 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1392 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1393 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1394 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1395 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1396 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1397 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1400 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1402 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1405 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1407 return MEDFileUMesh::New(fileName,mrs);
1410 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1412 return MEDFileUMesh::New(mem);
1415 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1417 return MEDFileUMesh::New(db);
1422 return MEDFileUMesh::New();
1425 static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1427 std::vector<int> typesCpp1;
1428 convertPyToNewIntArr3(types,typesCpp1);
1429 std::size_t sz(typesCpp1.size());
1430 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1431 for(std::size_t ii=0;ii<sz;ii++)
1432 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1433 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1436 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1438 std::vector<double> a0;
1439 std::vector<int> a1;
1440 std::vector<std::string> a2;
1441 std::vector< MCAuto<DataArrayInt> > a3;
1442 MCAuto<DataArrayDouble> a4;
1443 self->serialize(a0,a1,a2,a3,a4);
1444 PyObject *ret(PyTuple_New(5));
1445 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1446 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1448 PyObject *ret2(PyList_New(sz));
1449 for(int i=0;i<sz;i++)
1450 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1451 PyTuple_SetItem(ret,2,ret2);
1453 PyObject *ret3(PyList_New(sz));
1454 for(int i=0;i<sz;i++)
1456 DataArrayInt *elt(a3[i]);
1459 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1461 PyTuple_SetItem(ret,3,ret3);
1462 DataArrayDouble *ret4(a4);
1465 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1469 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1471 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1472 if(!PyTuple_Check(inp))
1473 throw INTERP_KERNEL::Exception(MSG);
1474 int sz(PyTuple_Size(inp));
1476 throw INTERP_KERNEL::Exception(MSG);
1477 std::vector<double> a0;
1478 std::vector<int> a1;
1479 std::vector<std::string> a2;
1480 std::vector< MCAuto<DataArrayInt> > a3;
1481 MCAuto<DataArrayDouble> a4;
1483 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1485 fillArrayWithPyListDbl3(a0py,tmp,a0);
1486 convertPyToNewIntArr3(a1py,a1);
1487 fillStringVector(a2py,a2);
1489 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1491 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1492 if(!SWIG_IsOK(status))
1493 throw INTERP_KERNEL::Exception(MSG);
1494 a4=reinterpret_cast<DataArrayDouble *>(argp);
1495 if((DataArrayDouble *)a4)
1498 std::vector< DataArrayInt * > a3Tmp;
1499 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1500 std::size_t sz(a3Tmp.size());
1502 for(std::size_t i=0;i<sz;i++)
1506 a3Tmp[i]->incrRef();
1508 self->unserialize(a0,a1,a2,a3,a4);
1512 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1515 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1516 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1519 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1522 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1525 self->setMeshAtLevel(meshDimRelToMax,m1);
1528 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1531 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1533 self->removeMeshAtLevel(meshDimRelToMax);
1536 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1538 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1540 DataArrayDouble *a,*a2;
1541 DataArrayDoubleTuple *aa,*aa2;
1542 std::vector<double> bb,bb2;
1544 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1545 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1546 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1550 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1552 std::vector<const MEDFileUMesh *> meshesCpp;
1553 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1554 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1558 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1560 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1561 return convertVecPairIntToPy(ret);
1564 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1566 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1567 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1568 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1571 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1573 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1574 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1575 return self->extractPart(extractDefCpp);
1578 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1580 std::vector<const MEDCouplingUMesh *> ms;
1581 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1582 self->setMeshes(ms,renum);
1585 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1587 std::vector<const MEDCouplingUMesh *> ms;
1588 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1589 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1592 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1594 std::vector<const MEDCouplingUMesh *> ms;
1595 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1596 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1599 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1601 DataArrayDouble *ret=self->getCoords();
1607 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1609 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1612 return const_cast<PartDefinition *>(ret);
1615 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1617 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1618 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1619 PyObject *ret=PyTuple_New(3);
1620 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1621 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1622 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1626 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1628 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1634 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1636 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1637 std::size_t sz(tmp.size());
1638 PyObject *ret=PyList_New(sz);
1639 for(std::size_t i=0;i<sz;i++)
1643 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1650 class MEDFileStructuredMesh : public MEDFileMesh
1655 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1657 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1665 class MEDFileCMesh : public MEDFileStructuredMesh
1668 static MEDFileCMesh *New();
1669 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1670 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1671 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1672 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1673 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1678 return MEDFileCMesh::New();
1681 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1683 return MEDFileCMesh::New(fileName,mrs);
1686 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1688 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1691 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1693 return MEDFileCMesh::New(db);
1696 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1698 const MEDCouplingCMesh *tmp=self->getMesh();
1701 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1706 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1709 static MEDFileCurveLinearMesh *New();
1710 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1711 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1712 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1713 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1716 MEDFileCurveLinearMesh()
1718 return MEDFileCurveLinearMesh::New();
1721 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1723 return MEDFileCurveLinearMesh::New(fileName,mrs);
1726 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1728 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1731 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1733 return MEDFileCurveLinearMesh::New(db);
1736 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1738 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1741 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1746 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1749 static MEDFileMeshMultiTS *New();
1750 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1751 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1752 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1753 std::string getName() const throw(INTERP_KERNEL::Exception);
1754 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1755 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1758 MEDFileMeshMultiTS()
1760 return MEDFileMeshMultiTS::New();
1763 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1765 return MEDFileMeshMultiTS::New(fileName);
1768 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1770 return MEDFileMeshMultiTS::New(fileName,mName);
1773 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1775 MEDFileMesh *ret=self->getOneTimeStep();
1783 class MEDFileMeshesIterator
1788 PyObject *next() throw(INTERP_KERNEL::Exception)
1790 MEDFileMesh *ret=self->nextt();
1794 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1798 PyErr_SetString(PyExc_StopIteration,"No more data.");
1805 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1808 static MEDFileMeshes *New();
1809 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1810 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1811 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1812 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1814 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1815 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1816 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1817 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1818 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1819 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1820 void killStructureElements() throw(INTERP_KERNEL::Exception);
1825 return MEDFileMeshes::New();
1828 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1830 return MEDFileMeshes::New(fileName);
1833 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1835 return MEDFileMeshes::New(db);
1838 std::string __str__() const throw(INTERP_KERNEL::Exception)
1840 return self->simpleRepr();
1843 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1845 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1846 if(PyInt_Check(obj))
1848 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1853 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1859 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1861 self->setMeshAtPos(obj,mesh);
1865 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1867 return self->iterator();
1870 int __len__() const throw(INTERP_KERNEL::Exception)
1872 return self->getNumberOfMeshes();
1875 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1877 MEDFileMesh *ret=self->getMeshAtPos(i);
1882 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1884 MEDFileMesh *ret=self->getMeshWithName(mname);
1892 class MEDFileFieldLoc : public RefCountObject
1895 std::string getName() const;
1896 int getDimension() const;
1897 int getNumberOfGaussPoints() const;
1898 int getNumberOfPointsInCells() const;
1899 const std::vector<double>& getRefCoords() const;
1900 const std::vector<double>& getGaussCoords() const;
1901 const std::vector<double>& getGaussWeights() const;
1902 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1905 std::string __str__() const throw(INTERP_KERNEL::Exception)
1907 return self->repr();
1912 class MEDFileFieldGlobsReal
1915 void resetContent();
1916 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1917 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1918 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1919 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1920 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1921 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1922 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1923 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1924 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1925 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1926 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1927 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1928 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1929 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1930 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1931 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1932 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1933 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1934 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1935 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1936 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1937 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1938 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1939 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1940 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1941 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1942 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1945 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1947 const DataArrayInt *ret=self->getProfile(pflName);
1950 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1953 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1955 const DataArrayInt *ret=self->getProfileFromId(pflId);
1958 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1961 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1963 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1966 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1969 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1971 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1974 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1977 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1979 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1980 return convertVecPairVecStToPy(ret);
1983 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1985 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1986 return convertVecPairVecStToPy(ret);
1989 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1991 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1992 self->changePflsNames(v);
1995 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1997 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1998 self->changePflsRefsNamesGen(v);
2001 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2003 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2004 self->changePflsNamesInStruct(v);
2007 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2009 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2010 self->changeLocsNames(v);
2013 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2015 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2016 self->changeLocsRefsNamesGen(v);
2019 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2021 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2022 self->changeLocsNamesInStruct(v);
2025 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2027 std::ostringstream oss;
2028 self->simpleReprGlobs(oss);
2034 class MEDFileEntities
2039 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2041 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2042 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2044 std::size_t sz(inp0.size());
2046 for(std::size_t i=0;i<sz;i++)
2047 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2049 return MEDFileEntities::BuildFrom(&inp);
2056 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2059 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2060 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2061 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2062 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2063 void loadArrays() throw(INTERP_KERNEL::Exception);
2064 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2065 void unloadArrays() throw(INTERP_KERNEL::Exception);
2066 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2067 int getDimension() const throw(INTERP_KERNEL::Exception);
2068 int getIteration() const throw(INTERP_KERNEL::Exception);
2069 int getOrder() const throw(INTERP_KERNEL::Exception);
2070 std::string getName() throw(INTERP_KERNEL::Exception);
2071 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2072 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2073 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2074 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2075 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2076 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2077 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2078 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2079 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2080 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2081 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2082 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2083 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2084 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2085 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2088 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2091 double tmp0=self->getTime(tmp1,tmp2);
2092 PyObject *res = PyList_New(3);
2093 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2094 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2095 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2099 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2101 std::pair<int,int> res=self->getDtIt();
2102 PyObject *elt=PyTuple_New(2);
2103 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2104 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2108 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2110 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2113 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2115 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2118 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2120 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2121 return self->changeMeshNames(modifTab);
2124 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2126 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2127 PyObject *ret2=PyList_New(ret.size());
2128 for(int i=0;i<(int)ret.size();i++)
2129 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2133 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2135 std::vector<int> ret1;
2136 int ret0=self->getNonEmptyLevels(mname,ret1);
2137 PyObject *elt=PyTuple_New(2);
2138 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2139 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2143 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2145 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2146 std::vector< std::vector<TypeOfField> > typesF;
2147 std::vector< std::vector<std::string> > pfls;
2148 std::vector< std::vector<std::string> > locs;
2149 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2151 PyObject *ret2=PyList_New(sz);
2152 for(int i=0;i<sz;i++)
2154 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2155 const std::vector<TypeOfField>& typesFI=typesF[i];
2156 const std::vector<std::string>& pflsI=pfls[i];
2157 const std::vector<std::string>& locsI=locs[i];
2158 PyObject *elt=PyTuple_New(2);
2159 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2160 int sz2=ret[i].size();
2161 PyObject *elt2=PyList_New(sz2);
2162 for(int j=0;j<sz2;j++)
2164 PyObject *elt3=PyTuple_New(4);
2165 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2166 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
2167 PyTuple_SetItem(elt3,1,elt4);
2168 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2169 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2170 PyList_SetItem(elt2,j,elt3);
2172 PyTuple_SetItem(elt,1,elt2);
2173 PyList_SetItem(ret2,i,elt);
2178 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2180 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2181 std::size_t sz=ret.size();
2182 PyObject *retPy=PyList_New(sz);
2183 for(std::size_t i=0;i<sz;i++)
2184 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2188 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2190 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2191 std::size_t sz=ret.size();
2192 PyObject *retPy=PyList_New(sz);
2193 for(std::size_t i=0;i<sz;i++)
2194 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2198 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2200 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2201 std::size_t sz=ret.size();
2202 PyObject *retPy=PyList_New(sz);
2203 for(std::size_t i=0;i<sz;i++)
2204 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2208 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2210 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2211 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2212 return self->extractPart(extractDefCpp,mm);
2217 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2220 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2221 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2222 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2223 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2224 static MEDFileField1TS *New();
2225 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2226 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2227 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2228 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2229 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2230 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2231 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2233 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2234 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2235 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2236 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2239 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2241 return MEDFileField1TS::New(fileName,loadAll);
2244 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2246 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2249 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2251 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2254 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2256 return MEDFileField1TS::New(db);
2261 return MEDFileField1TS::New();
2264 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2266 const DataArrayDouble *arr=0;
2268 arr=field->getArray();
2269 self->copyTinyInfoFrom(field,arr);
2272 std::string __str__() const throw(INTERP_KERNEL::Exception)
2274 return self->simpleRepr();
2277 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2279 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2282 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2284 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2285 std::vector< std::vector<TypeOfField> > typesF;
2286 std::vector< std::vector<std::string> > pfls;
2287 std::vector< std::vector<std::string> > locs;
2288 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2290 PyObject *ret2=PyList_New(sz);
2291 for(int i=0;i<sz;i++)
2293 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2294 const std::vector<TypeOfField>& typesFI=typesF[i];
2295 const std::vector<std::string>& pflsI=pfls[i];
2296 const std::vector<std::string>& locsI=locs[i];
2297 PyObject *elt=PyTuple_New(2);
2298 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2299 int sz2=ret[i].size();
2300 PyObject *elt2=PyList_New(sz2);
2301 for(int j=0;j<sz2;j++)
2303 PyObject *elt3=PyTuple_New(4);
2304 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2305 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2306 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2307 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2308 PyList_SetItem(elt2,j,elt3);
2310 PyTuple_SetItem(elt,1,elt2);
2311 PyList_SetItem(ret2,i,elt);
2316 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2318 DataArrayDouble *ret=self->getUndergroundDataArray();
2324 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2326 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2331 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2334 static MEDFileIntField1TS *New();
2335 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2336 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2337 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2338 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2339 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2341 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2342 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2343 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2344 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2345 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2346 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2347 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2348 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2351 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2353 return MEDFileIntField1TS::New();
2356 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2358 return MEDFileIntField1TS::New(fileName,loadAll);
2361 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2363 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2366 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2368 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2371 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2373 return MEDFileIntField1TS::New(db);
2376 std::string __str__() const throw(INTERP_KERNEL::Exception)
2378 return self->simpleRepr();
2381 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2383 return MEDFileField1TS_getFieldWithProfile<int>(self,type,meshDimRelToMax,mesh);
2386 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2388 DataArrayInt *ret=self->getUndergroundDataArray();
2394 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2396 return MEDFileField1TS_getUndergroundDataArrayExt<int>(self);
2401 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2404 static MEDFileFloatField1TS *New();
2405 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2406 static MEDFileFloatField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2407 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2408 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2409 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2411 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
2412 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2413 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2414 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2415 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2416 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2417 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2418 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2421 MEDFileFloatField1TS() throw(INTERP_KERNEL::Exception)
2423 return MEDFileFloatField1TS::New();
2426 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2428 return MEDFileFloatField1TS::New(fileName,loadAll);
2431 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2433 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2436 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2438 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2441 MEDFileFloatField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2443 return MEDFileFloatField1TS::New(db);
2446 std::string __str__() const throw(INTERP_KERNEL::Exception)
2448 return self->simpleRepr();
2451 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2453 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2456 DataArrayFloat *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2458 DataArrayFloat *ret=self->getUndergroundDataArray();
2464 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2466 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2471 class MEDFileAnyTypeFieldMultiTSIterator
2476 PyObject *next() throw(INTERP_KERNEL::Exception)
2478 MEDFileAnyTypeField1TS *ret=self->nextt();
2480 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2483 PyErr_SetString(PyExc_StopIteration,"No more data.");
2490 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2493 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2494 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2495 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2496 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2497 std::string getName() const throw(INTERP_KERNEL::Exception);
2498 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2499 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2500 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2501 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2502 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2503 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2504 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2505 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2506 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2507 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2508 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2509 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2510 void loadArrays() throw(INTERP_KERNEL::Exception);
2511 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2512 void unloadArrays() throw(INTERP_KERNEL::Exception);
2513 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2515 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2516 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2517 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2518 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2519 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2520 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2523 int __len__() const throw(INTERP_KERNEL::Exception)
2525 return self->getNumberOfTS();
2528 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2530 if(elt0 && PyInt_Check(elt0))
2532 int pos=PyInt_AS_LONG(elt0);
2535 else if(elt0 && PyTuple_Check(elt0))
2537 if(PyTuple_Size(elt0)==2)
2539 PyObject *o0=PyTuple_GetItem(elt0,0);
2540 PyObject *o1=PyTuple_GetItem(elt0,1);
2541 if(PyInt_Check(o0) && PyInt_Check(o1))
2543 int iter=PyInt_AS_LONG(o0);
2544 int order=PyInt_AS_LONG(o1);
2545 return self->getPosOfTimeStep(iter,order);
2548 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
2551 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
2553 else if(elt0 && PyFloat_Check(elt0))
2555 double val=PyFloat_AS_DOUBLE(elt0);
2556 return self->getPosGivenTime(val);
2559 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2562 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2564 std::vector< std::pair<int,int> > res(self->getIterations());
2565 return convertVecPairIntToPy(res);
2568 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2570 std::vector<double> ret1;
2571 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2572 std::size_t sz=ret.size();
2573 PyObject *ret2=PyList_New(sz);
2574 for(std::size_t i=0;i<sz;i++)
2576 PyObject *elt=PyTuple_New(3);
2577 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2578 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2579 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2580 PyList_SetItem(ret2,i,elt);
2585 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2587 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2588 PyObject *ret2=PyList_New(ret.size());
2589 for(int i=0;i<(int)ret.size();i++)
2591 const std::vector<TypeOfField>& rett=ret[i];
2592 PyObject *ret3=PyList_New(rett.size());
2593 for(int j=0;j<(int)rett.size();j++)
2594 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2595 PyList_SetItem(ret2,i,ret3);
2600 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2602 std::vector<int> ret1;
2603 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2604 PyObject *elt=PyTuple_New(2);
2605 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2606 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2610 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2612 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2613 std::vector< std::vector<TypeOfField> > typesF;
2614 std::vector< std::vector<std::string> > pfls;
2615 std::vector< std::vector<std::string> > locs;
2616 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2618 PyObject *ret2=PyList_New(sz);
2619 for(int i=0;i<sz;i++)
2621 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2622 const std::vector<TypeOfField>& typesFI=typesF[i];
2623 const std::vector<std::string>& pflsI=pfls[i];
2624 const std::vector<std::string>& locsI=locs[i];
2625 PyObject *elt=PyTuple_New(2);
2626 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2627 int sz2=ret[i].size();
2628 PyObject *elt2=PyList_New(sz2);
2629 for(int j=0;j<sz2;j++)
2631 PyObject *elt3=PyTuple_New(4);
2632 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2633 PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,SWIG_From_int(dadsI[j].first)); PyTuple_SetItem(elt4,1,SWIG_From_int(dadsI[j].second));
2634 PyTuple_SetItem(elt3,1,elt4);
2635 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2636 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2637 PyList_SetItem(elt2,j,elt3);
2639 PyTuple_SetItem(elt,1,elt2);
2640 PyList_SetItem(ret2,i,elt);
2645 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2647 if(PyList_Check(elts))
2649 int sz=PyList_Size(elts);
2650 std::vector<int> ret(sz);
2651 for(int i=0;i<sz;i++)
2653 PyObject *elt=PyList_GetItem(elts,i);
2654 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2660 std::vector<int> ret(1);
2661 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2666 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2668 if(PySlice_Check(elts))
2670 Py_ssize_t strt=2,stp=2,step=2;
2671 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2672 self->eraseTimeStepIds2(strt,stp,step);
2676 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2677 if(!idsToRemove.empty())
2678 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2682 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2686 std::vector<int> pos2;
2687 DataArrayInt *pos3=0;
2688 DataArrayIntTuple *pos4=0;
2689 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2694 self->eraseTimeStepIds(&pos1,&pos1+1);
2701 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2706 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2710 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2714 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2716 return self->iterator();
2719 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2721 if(elt0 && PyList_Check(elt0))
2723 int sz=PyList_Size(elt0);
2724 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2725 int *pt=da->getPointer();
2726 for(int i=0;i<sz;i++,pt++)
2728 PyObject *elt1=PyList_GetItem(elt0,i);
2729 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2731 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2733 else if(elt0 && PySlice_Check(elt0))
2735 Py_ssize_t strt=2,stp=2,step=2;
2736 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2737 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2740 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2743 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2745 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2746 return self->changeMeshNames(modifTab);
2749 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2751 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2752 std::size_t sz=ret.size();
2753 PyObject *retPy=PyList_New(sz);
2754 for(std::size_t i=0;i<sz;i++)
2755 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2759 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2761 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2762 std::size_t sz=ret.size();
2763 PyObject *retPy=PyList_New(sz);
2764 for(std::size_t i=0;i<sz;i++)
2765 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2769 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2771 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2772 std::size_t sz=ret.size();
2773 PyObject *retPy=PyList_New(sz);
2774 for(std::size_t i=0;i<sz;i++)
2775 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2779 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2782 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2783 if(SWIG_IsOK(status))
2785 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2789 std::vector<MEDFileAnyTypeField1TS *> tmp;
2790 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2791 self->pushBackTimeSteps(tmp);
2795 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2797 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2798 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2799 return self->extractPart(extractDefCpp,mm);
2802 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2804 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2805 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2806 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2807 std::size_t sz=ret.size();
2808 PyObject *retPy=PyList_New(sz);
2809 for(std::size_t i=0;i<sz;i++)
2811 std::size_t sz2=ret[i].size();
2812 PyObject *ret1Py=PyList_New(sz2);
2813 for(std::size_t j=0;j<sz2;j++)
2815 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2818 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2820 PyList_SetItem(retPy,i,ret1Py);
2825 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2827 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2828 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2829 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2830 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2831 if(ret2.size()!=ret.size())
2833 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2834 throw INTERP_KERNEL::Exception(oss.str().c_str());
2836 std::size_t sz=ret.size();
2837 PyObject *retPy=PyList_New(sz);
2838 for(std::size_t i=0;i<sz;i++)
2840 std::size_t sz2=ret[i].size();
2841 PyObject *ret0Py=PyTuple_New(2);
2842 PyObject *ret1Py=PyList_New(sz2);
2843 for(std::size_t j=0;j<sz2;j++)
2845 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2848 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2850 PyTuple_SetItem(ret0Py,0,ret1Py);
2851 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2852 PyList_SetItem(retPy,i,ret0Py);
2859 class MEDFileIntFieldMultiTS;
2861 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2864 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2865 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2866 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2867 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2869 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2870 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2871 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2872 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2873 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2874 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2876 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2877 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2878 MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2881 MEDFileFieldMultiTS()
2883 return MEDFileFieldMultiTS::New();
2886 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2888 return MEDFileFieldMultiTS::New(fileName,loadAll);
2891 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2893 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2896 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2898 return MEDFileFieldMultiTS::New(db);
2901 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2903 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2904 std::size_t sz(tmp.size());
2905 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2906 for(std::size_t i=0;i<sz;i++)
2908 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2909 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2911 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2914 std::string __str__() const throw(INTERP_KERNEL::Exception)
2916 return self->simpleRepr();
2919 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2921 DataArrayInt *ret1=0;
2922 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2923 PyObject *ret=PyTuple_New(2);
2924 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2925 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2929 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2931 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2932 std::vector< std::vector<TypeOfField> > typesF;
2933 std::vector< std::vector<std::string> > pfls;
2934 std::vector< std::vector<std::string> > locs;
2935 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2937 PyObject *ret2=PyList_New(sz);
2938 for(int i=0;i<sz;i++)
2940 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2941 const std::vector<TypeOfField>& typesFI=typesF[i];
2942 const std::vector<std::string>& pflsI=pfls[i];
2943 const std::vector<std::string>& locsI=locs[i];
2944 PyObject *elt=PyTuple_New(2);
2945 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2946 int sz2=ret[i].size();
2947 PyObject *elt2=PyList_New(sz2);
2948 for(int j=0;j<sz2;j++)
2950 PyObject *elt3=PyTuple_New(4);
2951 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2952 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2953 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2954 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2955 PyList_SetItem(elt2,j,elt3);
2957 PyTuple_SetItem(elt,1,elt2);
2958 PyList_SetItem(ret2,i,elt);
2962 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2964 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2970 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2972 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2973 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2976 PyObject *ret=PyTuple_New(2);
2977 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2978 std::size_t sz=elt1Cpp.size();
2979 PyObject *elt=PyList_New(sz);
2980 for(std::size_t i=0;i<sz;i++)
2982 PyObject *elt1=PyTuple_New(2);
2983 PyObject *elt2=PyTuple_New(2);
2984 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2985 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2986 PyObject *elt3=PyTuple_New(2);
2987 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2988 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2989 PyTuple_SetItem(elt1,0,elt2);
2990 PyTuple_SetItem(elt1,1,elt3);
2991 PyList_SetItem(elt,i,elt1);
2993 PyTuple_SetItem(ret,1,elt);
2999 class MEDFileFieldsIterator
3004 PyObject *next() throw(INTERP_KERNEL::Exception)
3006 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3008 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3011 PyErr_SetString(PyExc_StopIteration,"No more data.");
3018 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3021 static MEDFileIntFieldMultiTS *New();
3022 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3023 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3024 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3026 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
3027 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3028 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3029 MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3030 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3031 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3032 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3033 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3034 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3037 MEDFileIntFieldMultiTS()
3039 return MEDFileIntFieldMultiTS::New();
3042 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3044 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3047 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3049 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3052 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3054 return MEDFileIntFieldMultiTS::New(db);
3057 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3059 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3060 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3061 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3064 std::string __str__() const throw(INTERP_KERNEL::Exception)
3066 return self->simpleRepr();
3069 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3071 DataArrayInt *ret1=0;
3072 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3073 PyObject *ret=PyTuple_New(2);
3074 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3075 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3079 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3081 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3089 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3092 static MEDFileFloatFieldMultiTS *New();
3093 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3094 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3095 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3097 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
3098 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3099 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3100 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3101 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3102 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3103 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3104 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3105 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3108 MEDFileFloatFieldMultiTS()
3110 return MEDFileFloatFieldMultiTS::New();
3113 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3115 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3118 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3120 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3123 MEDFileFloatFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3125 return MEDFileFloatFieldMultiTS::New(db);
3128 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3130 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3131 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3132 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3135 std::string __str__() const throw(INTERP_KERNEL::Exception)
3137 return self->simpleRepr();
3140 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3142 DataArrayInt *ret1=0;
3143 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3144 PyObject *ret=PyTuple_New(2);
3145 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3146 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3150 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3152 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3160 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3163 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3164 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3167 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3169 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3170 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3178 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3181 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3183 MEDFileStructureElements();
3186 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3189 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3190 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3191 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3192 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3193 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3194 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3195 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3196 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3197 void loadArrays() throw(INTERP_KERNEL::Exception);
3198 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3199 void unloadArrays() throw(INTERP_KERNEL::Exception);
3200 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3201 int getNumberOfFields() const;
3202 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3203 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3205 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3206 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3207 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3208 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3209 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3210 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3211 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3212 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3213 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3214 void killStructureElements() throw(INTERP_KERNEL::Exception);
3215 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3216 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3217 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3218 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3219 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3224 return MEDFileFields::New();
3227 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3229 return MEDFileFields::New(fileName,loadAll);
3232 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3234 return MEDFileFields::New(db);
3237 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3239 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3242 std::string __str__() const throw(INTERP_KERNEL::Exception)
3244 return self->simpleRepr();
3247 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3249 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3253 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3255 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3259 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3261 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3262 std::size_t sz(tmp.size());
3263 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3264 for(std::size_t i=0;i<sz;i++)
3266 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3267 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3269 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3272 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3274 std::vector< std::pair<std::string,std::string> > ps;
3275 self->getMeshSENames(ps);
3276 return convertVectPairStToPy(ps);
3279 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3282 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3283 PyObject *ret=PyTuple_New(2);
3284 PyObject *ret_0=PyList_New(ret0.size());
3286 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3288 PyObject *elt=PyTuple_New(2);
3289 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3290 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3291 PyList_SetItem(ret_0,rk,elt);
3293 PyTuple_SetItem(ret,0,ret_0);
3294 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3295 PyTuple_SetItem(ret,1,ret_1);
3299 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3301 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3302 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3305 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3307 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3308 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3311 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3313 if(obj && PyList_Check(obj))
3315 int sz=PyList_Size(obj);
3316 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3317 int *pt=da->getPointer();
3318 for(int i=0;i<sz;i++,pt++)
3320 PyObject *elt1=PyList_GetItem(obj,i);
3321 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3323 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3326 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3329 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3331 self->setFieldAtPos(obj,field);
3335 int __len__() const throw(INTERP_KERNEL::Exception)
3337 return self->getNumberOfFields();
3340 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3342 return self->iterator();
3345 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3347 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3348 return self->changeMeshNames(modifTab);
3351 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3353 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3355 throw INTERP_KERNEL::Exception(msg);
3356 if(PyInt_Check(elt0))
3358 return PyInt_AS_LONG(elt0);
3360 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3363 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3365 if(PyList_Check(elts))
3367 int sz=PyList_Size(elts);
3368 std::vector<int> ret(sz);
3369 for(int i=0;i<sz;i++)
3371 PyObject *elt=PyList_GetItem(elts,i);
3372 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3378 std::vector<int> ret(1);
3379 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3384 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3386 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3387 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3388 self->pushFields(tmp);
3391 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3393 if(elts && PySlice_Check(elts))
3395 Py_ssize_t strt=2,stp=2,step=2;
3396 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3397 self->destroyFieldsAtPos2(strt,stp,step);
3401 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3402 if(!idsToRemove.empty())
3403 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3407 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3409 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3410 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3411 return self->extractPart(extractDefCpp,mm);
3416 class MEDFileParameter1TS : public RefCountObject
3419 void setIteration(int it);
3420 int getIteration() const;
3421 void setOrder(int order);
3422 int getOrder() const;
3423 void setTimeValue(double time);
3424 void setTime(int dt, int it, double time);
3425 double getTime(int& dt, int& it);
3426 double getTimeValue() const;
3429 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3432 void setValue(double val) throw(INTERP_KERNEL::Exception);
3433 double getValue() const throw(INTERP_KERNEL::Exception);
3434 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3437 std::string __str__() const throw(INTERP_KERNEL::Exception)
3439 return self->simpleRepr();
3444 class MEDFileParameterTinyInfo : public MEDFileWritable
3447 void setDescription(const std::string& name);
3448 std::string getDescription() const;
3449 void setTimeUnit(const std::string& unit);
3450 std::string getTimeUnit() const;
3453 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3456 static MEDFileParameterDouble1TS *New();
3457 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3458 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3459 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3460 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3461 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3462 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3463 std::string getName() const throw(INTERP_KERNEL::Exception);
3464 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3467 MEDFileParameterDouble1TS()
3469 return MEDFileParameterDouble1TS::New();
3472 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3474 return MEDFileParameterDouble1TS::New(fileName);
3477 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3479 return MEDFileParameterDouble1TS::New(fileName,paramName);
3482 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3484 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3487 std::string __str__() const throw(INTERP_KERNEL::Exception)
3489 return self->simpleRepr();
3492 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3495 bool ret0=self->isEqual(other,eps,what);
3496 PyObject *res=PyList_New(2);
3497 PyObject *ret0Py=ret0?Py_True:Py_False;
3499 PyList_SetItem(res,0,ret0Py);
3500 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3506 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3509 static MEDFileParameterMultiTS *New();
3510 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3511 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3512 std::string getName() const;
3513 void setName(const std::string& name);
3514 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3515 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3516 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3517 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3518 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3519 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3520 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3521 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3524 MEDFileParameterMultiTS()
3526 return MEDFileParameterMultiTS::New();
3529 MEDFileParameterMultiTS(const std::string& fileName)
3531 return MEDFileParameterMultiTS::New(fileName);
3534 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3536 return MEDFileParameterMultiTS::New(fileName,paramName);
3539 std::string __str__() const throw(INTERP_KERNEL::Exception)
3541 return self->simpleRepr();
3544 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3547 bool ret0=self->isEqual(other,eps,what);
3548 PyObject *res=PyList_New(2);
3549 PyObject *ret0Py=ret0?Py_True:Py_False;
3551 PyList_SetItem(res,0,ret0Py);
3552 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3556 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3560 std::vector<int> pos2;
3561 DataArrayInt *pos3=0;
3562 DataArrayIntTuple *pos4=0;
3563 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3568 self->eraseTimeStepIds(&pos1,&pos1+1);
3575 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3580 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3584 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3588 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3590 if(elt0 && PyInt_Check(elt0))
3592 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3595 else if(elt0 && PyTuple_Check(elt0))
3597 if(PyTuple_Size(elt0)==2)
3599 PyObject *o0=PyTuple_GetItem(elt0,0);
3600 PyObject *o1=PyTuple_GetItem(elt0,1);
3601 if(PyInt_Check(o0) && PyInt_Check(o1))
3603 int iter=PyInt_AS_LONG(o0);
3604 int order=PyInt_AS_LONG(o1);
3605 return self->getPosOfTimeStep(iter,order);
3608 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
3611 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
3613 else if(elt0 && PyFloat_Check(elt0))
3615 double val=PyFloat_AS_DOUBLE(elt0);
3616 return self->getPosGivenTime(val);
3619 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3622 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3624 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3630 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3632 if(PyList_Check(elts))
3634 int sz=PyList_Size(elts);
3635 std::vector<int> ret(sz);
3636 for(int i=0;i<sz;i++)
3638 PyObject *elt=PyList_GetItem(elts,i);
3639 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3645 std::vector<int> ret(1);
3646 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3651 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3653 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3654 if(!idsToRemove.empty())
3655 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3658 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3660 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3666 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3668 std::vector< std::pair<int,int> > res=self->getIterations();
3669 PyObject *ret=PyList_New(res.size());
3671 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3673 PyObject *elt=PyTuple_New(2);
3674 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3675 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3676 PyList_SetItem(ret,rk,elt);
3681 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3683 std::vector<double> res2;
3684 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3685 PyObject *ret=PyList_New(res.size());
3687 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3689 PyObject *elt=PyTuple_New(3);
3690 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3691 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3692 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3693 PyList_SetItem(ret,rk,elt);
3700 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3703 static MEDFileParameters *New();
3704 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3705 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3706 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3707 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3708 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3709 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3710 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3711 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3712 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3713 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3714 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3719 return MEDFileParameters::New();
3722 MEDFileParameters(const std::string& fileName)
3724 return MEDFileParameters::New(fileName);
3727 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3729 return MEDFileParameters::New(db);
3732 std::string __str__() const throw(INTERP_KERNEL::Exception)
3734 return self->simpleRepr();
3737 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3739 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3740 if(PyInt_Check(obj))
3742 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3747 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
3753 int __len__() const throw(INTERP_KERNEL::Exception)
3755 return self->getNumberOfParams();
3758 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3760 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3766 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3768 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3774 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3777 bool ret0=self->isEqual(other,eps,what);
3778 PyObject *res=PyList_New(2);
3779 PyObject *ret0Py=ret0?Py_True:Py_False;
3781 PyList_SetItem(res,0,ret0Py);
3782 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3788 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3791 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3792 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3793 static MEDFileData *New();
3794 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3795 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3796 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3797 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3798 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3799 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3800 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3802 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3803 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3804 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3805 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3806 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3810 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3812 return MEDFileData::New(fileName);
3815 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3817 return MEDFileData::New(db);
3822 return MEDFileData::New();
3825 std::string __str__() const throw(INTERP_KERNEL::Exception)
3827 return self->simpleRepr();
3830 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3832 MEDFileMeshes *ret=self->getMeshes();
3838 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3840 MEDFileParameters *ret=self->getParams();
3846 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3848 MEDFileFields *ret=self->getFields();
3854 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3856 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3857 return self->changeMeshNames(modifTab);
3860 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3862 std::vector<const MEDFileData *> mfdsCpp;
3863 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3864 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3870 class SauvReader : public RefCountObject
3873 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3874 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3877 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3879 return SauvReader::New(fileName);
3884 class SauvWriter : public RefCountObject
3887 static SauvWriter * New();
3888 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3889 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3890 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3891 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3894 SauvWriter() throw(INTERP_KERNEL::Exception)
3896 return SauvWriter::New();
3903 class MEDFileMeshStruct;
3905 class MEDFileField1TSStructItem
3908 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3911 class MEDFileMeshStruct : public RefCountObject
3914 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3916 ~MEDFileMeshStruct();
3919 class MEDMeshMultiLev : public RefCountObject
3922 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3923 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3924 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3930 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3932 DataArrayInt *famIds(0);
3933 bool isWithoutCopy(false);
3934 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3935 PyObject *ret=PyTuple_New(2);
3936 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3938 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3939 PyTuple_SetItem(ret,1,ret1Py);
3943 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3945 DataArrayInt *numIds(0);
3946 bool isWithoutCopy(false);
3947 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3948 PyObject *ret=PyTuple_New(2);
3949 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3951 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3952 PyTuple_SetItem(ret,1,ret1Py);
3956 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3958 DataArrayInt *famIds(0);
3959 bool isWithoutCopy(false);
3960 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3961 PyObject *ret=PyTuple_New(2);
3962 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3964 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3965 PyTuple_SetItem(ret,1,ret1Py);
3969 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3971 DataArrayInt *numIds(0);
3972 bool isWithoutCopy(false);
3973 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3974 PyObject *ret=PyTuple_New(2);
3975 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3977 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3978 PyTuple_SetItem(ret,1,ret1Py);
3982 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3984 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3985 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3986 PyObject *res(PyList_New(result.size()));
3987 for(int i=0;iL!=result.end(); i++, iL++)
3988 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3994 class MEDUMeshMultiLev : public MEDMeshMultiLev
3997 ~MEDUMeshMultiLev();
4001 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4003 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4004 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4005 PyObject *ret0Py=ncc?Py_True:Py_False;
4007 PyObject *ret=PyTuple_New(7);
4008 PyTuple_SetItem(ret,0,ret0Py);
4009 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4010 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4011 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4012 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4013 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4014 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4020 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4023 ~MEDStructuredMeshMultiLev();
4026 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4029 ~MEDCMeshMultiLev();
4033 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4036 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4037 std::size_t sz(objs.size());
4038 PyObject *ret(PyTuple_New(2));
4039 PyObject *ret0=PyList_New(sz);
4040 for(std::size_t i=0;i<sz;i++)
4041 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4042 PyTuple_SetItem(ret,0,ret0);
4043 PyObject *ret1Py(isInternal?Py_True:Py_False);
4045 PyTuple_SetItem(ret,1,ret1Py);
4051 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4054 ~MEDCurveLinearMeshMultiLev();
4058 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4060 DataArrayDouble *ret0(0);
4061 std::vector<int> ret1;
4063 self->buildVTUArrays(ret0,ret1,ret2);
4064 std::size_t sz(ret1.size());
4065 PyObject *ret=PyTuple_New(3);
4066 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4067 PyObject *ret1Py=PyList_New(sz);
4068 for(std::size_t i=0;i<sz;i++)
4069 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4070 PyTuple_SetItem(ret,1,ret1Py);
4071 PyObject *ret2Py(ret2?Py_True:Py_False);
4073 PyTuple_SetItem(ret,2,ret2Py);
4079 class MEDFileFastCellSupportComparator : public RefCountObject
4082 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4083 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4084 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4085 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4087 ~MEDFileFastCellSupportComparator();
4091 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4093 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4094 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4095 PyObject *res(PyList_New(result.size()));
4096 for(int i=0;iL!=result.end(); i++, iL++)
4097 PyList_SetItem(res,i,PyInt_FromLong(*iL));