1 // Copyright (C) 2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #define MEDCOUPLING_EXPORT
22 #define MEDLOADER_EXPORT
24 #ifdef WITH_DOCSTRINGS
25 %include "MEDLoader_doc.i"
28 %include "MEDCouplingCommon.i"
31 #include "MEDLoader.hxx"
32 #include "MEDFileJoint.hxx"
33 #include "MEDFileMesh.hxx"
34 #include "MEDFileField.hxx"
35 #include "MEDFileParameter.hxx"
36 #include "MEDFileData.hxx"
37 #include "MEDFileEquivalence.hxx"
38 #include "MEDFileEntities.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDLoaderTypemaps.i"
42 #include "SauvReader.hxx"
43 #include "SauvWriter.hxx"
45 using namespace MEDCoupling;
48 #if SWIG_VERSION >= 0x010329
49 %template() std::vector<std::string>;
52 %typemap(out) MEDCoupling::MEDFileMesh*
54 $result=convertMEDFileMesh($1,$owner);
57 %typemap(out) MEDCoupling::MEDFileParameter1TS*
59 $result=convertMEDFileParameter1TS($1,$owner);
62 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
64 $result=convertMEDFileFieldMultiTS($1,$owner);
67 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
69 $result=convertMEDFileField1TS($1,$owner);
72 %typemap(out) MEDCoupling::MEDMeshMultiLev*
74 $result=convertMEDMeshMultiLev($1,$owner);
77 %newobject ReadUMeshFromFamiliesSwig;
78 %newobject ReadUMeshFromGroupsSwig;
79 %newobject ReadFieldSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadFieldCell;
83 %newobject MEDCoupling::ReadFieldNode;
84 %newobject MEDCoupling::ReadFieldGauss;
85 %newobject MEDCoupling::ReadFieldGaussNE;
86 %newobject MEDCoupling::MEDFileMesh::New;
87 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
88 %newobject MEDCoupling::MEDFileMesh::deepCopy;
89 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
90 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
91 %newobject MEDCoupling::MEDFileMesh::__getitem__;
92 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
93 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
94 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
96 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
100 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileMeshSupports::New;
144 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
146 %newobject MEDCoupling::MEDFileStructureElements::New;
148 %newobject MEDCoupling::MEDFileFields::New;
149 %newobject MEDCoupling::MEDFileFields::NewAdv;
150 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
151 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
152 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
153 %newobject MEDCoupling::MEDFileFields::deepCopy;
154 %newobject MEDCoupling::MEDFileFields::shallowCpy;
155 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
156 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
157 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
158 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
159 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
160 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
161 %newobject MEDCoupling::MEDFileFields::__iter__;
162 %newobject MEDCoupling::MEDFileFields::extractPart;
164 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
166 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
175 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
184 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
185 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
194 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
195 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
196 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
197 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
198 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
199 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
200 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
201 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
202 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
204 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
205 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
206 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
207 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
208 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
209 %newobject MEDCoupling::MEDFileField1TS::New;
210 %newobject MEDCoupling::MEDFileField1TS::field;
211 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
212 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
213 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
214 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
215 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
216 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
218 %newobject MEDCoupling::MEDFileIntField1TS::New;
219 %newobject MEDCoupling::MEDFileIntField1TS::field;
220 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
221 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
222 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
223 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
224 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
225 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
227 %newobject MEDCoupling::MEDFileFloatField1TS::New;
228 %newobject MEDCoupling::MEDFileFloatField1TS::field;
229 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
230 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
231 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
232 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
233 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
234 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
236 %newobject MEDCoupling::MEDFileData::New;
237 %newobject MEDCoupling::MEDFileData::deepCopy;
238 %newobject MEDCoupling::MEDFileData::getMeshes;
239 %newobject MEDCoupling::MEDFileData::getFields;
240 %newobject MEDCoupling::MEDFileData::getParams;
241 %newobject MEDCoupling::MEDFileData::Aggregate;
243 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
245 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
246 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
247 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
248 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
249 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
250 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
251 %newobject MEDCoupling::MEDFileParameters::New;
252 %newobject MEDCoupling::MEDFileParameters::deepCopy;
253 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
254 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
255 %newobject MEDCoupling::MEDFileParameters::__getitem__;
257 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
258 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
259 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
260 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
261 %newobject MEDCoupling::MEDFileJointOneStep::New;
262 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
263 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
264 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
265 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
266 %newobject MEDCoupling::MEDFileJoint::New;
267 %newobject MEDCoupling::MEDFileJoint::deepCopy;
268 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
269 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
270 %newobject MEDCoupling::MEDFileJoint::__getitem__;
271 %newobject MEDCoupling::MEDFileJoints::New;
272 %newobject MEDCoupling::MEDFileJoints::deepCopy;
273 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
274 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
275 %newobject MEDCoupling::MEDFileJoints::__getitem__;
276 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
277 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
278 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
279 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
280 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
281 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
282 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
283 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
284 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
286 %newobject MEDCoupling::SauvWriter::New;
287 %newobject MEDCoupling::SauvReader::New;
288 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
290 %newobject MEDCoupling::MEDFileMeshStruct::New;
291 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
292 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
293 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
294 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
295 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
297 %feature("unref") MEDFileMesh "$this->decrRef();"
298 %feature("unref") MEDFileUMesh "$this->decrRef();"
299 %feature("unref") MEDFileCMesh "$this->decrRef();"
300 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
301 %feature("unref") MEDFileMeshes "$this->decrRef();"
302 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
303 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
304 %feature("unref") MEDFileField1TS "$this->decrRef();"
305 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
306 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
307 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
308 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
309 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
310 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
311 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
312 %feature("unref") MEDFileStructureElements "$this->decrRef();"
313 %feature("unref") MEDFileFields "$this->decrRef();"
314 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
315 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
316 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
317 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
318 %feature("unref") MEDFileParameters "$this->decrRef();"
319 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
320 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
321 %feature("unref") MEDFileJoint "$this->decrRef();"
322 %feature("unref") MEDFileJoints "$this->decrRef();"
323 %feature("unref") MEDFileEquivalences "$this->decrRef();"
324 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
325 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
326 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
327 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
328 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
329 %feature("unref") MEDFileData "$this->decrRef();"
330 %feature("unref") SauvReader "$this->decrRef();"
331 %feature("unref") SauvWriter "$this->decrRef();"
332 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
333 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
334 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
335 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
336 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
337 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
339 namespace MEDCoupling
342 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
343 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
344 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
345 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
346 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
347 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
348 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
349 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
350 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
351 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
352 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
353 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
354 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
355 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
356 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
357 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
358 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
359 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
360 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
361 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
362 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
363 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
364 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
365 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
366 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);
367 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);
368 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);
369 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);
370 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
371 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
372 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
373 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
374 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
375 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f) throw(INTERP_KERNEL::Exception);
378 %rename (MEDFileVersion) MEDFileVersionSwig;
379 %rename (GetFieldIterations) GetFieldIterationsSwig;
380 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
381 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
382 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
383 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
384 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
385 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
386 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
387 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
388 %rename (WriteUMeshes) WriteUMeshesSwig;
389 %rename (GetTypesOfField) GetTypesOfFieldSwig;
390 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
391 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
392 %rename (ReadField) ReadFieldSwig;
396 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
398 int major,minor,release;
399 MEDCoupling::MEDFileVersion(major,minor,release);
400 PyObject *ret(PyTuple_New(3));
401 PyTuple_SetItem(ret,0,SWIG_From_int(major));
402 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
403 PyTuple_SetItem(ret,2,SWIG_From_int(release));
407 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
409 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
413 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
415 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
419 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
421 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
425 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)
427 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
431 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
433 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
434 PyObject *ret=PyList_New(res.size());
436 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
438 PyObject *elt=PyTuple_New(2);
439 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
440 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
441 PyList_SetItem(ret,rk,elt);
446 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
448 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
449 PyObject *ret=PyList_New(res.size());
451 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
453 PyObject *elt=PyTuple_New(3);
454 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
455 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
456 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
457 PyList_SetItem(ret,rk,elt);
462 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
464 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
465 PyObject *ret=PyList_New(res.size());
467 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
469 PyObject *elt=PyTuple_New(2);
470 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
471 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
472 PyList_SetItem(ret,rk,elt);
477 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
479 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
480 PyObject *ret=PyList_New(res.size());
482 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
484 PyObject *elt=PyTuple_New(2);
485 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
486 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
487 PyList_SetItem(ret,rk,elt);
492 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
494 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
495 PyObject *ret=PyList_New(res.size());
497 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
499 PyObject *elt=PyTuple_New(2);
500 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
501 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
502 PyList_SetItem(ret,rk,elt);
507 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
509 int meshDim,spaceDim,numberOfNodes;
510 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
511 PyObject *ret=PyTuple_New(4);
512 PyObject *elt0=PyList_New(res.size());
514 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
516 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
518 PyObject *elt1=PyList_New(obj2.size());
519 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
521 PyObject *elt2=PyTuple_New(2);
522 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
523 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
524 PyList_SetItem(elt1,j,elt2);
526 PyList_SetItem(elt0,i,elt1);
528 PyTuple_SetItem(ret,0,elt0);
529 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
530 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
531 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
535 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
536 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
538 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
539 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
540 return convertFieldDoubleVecToPy(res);
543 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
545 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
546 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
547 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
550 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
552 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
553 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
554 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
557 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
559 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
560 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
561 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
564 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
566 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
568 PyObject *ret=PyList_New(size);
569 for(int i=0;i<size;i++)
570 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
574 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
576 std::vector<std::string> grps;
577 converPyListToVecString(li,grps);
578 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
581 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
583 std::vector<std::string> fams;
584 converPyListToVecString(li,fams);
585 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
589 namespace MEDCoupling
591 class MEDFileWritable
594 void copyOptionsFrom(const MEDFileWritable& other) const;
595 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
596 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
597 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
598 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
601 class MEDFileWritableStandAlone : public MEDFileWritable
604 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
605 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
608 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
610 MCAuto<DataArrayByte> ret(self->serialize());
614 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
616 PyObject *ret(PyList_New(0));
620 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
626 class MEDFileMeshReadSelector
629 MEDFileMeshReadSelector();
630 MEDFileMeshReadSelector(unsigned int code);
631 unsigned int getCode() const;
632 void setCode(unsigned int newCode);
633 bool isCellFamilyFieldReading() const;
634 bool isNodeFamilyFieldReading() const;
635 bool isCellNameFieldReading() const;
636 bool isNodeNameFieldReading() const;
637 bool isCellNumFieldReading() const;
638 bool isNodeNumFieldReading() const;
639 bool isGlobalNodeNumFieldReading() const;
640 void setCellFamilyFieldReading(bool b);
641 void setNodeFamilyFieldReading(bool b);
642 void setCellNameFieldReading(bool b);
643 void setNodeNameFieldReading(bool b);
644 void setCellNumFieldReading(bool b);
645 void setNodeNumFieldReading(bool b);
646 void setGlobalNodeNumFieldReading(bool b);
649 std::string __str__() const throw(INTERP_KERNEL::Exception)
651 std::ostringstream oss;
656 std::string __repr__() const throw(INTERP_KERNEL::Exception)
658 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
664 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
667 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
668 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
669 throw(INTERP_KERNEL::Exception);
670 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
671 INTERP_KERNEL::NormalizedCellType loc_geo_type,
672 INTERP_KERNEL::NormalizedCellType rem_geo_type)
673 throw(INTERP_KERNEL::Exception);
674 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
675 MEDFileJointCorrespondence *deepCopy() const;
676 MEDFileJointCorrespondence *shallowCpy() const;
677 void setIsNodal(bool isNodal);
678 bool getIsNodal() const;
679 bool isEqual(const MEDFileJointCorrespondence *other) const;
680 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
681 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
682 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
683 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
684 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
685 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);
686 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
689 MEDFileJointCorrespondence()
691 return MEDFileJointCorrespondence::New();
693 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
695 return MEDFileJointCorrespondence::New(correspondence);
697 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
698 INTERP_KERNEL::NormalizedCellType loc_geo_type,
699 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
701 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
704 std::string __str__() const throw(INTERP_KERNEL::Exception)
706 return self->simpleRepr();
709 DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception)
711 const DataArrayInt *ret(self->getCorrespondence());
714 return const_cast<DataArrayInt *>(ret);
719 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
722 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
723 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
724 MEDFileJointOneStep *deepCopy() const;
725 MEDFileJointOneStep *shallowCpy() const;
726 bool isEqual(const MEDFileJointOneStep *other) const;
727 void setOrder(int order);
728 int getOrder() const;
729 void setIteration(int it);
730 int getIteration() const;
731 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
732 int getNumberOfCorrespondences() const;
733 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
734 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
737 MEDFileJointOneStep()
739 return MEDFileJointOneStep::New();
742 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
744 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
747 std::string __str__() const throw(INTERP_KERNEL::Exception)
749 return self->simpleRepr();
752 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const throw(INTERP_KERNEL::Exception)
754 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
760 MEDFileJointCorrespondence *__getitem__(int i) const throw(INTERP_KERNEL::Exception)
762 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
767 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
770 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
771 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
772 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
773 MEDFileJoint *deepCopy() const;
774 MEDFileJoint *shallowCpy() const;
775 bool isEqual(const MEDFileJoint *other) const;
776 void setLocalMeshName(const std::string& name);
777 std::string getLocalMeshName() const;
778 void setRemoteMeshName(const std::string& name);
779 std::string getRemoteMeshName() const;
780 void setDescription(const std::string& name);
781 std::string getDescription() const;
782 void setJointName(const std::string& name);
783 std::string getJointName() const;
784 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
785 void setDomainNumber(const int& number);
786 int getDomainNumber() const;
787 void pushStep(MEDFileJointOneStep* step);
788 int getNumberOfSteps() const;
789 std::string simpleRepr() const;
794 return MEDFileJoint::New();
797 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
799 return MEDFileJoint::New(fileName,mName,num);
802 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
804 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
807 std::string __str__() const throw(INTERP_KERNEL::Exception)
809 return self->simpleRepr();
812 MEDFileJointOneStep *getStepAtPos(int i) const throw(INTERP_KERNEL::Exception)
814 MEDFileJointOneStep *ret(self->getStepAtPos(i));
820 MEDFileJointOneStep *__getitem__(int i) throw(INTERP_KERNEL::Exception)
822 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
827 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
830 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
831 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
832 MEDFileJoints *deepCopy() const;
833 std::string simpleRepr() const;
834 std::string getMeshName() const;
835 int getNumberOfJoints() const;
836 std::vector<std::string> getJointsNames() const;
837 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
838 void resize(int newSize) throw(INTERP_KERNEL::Exception);
839 void pushJoint(MEDFileJoint *joint);
840 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
841 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
846 return MEDFileJoints::New();
849 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
851 return MEDFileJoints::New(fileName,meshName);
854 std::string __str__() const throw(INTERP_KERNEL::Exception)
856 return self->simpleRepr();
859 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
861 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
864 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
869 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
875 int __len__() const throw(INTERP_KERNEL::Exception)
877 return self->getNumberOfJoints();
880 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
882 MEDFileJoint *ret=self->getJointAtPos(i);
888 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
890 MEDFileJoint *ret=self->getJointWithName(paramName);
898 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
901 MEDFileEquivalenceBase();
904 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
907 MEDFileEquivalenceData();
909 void setArray(DataArrayInt *data);
912 DataArrayInt *getArray()
914 DataArrayInt *ret(self->getArray());
915 if(ret) ret->incrRef();
921 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
924 MEDFileEquivalenceNode();
927 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
930 MEDFileEquivalenceCell();
933 std::size_t size() const;
934 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
935 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
938 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
940 DataArrayInt *ret(self->getArray(type));
941 if(ret) ret->incrRef();
945 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
947 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
948 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
949 PyObject *res=PyList_New(result.size());
950 for(int i=0;iL!=result.end(); i++, iL++)
951 PyList_SetItem(res,i,PyInt_FromLong(*iL));
957 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
960 MEDFileEquivalencePair();
962 std::string getName() const;
963 void setName(const std::string& name);
964 std::string getDescription() const;
965 void setDescription(const std::string& descr);
966 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
969 MEDFileEquivalenceCell *initCell()
971 MEDFileEquivalenceCell *ret(self->initCell());
972 if(ret) ret->incrRef();
976 MEDFileEquivalenceNode *initNode()
978 MEDFileEquivalenceNode *ret(self->initNode());
979 if(ret) ret->incrRef();
983 MEDFileEquivalenceCell *getCell()
985 MEDFileEquivalenceCell *ret(self->getCell());
986 if(ret) ret->incrRef();
990 MEDFileEquivalenceNode *getNode()
992 MEDFileEquivalenceNode *ret(self->getNode());
993 if(ret) ret->incrRef();
999 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1002 MEDFileEquivalences();
1005 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
1006 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
1007 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
1011 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
1013 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1014 if(ret) ret->incrRef();
1017 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1019 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1020 if(ret) ret->incrRef();
1024 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1026 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1027 if(ret) ret->incrRef();
1033 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1036 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1037 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1038 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1039 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1040 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1041 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1042 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1043 void setName(const std::string& name);
1044 std::string getName();
1045 std::string getUnivName() const;
1046 bool getUnivNameWrStatus() const;
1047 void setUnivNameWrStatus(bool newStatus);
1048 void setDescription(const std::string& name);
1049 std::string getDescription() const;
1050 void setOrder(int order);
1051 int getOrder() const;
1052 void setIteration(int it);
1054 void setTimeValue(double time);
1055 void setTime(int dt, int it, double time);
1056 double getTimeValue() const;
1057 void setTimeUnit(const std::string& unit);
1058 std::string getTimeUnit() const;
1059 void setAxisType(MEDCouplingAxisType at);
1060 MEDCouplingAxisType getAxisType() const;
1061 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1062 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1063 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1064 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1065 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1066 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1067 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1068 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1069 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1070 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1071 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1072 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1073 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1074 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1076 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1077 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1078 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1079 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1080 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1081 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1082 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1083 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1084 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1085 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1086 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1087 void clearFamMap() throw(INTERP_KERNEL::Exception);
1088 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1089 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1090 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1091 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1092 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1093 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1094 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1095 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1096 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1097 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1098 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1099 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1100 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1101 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1102 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1103 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1104 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1105 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1106 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1107 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1108 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1109 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1110 static std::string GetMagicFamilyStr();
1111 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1112 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1113 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1114 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1115 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1116 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1117 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1118 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1119 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1120 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1121 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1122 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1123 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1124 void setFamilyInfo(const std::map<std::string,int>& info);
1125 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1126 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1127 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1128 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1129 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1130 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1131 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1132 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1133 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1134 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1135 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1136 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1137 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1138 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1139 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1140 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1141 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1142 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1143 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1144 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1145 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1147 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1148 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1149 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1150 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1151 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1152 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1153 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1154 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1155 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1156 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1157 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1158 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1159 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1160 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1161 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1162 int getNumberOfJoints();
1163 MEDFileJoints *getJoints();
1164 void setJoints( MEDFileJoints* joints );
1165 void initializeEquivalences();
1166 void killEquivalences();
1167 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1168 void killStructureElements() throw(INTERP_KERNEL::Exception);
1171 std::string __str__() const throw(INTERP_KERNEL::Exception)
1173 return self->simpleRepr();
1176 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1178 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1181 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1184 double tmp0=self->getTime(tmp1,tmp2);
1185 PyObject *res = PyList_New(3);
1186 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1187 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1188 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1192 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1195 bool ret0=self->isEqual(other,eps,what);
1196 PyObject *res=PyList_New(2);
1197 PyObject *ret0Py=ret0?Py_True:Py_False;
1199 PyList_SetItem(res,0,ret0Py);
1200 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1204 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1206 std::vector<const DataArrayInt *> grps;
1207 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1208 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1211 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1214 bool ret0=self->areFamsEqual(other,what);
1215 PyObject *res=PyList_New(2);
1216 PyObject *ret0Py=ret0?Py_True:Py_False;
1218 PyList_SetItem(res,0,ret0Py);
1219 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1223 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1226 bool ret0=self->areGrpsEqual(other,what);
1227 PyObject *res=PyList_New(2);
1228 PyObject *ret0Py=ret0?Py_True:Py_False;
1230 PyList_SetItem(res,0,ret0Py);
1231 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1235 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1237 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1238 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1239 PyObject *res=PyList_New(result.size());
1240 for(int i=0;iL!=result.end(); i++, iL++)
1241 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1245 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1247 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1248 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1249 PyObject *res=PyList_New(result.size());
1250 for(int i=0;iL!=result.end(); i++, iL++)
1251 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1255 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1257 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1260 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1263 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1265 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1268 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1271 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1273 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1276 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1279 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1281 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1284 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1287 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1289 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1292 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1295 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1298 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1299 PyObject *ret=PyTuple_New(2);
1300 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1301 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1305 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1307 DataArrayInt *ret3=0;
1308 std::vector<int> ret1,ret2;
1309 bool ret0=self->unPolyze(ret1,ret2,ret3);
1310 PyObject *ret=PyTuple_New(4);
1311 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1313 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1314 for(int j=0;j<(int)ret1.size()/3;j++)
1316 PyObject *retLev2=PyList_New(3);
1317 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1318 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1319 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1320 PyList_SetItem(retLev1_0,j,retLev2);
1322 PyTuple_SetItem(ret,1,retLev1_0);
1324 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1325 for(int j=0;j<(int)ret2.size()/3;j++)
1327 PyObject *retLev2=PyList_New(3);
1328 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1329 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1330 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1331 PyList_SetItem(retLev1_1,j,retLev2);
1333 PyTuple_SetItem(ret,2,retLev1_1);
1335 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1339 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1341 MEDFileEquivalences *ret(self->getEquivalences());
1342 if(ret) ret->incrRef();
1346 virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1348 MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1354 class MEDFileUMesh : public MEDFileMesh
1357 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1358 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1359 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1360 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1361 static MEDFileUMesh *New();
1362 static const char *GetSpeStr4ExtMesh();
1364 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1365 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1366 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1367 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1368 void clearNodeAndCellNumbers();
1370 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1371 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1372 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1373 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1374 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1375 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1376 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1377 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1378 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1379 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1381 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1382 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1383 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1384 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1385 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1386 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1387 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1388 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1389 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1390 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1391 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1392 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1393 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1394 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1395 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1398 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1400 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1403 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1405 return MEDFileUMesh::New(fileName,mrs);
1408 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1410 return MEDFileUMesh::New(mem);
1413 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1415 return MEDFileUMesh::New(db);
1420 return MEDFileUMesh::New();
1423 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)
1425 std::vector<int> typesCpp1;
1426 convertPyToNewIntArr3(types,typesCpp1);
1427 std::size_t sz(typesCpp1.size());
1428 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1429 for(std::size_t ii=0;ii<sz;ii++)
1430 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1431 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1434 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1436 std::vector<double> a0;
1437 std::vector<int> a1;
1438 std::vector<std::string> a2;
1439 std::vector< MCAuto<DataArrayInt> > a3;
1440 MCAuto<DataArrayDouble> a4;
1441 self->serialize(a0,a1,a2,a3,a4);
1442 PyObject *ret(PyTuple_New(5));
1443 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1444 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1446 PyObject *ret2(PyList_New(sz));
1447 for(int i=0;i<sz;i++)
1448 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1449 PyTuple_SetItem(ret,2,ret2);
1451 PyObject *ret3(PyList_New(sz));
1452 for(int i=0;i<sz;i++)
1454 DataArrayInt *elt(a3[i]);
1457 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1459 PyTuple_SetItem(ret,3,ret3);
1460 DataArrayDouble *ret4(a4);
1463 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1467 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1469 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1470 if(!PyTuple_Check(inp))
1471 throw INTERP_KERNEL::Exception(MSG);
1472 int sz(PyTuple_Size(inp));
1474 throw INTERP_KERNEL::Exception(MSG);
1475 std::vector<double> a0;
1476 std::vector<int> a1;
1477 std::vector<std::string> a2;
1478 std::vector< MCAuto<DataArrayInt> > a3;
1479 MCAuto<DataArrayDouble> a4;
1481 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1483 fillArrayWithPyListDbl3(a0py,tmp,a0);
1484 convertPyToNewIntArr3(a1py,a1);
1485 fillStringVector(a2py,a2);
1487 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1489 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1490 if(!SWIG_IsOK(status))
1491 throw INTERP_KERNEL::Exception(MSG);
1492 a4=reinterpret_cast<DataArrayDouble *>(argp);
1493 if((DataArrayDouble *)a4)
1496 std::vector< DataArrayInt * > a3Tmp;
1497 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1498 std::size_t sz(a3Tmp.size());
1500 for(std::size_t i=0;i<sz;i++)
1504 a3Tmp[i]->incrRef();
1506 self->unserialize(a0,a1,a2,a3,a4);
1510 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1513 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1514 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1517 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1520 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1523 self->setMeshAtLevel(meshDimRelToMax,m1);
1526 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1529 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1531 self->removeMeshAtLevel(meshDimRelToMax);
1534 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1536 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1538 DataArrayDouble *a,*a2;
1539 DataArrayDoubleTuple *aa,*aa2;
1540 std::vector<double> bb,bb2;
1542 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1543 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1544 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1548 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1550 std::vector<const MEDFileUMesh *> meshesCpp;
1551 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1552 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1556 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1558 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1559 return convertVecPairIntToPy(ret);
1562 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1564 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1565 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1566 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1569 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1571 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1572 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1573 return self->extractPart(extractDefCpp);
1576 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1578 std::vector<const MEDCouplingUMesh *> ms;
1579 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1580 self->setMeshes(ms,renum);
1583 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1585 std::vector<const MEDCouplingUMesh *> ms;
1586 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1587 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1590 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1592 std::vector<const MEDCouplingUMesh *> ms;
1593 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1594 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1597 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1599 DataArrayDouble *ret=self->getCoords();
1605 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1607 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1610 return const_cast<PartDefinition *>(ret);
1613 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1615 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1616 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1617 PyObject *ret=PyTuple_New(3);
1618 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1619 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1620 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1624 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1626 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1632 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1634 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1635 std::size_t sz(tmp.size());
1636 PyObject *ret=PyList_New(sz);
1637 for(std::size_t i=0;i<sz;i++)
1641 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1648 class MEDFileStructuredMesh : public MEDFileMesh
1653 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1655 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1663 class MEDFileCMesh : public MEDFileStructuredMesh
1666 static MEDFileCMesh *New();
1667 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1668 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1669 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1670 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1671 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1676 return MEDFileCMesh::New();
1679 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1681 return MEDFileCMesh::New(fileName,mrs);
1684 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1686 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1689 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1691 return MEDFileCMesh::New(db);
1694 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1696 const MEDCouplingCMesh *tmp=self->getMesh();
1699 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1704 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1707 static MEDFileCurveLinearMesh *New();
1708 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1709 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1710 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1711 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1714 MEDFileCurveLinearMesh()
1716 return MEDFileCurveLinearMesh::New();
1719 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1721 return MEDFileCurveLinearMesh::New(fileName,mrs);
1724 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1726 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1729 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1731 return MEDFileCurveLinearMesh::New(db);
1734 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1736 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1739 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1744 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1747 static MEDFileMeshMultiTS *New();
1748 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1749 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1750 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1751 std::string getName() const throw(INTERP_KERNEL::Exception);
1752 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1753 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1756 MEDFileMeshMultiTS()
1758 return MEDFileMeshMultiTS::New();
1761 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1763 return MEDFileMeshMultiTS::New(fileName);
1766 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1768 return MEDFileMeshMultiTS::New(fileName,mName);
1771 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1773 MEDFileMesh *ret=self->getOneTimeStep();
1781 class MEDFileMeshesIterator
1786 PyObject *next() throw(INTERP_KERNEL::Exception)
1788 MEDFileMesh *ret=self->nextt();
1792 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1796 PyErr_SetString(PyExc_StopIteration,"No more data.");
1803 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1806 static MEDFileMeshes *New();
1807 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1808 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1809 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1810 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1812 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1813 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1814 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1815 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1816 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1817 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1818 void killStructureElements() throw(INTERP_KERNEL::Exception);
1823 return MEDFileMeshes::New();
1826 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1828 return MEDFileMeshes::New(fileName);
1831 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1833 return MEDFileMeshes::New(db);
1836 std::string __str__() const throw(INTERP_KERNEL::Exception)
1838 return self->simpleRepr();
1841 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1843 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1844 if(PyInt_Check(obj))
1846 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1851 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1857 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1859 self->setMeshAtPos(obj,mesh);
1863 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1865 return self->iterator();
1868 int __len__() const throw(INTERP_KERNEL::Exception)
1870 return self->getNumberOfMeshes();
1873 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1875 MEDFileMesh *ret=self->getMeshAtPos(i);
1880 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1882 MEDFileMesh *ret=self->getMeshWithName(mname);
1890 class MEDFileFieldLoc : public RefCountObject
1893 std::string getName() const;
1894 int getDimension() const;
1895 int getNumberOfGaussPoints() const;
1896 int getNumberOfPointsInCells() const;
1897 const std::vector<double>& getRefCoords() const;
1898 const std::vector<double>& getGaussCoords() const;
1899 const std::vector<double>& getGaussWeights() const;
1900 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1903 std::string __str__() const throw(INTERP_KERNEL::Exception)
1905 return self->repr();
1910 class MEDFileFieldGlobsReal
1913 void resetContent();
1914 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1915 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1916 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1917 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1918 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1919 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1920 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1921 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1922 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1923 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1924 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1925 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1926 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1927 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1928 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1929 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1930 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1931 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1932 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1933 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1934 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1935 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1936 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1937 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1938 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1939 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1940 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1943 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1945 const DataArrayInt *ret=self->getProfile(pflName);
1948 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1951 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1953 const DataArrayInt *ret=self->getProfileFromId(pflId);
1956 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1959 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1961 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1964 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1967 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1969 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1972 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1975 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1977 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1978 return convertVecPairVecStToPy(ret);
1981 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1983 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1984 return convertVecPairVecStToPy(ret);
1987 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1989 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1990 self->changePflsNames(v);
1993 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1995 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1996 self->changePflsRefsNamesGen(v);
1999 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2001 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2002 self->changePflsNamesInStruct(v);
2005 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2007 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2008 self->changeLocsNames(v);
2011 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2013 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2014 self->changeLocsRefsNamesGen(v);
2017 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2019 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2020 self->changeLocsNamesInStruct(v);
2023 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2025 std::ostringstream oss;
2026 self->simpleReprGlobs(oss);
2032 class MEDFileEntities
2037 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2039 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2040 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2042 std::size_t sz(inp0.size());
2044 for(std::size_t i=0;i<sz;i++)
2045 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2047 return MEDFileEntities::BuildFrom(&inp);
2054 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2057 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2058 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2059 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2060 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2061 void loadArrays() throw(INTERP_KERNEL::Exception);
2062 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2063 void unloadArrays() throw(INTERP_KERNEL::Exception);
2064 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2065 int getDimension() const throw(INTERP_KERNEL::Exception);
2066 int getIteration() const throw(INTERP_KERNEL::Exception);
2067 int getOrder() const throw(INTERP_KERNEL::Exception);
2068 std::string getName() throw(INTERP_KERNEL::Exception);
2069 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2070 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2071 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2072 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2073 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2074 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2075 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2076 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2077 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2078 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2079 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2080 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2081 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2082 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2083 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2086 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2089 double tmp0=self->getTime(tmp1,tmp2);
2090 PyObject *res = PyList_New(3);
2091 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2092 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2093 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2097 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2099 std::pair<int,int> res=self->getDtIt();
2100 PyObject *elt=PyTuple_New(2);
2101 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2102 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2106 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2108 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2111 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2113 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2116 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2118 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2119 return self->changeMeshNames(modifTab);
2122 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2124 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2125 PyObject *ret2=PyList_New(ret.size());
2126 for(int i=0;i<(int)ret.size();i++)
2127 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2131 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2133 std::vector<int> ret1;
2134 int ret0=self->getNonEmptyLevels(mname,ret1);
2135 PyObject *elt=PyTuple_New(2);
2136 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2137 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2141 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2143 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2144 std::vector< std::vector<TypeOfField> > typesF;
2145 std::vector< std::vector<std::string> > pfls;
2146 std::vector< std::vector<std::string> > locs;
2147 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2149 PyObject *ret2=PyList_New(sz);
2150 for(int i=0;i<sz;i++)
2152 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2153 const std::vector<TypeOfField>& typesFI=typesF[i];
2154 const std::vector<std::string>& pflsI=pfls[i];
2155 const std::vector<std::string>& locsI=locs[i];
2156 PyObject *elt=PyTuple_New(2);
2157 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2158 int sz2=ret[i].size();
2159 PyObject *elt2=PyList_New(sz2);
2160 for(int j=0;j<sz2;j++)
2162 PyObject *elt3=PyTuple_New(4);
2163 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2164 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));
2165 PyTuple_SetItem(elt3,1,elt4);
2166 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2167 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2168 PyList_SetItem(elt2,j,elt3);
2170 PyTuple_SetItem(elt,1,elt2);
2171 PyList_SetItem(ret2,i,elt);
2176 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2178 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2179 std::size_t sz=ret.size();
2180 PyObject *retPy=PyList_New(sz);
2181 for(std::size_t i=0;i<sz;i++)
2182 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2186 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2188 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2189 std::size_t sz=ret.size();
2190 PyObject *retPy=PyList_New(sz);
2191 for(std::size_t i=0;i<sz;i++)
2192 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2196 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2198 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2199 std::size_t sz=ret.size();
2200 PyObject *retPy=PyList_New(sz);
2201 for(std::size_t i=0;i<sz;i++)
2202 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2206 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2208 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2209 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2210 return self->extractPart(extractDefCpp,mm);
2215 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2218 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2219 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2220 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2221 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2222 static MEDFileField1TS *New();
2223 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2224 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2225 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2226 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2227 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2228 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2229 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2231 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2232 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2233 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2234 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2237 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2239 return MEDFileField1TS::New(fileName,loadAll);
2242 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2244 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2247 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2249 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2252 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2254 return MEDFileField1TS::New(db);
2259 return MEDFileField1TS::New();
2262 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2264 const DataArrayDouble *arr=0;
2266 arr=field->getArray();
2267 self->copyTinyInfoFrom(field,arr);
2270 std::string __str__() const throw(INTERP_KERNEL::Exception)
2272 return self->simpleRepr();
2275 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2277 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2280 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2282 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2283 std::vector< std::vector<TypeOfField> > typesF;
2284 std::vector< std::vector<std::string> > pfls;
2285 std::vector< std::vector<std::string> > locs;
2286 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2288 PyObject *ret2=PyList_New(sz);
2289 for(int i=0;i<sz;i++)
2291 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2292 const std::vector<TypeOfField>& typesFI=typesF[i];
2293 const std::vector<std::string>& pflsI=pfls[i];
2294 const std::vector<std::string>& locsI=locs[i];
2295 PyObject *elt=PyTuple_New(2);
2296 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2297 int sz2=ret[i].size();
2298 PyObject *elt2=PyList_New(sz2);
2299 for(int j=0;j<sz2;j++)
2301 PyObject *elt3=PyTuple_New(4);
2302 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2303 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2304 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2305 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2306 PyList_SetItem(elt2,j,elt3);
2308 PyTuple_SetItem(elt,1,elt2);
2309 PyList_SetItem(ret2,i,elt);
2314 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2316 DataArrayDouble *ret=self->getUndergroundDataArray();
2322 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2324 return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
2329 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2332 static MEDFileIntField1TS *New();
2333 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2334 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2335 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2336 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2337 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2339 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2340 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2341 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2342 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2343 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2344 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2345 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2346 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2349 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2351 return MEDFileIntField1TS::New();
2354 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2356 return MEDFileIntField1TS::New(fileName,loadAll);
2359 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2361 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2364 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2366 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2369 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2371 return MEDFileIntField1TS::New(db);
2374 std::string __str__() const throw(INTERP_KERNEL::Exception)
2376 return self->simpleRepr();
2379 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2381 return MEDFileField1TS_getFieldWithProfile<int>(self,type,meshDimRelToMax,mesh);
2384 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2386 DataArrayInt *ret=self->getUndergroundDataArray();
2392 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2394 return MEDFileField1TS_getUndergroundDataArrayExt<int>(self);
2399 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2402 static MEDFileFloatField1TS *New();
2403 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2404 static MEDFileFloatField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2405 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2406 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2407 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2409 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
2410 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2411 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2412 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2413 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2414 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2415 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2416 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2419 MEDFileFloatField1TS() throw(INTERP_KERNEL::Exception)
2421 return MEDFileFloatField1TS::New();
2424 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2426 return MEDFileFloatField1TS::New(fileName,loadAll);
2429 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2431 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2434 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2436 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2439 MEDFileFloatField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2441 return MEDFileFloatField1TS::New(db);
2444 std::string __str__() const throw(INTERP_KERNEL::Exception)
2446 return self->simpleRepr();
2449 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2451 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2454 DataArrayFloat *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2456 DataArrayFloat *ret=self->getUndergroundDataArray();
2462 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2464 return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
2469 class MEDFileAnyTypeFieldMultiTSIterator
2474 PyObject *next() throw(INTERP_KERNEL::Exception)
2476 MEDFileAnyTypeField1TS *ret=self->nextt();
2478 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2481 PyErr_SetString(PyExc_StopIteration,"No more data.");
2488 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2491 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2492 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2493 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2494 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2495 std::string getName() const throw(INTERP_KERNEL::Exception);
2496 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2497 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2498 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2499 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2500 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2501 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2502 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2503 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2504 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2505 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2506 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2507 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2508 void loadArrays() throw(INTERP_KERNEL::Exception);
2509 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2510 void unloadArrays() throw(INTERP_KERNEL::Exception);
2511 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2513 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2514 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2515 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2516 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2517 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2518 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2521 int __len__() const throw(INTERP_KERNEL::Exception)
2523 return self->getNumberOfTS();
2526 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2528 if(elt0 && PyInt_Check(elt0))
2530 int pos=PyInt_AS_LONG(elt0);
2533 else if(elt0 && PyTuple_Check(elt0))
2535 if(PyTuple_Size(elt0)==2)
2537 PyObject *o0=PyTuple_GetItem(elt0,0);
2538 PyObject *o1=PyTuple_GetItem(elt0,1);
2539 if(PyInt_Check(o0) && PyInt_Check(o1))
2541 int iter=PyInt_AS_LONG(o0);
2542 int order=PyInt_AS_LONG(o1);
2543 return self->getPosOfTimeStep(iter,order);
2546 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 !");
2549 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 !");
2551 else if(elt0 && PyFloat_Check(elt0))
2553 double val=PyFloat_AS_DOUBLE(elt0);
2554 return self->getPosGivenTime(val);
2557 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2560 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2562 std::vector< std::pair<int,int> > res(self->getIterations());
2563 return convertVecPairIntToPy(res);
2566 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2568 std::vector<double> ret1;
2569 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2570 std::size_t sz=ret.size();
2571 PyObject *ret2=PyList_New(sz);
2572 for(std::size_t i=0;i<sz;i++)
2574 PyObject *elt=PyTuple_New(3);
2575 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2576 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2577 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2578 PyList_SetItem(ret2,i,elt);
2583 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2585 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2586 PyObject *ret2=PyList_New(ret.size());
2587 for(int i=0;i<(int)ret.size();i++)
2589 const std::vector<TypeOfField>& rett=ret[i];
2590 PyObject *ret3=PyList_New(rett.size());
2591 for(int j=0;j<(int)rett.size();j++)
2592 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2593 PyList_SetItem(ret2,i,ret3);
2598 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2600 std::vector<int> ret1;
2601 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2602 PyObject *elt=PyTuple_New(2);
2603 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2604 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2608 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2610 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2611 std::vector< std::vector<TypeOfField> > typesF;
2612 std::vector< std::vector<std::string> > pfls;
2613 std::vector< std::vector<std::string> > locs;
2614 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2616 PyObject *ret2=PyList_New(sz);
2617 for(int i=0;i<sz;i++)
2619 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2620 const std::vector<TypeOfField>& typesFI=typesF[i];
2621 const std::vector<std::string>& pflsI=pfls[i];
2622 const std::vector<std::string>& locsI=locs[i];
2623 PyObject *elt=PyTuple_New(2);
2624 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2625 int sz2=ret[i].size();
2626 PyObject *elt2=PyList_New(sz2);
2627 for(int j=0;j<sz2;j++)
2629 PyObject *elt3=PyTuple_New(4);
2630 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2631 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));
2632 PyTuple_SetItem(elt3,1,elt4);
2633 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2634 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2635 PyList_SetItem(elt2,j,elt3);
2637 PyTuple_SetItem(elt,1,elt2);
2638 PyList_SetItem(ret2,i,elt);
2643 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2645 if(PyList_Check(elts))
2647 int sz=PyList_Size(elts);
2648 std::vector<int> ret(sz);
2649 for(int i=0;i<sz;i++)
2651 PyObject *elt=PyList_GetItem(elts,i);
2652 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2658 std::vector<int> ret(1);
2659 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2664 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2666 if(PySlice_Check(elts))
2668 Py_ssize_t strt=2,stp=2,step=2;
2669 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2670 self->eraseTimeStepIds2(strt,stp,step);
2674 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2675 if(!idsToRemove.empty())
2676 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2680 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2684 std::vector<int> pos2;
2685 DataArrayInt *pos3=0;
2686 DataArrayIntTuple *pos4=0;
2687 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2692 self->eraseTimeStepIds(&pos1,&pos1+1);
2699 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2704 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2708 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2712 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2714 return self->iterator();
2717 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2719 if(elt0 && PyList_Check(elt0))
2721 int sz=PyList_Size(elt0);
2722 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2723 int *pt=da->getPointer();
2724 for(int i=0;i<sz;i++,pt++)
2726 PyObject *elt1=PyList_GetItem(elt0,i);
2727 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2729 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2731 else if(elt0 && PySlice_Check(elt0))
2733 Py_ssize_t strt=2,stp=2,step=2;
2734 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2735 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2738 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2741 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2743 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2744 return self->changeMeshNames(modifTab);
2747 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2749 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2750 std::size_t sz=ret.size();
2751 PyObject *retPy=PyList_New(sz);
2752 for(std::size_t i=0;i<sz;i++)
2753 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2757 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2759 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2760 std::size_t sz=ret.size();
2761 PyObject *retPy=PyList_New(sz);
2762 for(std::size_t i=0;i<sz;i++)
2763 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2767 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2769 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2770 std::size_t sz=ret.size();
2771 PyObject *retPy=PyList_New(sz);
2772 for(std::size_t i=0;i<sz;i++)
2773 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2777 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2780 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2781 if(SWIG_IsOK(status))
2783 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2787 std::vector<MEDFileAnyTypeField1TS *> tmp;
2788 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2789 self->pushBackTimeSteps(tmp);
2793 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2795 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2796 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2797 return self->extractPart(extractDefCpp,mm);
2800 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2802 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2803 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2804 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2805 std::size_t sz=ret.size();
2806 PyObject *retPy=PyList_New(sz);
2807 for(std::size_t i=0;i<sz;i++)
2809 std::size_t sz2=ret[i].size();
2810 PyObject *ret1Py=PyList_New(sz2);
2811 for(std::size_t j=0;j<sz2;j++)
2813 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2816 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2818 PyList_SetItem(retPy,i,ret1Py);
2823 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2825 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2826 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2827 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2828 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2829 if(ret2.size()!=ret.size())
2831 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2832 throw INTERP_KERNEL::Exception(oss.str().c_str());
2834 std::size_t sz=ret.size();
2835 PyObject *retPy=PyList_New(sz);
2836 for(std::size_t i=0;i<sz;i++)
2838 std::size_t sz2=ret[i].size();
2839 PyObject *ret0Py=PyTuple_New(2);
2840 PyObject *ret1Py=PyList_New(sz2);
2841 for(std::size_t j=0;j<sz2;j++)
2843 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2846 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2848 PyTuple_SetItem(ret0Py,0,ret1Py);
2849 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2850 PyList_SetItem(retPy,i,ret0Py);
2857 class MEDFileIntFieldMultiTS;
2859 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2862 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2863 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2864 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2865 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2867 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2868 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2869 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2870 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2871 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2872 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2874 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2875 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2876 MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2879 MEDFileFieldMultiTS()
2881 return MEDFileFieldMultiTS::New();
2884 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2886 return MEDFileFieldMultiTS::New(fileName,loadAll);
2889 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2891 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2894 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2896 return MEDFileFieldMultiTS::New(db);
2899 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2901 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2902 std::size_t sz(tmp.size());
2903 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2904 for(std::size_t i=0;i<sz;i++)
2906 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2907 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2909 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2912 std::string __str__() const throw(INTERP_KERNEL::Exception)
2914 return self->simpleRepr();
2917 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2919 DataArrayInt *ret1=0;
2920 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2921 PyObject *ret=PyTuple_New(2);
2922 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2923 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2927 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2929 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2930 std::vector< std::vector<TypeOfField> > typesF;
2931 std::vector< std::vector<std::string> > pfls;
2932 std::vector< std::vector<std::string> > locs;
2933 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2935 PyObject *ret2=PyList_New(sz);
2936 for(int i=0;i<sz;i++)
2938 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2939 const std::vector<TypeOfField>& typesFI=typesF[i];
2940 const std::vector<std::string>& pflsI=pfls[i];
2941 const std::vector<std::string>& locsI=locs[i];
2942 PyObject *elt=PyTuple_New(2);
2943 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2944 int sz2=ret[i].size();
2945 PyObject *elt2=PyList_New(sz2);
2946 for(int j=0;j<sz2;j++)
2948 PyObject *elt3=PyTuple_New(4);
2949 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2950 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2951 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2952 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2953 PyList_SetItem(elt2,j,elt3);
2955 PyTuple_SetItem(elt,1,elt2);
2956 PyList_SetItem(ret2,i,elt);
2960 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2962 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2968 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2970 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2971 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2974 PyObject *ret=PyTuple_New(2);
2975 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2976 std::size_t sz=elt1Cpp.size();
2977 PyObject *elt=PyList_New(sz);
2978 for(std::size_t i=0;i<sz;i++)
2980 PyObject *elt1=PyTuple_New(2);
2981 PyObject *elt2=PyTuple_New(2);
2982 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2983 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2984 PyObject *elt3=PyTuple_New(2);
2985 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2986 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2987 PyTuple_SetItem(elt1,0,elt2);
2988 PyTuple_SetItem(elt1,1,elt3);
2989 PyList_SetItem(elt,i,elt1);
2991 PyTuple_SetItem(ret,1,elt);
2997 class MEDFileFieldsIterator
3002 PyObject *next() throw(INTERP_KERNEL::Exception)
3004 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3006 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3009 PyErr_SetString(PyExc_StopIteration,"No more data.");
3016 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3019 static MEDFileIntFieldMultiTS *New();
3020 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3021 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3022 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3024 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
3025 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3026 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3027 MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3028 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3029 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3030 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3031 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3032 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3035 MEDFileIntFieldMultiTS()
3037 return MEDFileIntFieldMultiTS::New();
3040 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3042 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3045 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3047 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3050 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3052 return MEDFileIntFieldMultiTS::New(db);
3055 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3057 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3058 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3059 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3062 std::string __str__() const throw(INTERP_KERNEL::Exception)
3064 return self->simpleRepr();
3067 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3069 DataArrayInt *ret1=0;
3070 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3071 PyObject *ret=PyTuple_New(2);
3072 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3073 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3077 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3079 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3087 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3090 static MEDFileFloatFieldMultiTS *New();
3091 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3092 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3093 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3095 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
3096 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3097 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3098 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3099 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3100 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3101 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3102 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3103 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3106 MEDFileFloatFieldMultiTS()
3108 return MEDFileFloatFieldMultiTS::New();
3111 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3113 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3116 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3118 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3121 MEDFileFloatFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3123 return MEDFileFloatFieldMultiTS::New(db);
3126 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3128 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3129 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3130 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3133 std::string __str__() const throw(INTERP_KERNEL::Exception)
3135 return self->simpleRepr();
3138 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3140 DataArrayInt *ret1=0;
3141 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3142 PyObject *ret=PyTuple_New(2);
3143 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3144 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3148 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3150 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3158 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3161 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3162 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3165 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3167 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3168 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3176 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3179 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3181 MEDFileStructureElements();
3184 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3187 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3188 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3189 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3190 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3191 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3192 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3193 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3194 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3195 void loadArrays() throw(INTERP_KERNEL::Exception);
3196 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3197 void unloadArrays() throw(INTERP_KERNEL::Exception);
3198 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3199 int getNumberOfFields() const;
3200 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3201 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3203 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3204 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3205 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3206 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3207 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3208 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3209 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3210 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3211 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3212 void killStructureElements() throw(INTERP_KERNEL::Exception);
3213 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3214 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3215 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3216 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3217 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3222 return MEDFileFields::New();
3225 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3227 return MEDFileFields::New(fileName,loadAll);
3230 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3232 return MEDFileFields::New(db);
3235 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3237 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3240 std::string __str__() const throw(INTERP_KERNEL::Exception)
3242 return self->simpleRepr();
3245 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3247 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3251 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3253 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3257 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3259 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3260 std::size_t sz(tmp.size());
3261 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3262 for(std::size_t i=0;i<sz;i++)
3264 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3265 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3267 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3270 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3272 std::vector< std::pair<std::string,std::string> > ps;
3273 self->getMeshSENames(ps);
3274 return convertVectPairStToPy(ps);
3277 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3280 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3281 PyObject *ret=PyTuple_New(2);
3282 PyObject *ret_0=PyList_New(ret0.size());
3284 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3286 PyObject *elt=PyTuple_New(2);
3287 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3288 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3289 PyList_SetItem(ret_0,rk,elt);
3291 PyTuple_SetItem(ret,0,ret_0);
3292 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3293 PyTuple_SetItem(ret,1,ret_1);
3297 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3299 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3300 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3303 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3305 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3306 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3309 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3311 if(obj && PyList_Check(obj))
3313 int sz=PyList_Size(obj);
3314 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3315 int *pt=da->getPointer();
3316 for(int i=0;i<sz;i++,pt++)
3318 PyObject *elt1=PyList_GetItem(obj,i);
3319 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3321 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3324 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3327 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3329 self->setFieldAtPos(obj,field);
3333 int __len__() const throw(INTERP_KERNEL::Exception)
3335 return self->getNumberOfFields();
3338 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3340 return self->iterator();
3343 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3345 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3346 return self->changeMeshNames(modifTab);
3349 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3351 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3353 throw INTERP_KERNEL::Exception(msg);
3354 if(PyInt_Check(elt0))
3356 return PyInt_AS_LONG(elt0);
3358 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3361 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3363 if(PyList_Check(elts))
3365 int sz=PyList_Size(elts);
3366 std::vector<int> ret(sz);
3367 for(int i=0;i<sz;i++)
3369 PyObject *elt=PyList_GetItem(elts,i);
3370 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3376 std::vector<int> ret(1);
3377 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3382 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3384 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3385 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3386 self->pushFields(tmp);
3389 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3391 if(elts && PySlice_Check(elts))
3393 Py_ssize_t strt=2,stp=2,step=2;
3394 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3395 self->destroyFieldsAtPos2(strt,stp,step);
3399 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3400 if(!idsToRemove.empty())
3401 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3405 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3407 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3408 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3409 return self->extractPart(extractDefCpp,mm);
3414 class MEDFileParameter1TS : public RefCountObject
3417 void setIteration(int it);
3418 int getIteration() const;
3419 void setOrder(int order);
3420 int getOrder() const;
3421 void setTimeValue(double time);
3422 void setTime(int dt, int it, double time);
3423 double getTime(int& dt, int& it);
3424 double getTimeValue() const;
3427 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3430 void setValue(double val) throw(INTERP_KERNEL::Exception);
3431 double getValue() const throw(INTERP_KERNEL::Exception);
3432 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3435 std::string __str__() const throw(INTERP_KERNEL::Exception)
3437 return self->simpleRepr();
3442 class MEDFileParameterTinyInfo : public MEDFileWritable
3445 void setDescription(const std::string& name);
3446 std::string getDescription() const;
3447 void setTimeUnit(const std::string& unit);
3448 std::string getTimeUnit() const;
3451 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3454 static MEDFileParameterDouble1TS *New();
3455 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3456 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3457 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3458 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3459 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3460 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3461 std::string getName() const throw(INTERP_KERNEL::Exception);
3462 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3465 MEDFileParameterDouble1TS()
3467 return MEDFileParameterDouble1TS::New();
3470 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3472 return MEDFileParameterDouble1TS::New(fileName);
3475 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3477 return MEDFileParameterDouble1TS::New(fileName,paramName);
3480 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3482 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3485 std::string __str__() const throw(INTERP_KERNEL::Exception)
3487 return self->simpleRepr();
3490 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3493 bool ret0=self->isEqual(other,eps,what);
3494 PyObject *res=PyList_New(2);
3495 PyObject *ret0Py=ret0?Py_True:Py_False;
3497 PyList_SetItem(res,0,ret0Py);
3498 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3504 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3507 static MEDFileParameterMultiTS *New();
3508 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3509 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3510 std::string getName() const;
3511 void setName(const std::string& name);
3512 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3513 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3514 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3515 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3516 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3517 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3518 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3519 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3522 MEDFileParameterMultiTS()
3524 return MEDFileParameterMultiTS::New();
3527 MEDFileParameterMultiTS(const std::string& fileName)
3529 return MEDFileParameterMultiTS::New(fileName);
3532 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3534 return MEDFileParameterMultiTS::New(fileName,paramName);
3537 std::string __str__() const throw(INTERP_KERNEL::Exception)
3539 return self->simpleRepr();
3542 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3545 bool ret0=self->isEqual(other,eps,what);
3546 PyObject *res=PyList_New(2);
3547 PyObject *ret0Py=ret0?Py_True:Py_False;
3549 PyList_SetItem(res,0,ret0Py);
3550 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3554 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3558 std::vector<int> pos2;
3559 DataArrayInt *pos3=0;
3560 DataArrayIntTuple *pos4=0;
3561 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3566 self->eraseTimeStepIds(&pos1,&pos1+1);
3573 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3578 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3582 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3586 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3588 if(elt0 && PyInt_Check(elt0))
3590 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3593 else if(elt0 && PyTuple_Check(elt0))
3595 if(PyTuple_Size(elt0)==2)
3597 PyObject *o0=PyTuple_GetItem(elt0,0);
3598 PyObject *o1=PyTuple_GetItem(elt0,1);
3599 if(PyInt_Check(o0) && PyInt_Check(o1))
3601 int iter=PyInt_AS_LONG(o0);
3602 int order=PyInt_AS_LONG(o1);
3603 return self->getPosOfTimeStep(iter,order);
3606 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 !");
3609 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 !");
3611 else if(elt0 && PyFloat_Check(elt0))
3613 double val=PyFloat_AS_DOUBLE(elt0);
3614 return self->getPosGivenTime(val);
3617 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3620 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3622 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3628 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3630 if(PyList_Check(elts))
3632 int sz=PyList_Size(elts);
3633 std::vector<int> ret(sz);
3634 for(int i=0;i<sz;i++)
3636 PyObject *elt=PyList_GetItem(elts,i);
3637 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3643 std::vector<int> ret(1);
3644 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3649 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3651 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3652 if(!idsToRemove.empty())
3653 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3656 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3658 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3664 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3666 std::vector< std::pair<int,int> > res=self->getIterations();
3667 PyObject *ret=PyList_New(res.size());
3669 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3671 PyObject *elt=PyTuple_New(2);
3672 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3673 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3674 PyList_SetItem(ret,rk,elt);
3679 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3681 std::vector<double> res2;
3682 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3683 PyObject *ret=PyList_New(res.size());
3685 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3687 PyObject *elt=PyTuple_New(3);
3688 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3689 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3690 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3691 PyList_SetItem(ret,rk,elt);
3698 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3701 static MEDFileParameters *New();
3702 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3703 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3704 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3705 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3706 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3707 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3708 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3709 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3710 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3711 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3712 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3717 return MEDFileParameters::New();
3720 MEDFileParameters(const std::string& fileName)
3722 return MEDFileParameters::New(fileName);
3725 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3727 return MEDFileParameters::New(db);
3730 std::string __str__() const throw(INTERP_KERNEL::Exception)
3732 return self->simpleRepr();
3735 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3737 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3738 if(PyInt_Check(obj))
3740 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3745 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
3751 int __len__() const throw(INTERP_KERNEL::Exception)
3753 return self->getNumberOfParams();
3756 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3758 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3764 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3766 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3772 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3775 bool ret0=self->isEqual(other,eps,what);
3776 PyObject *res=PyList_New(2);
3777 PyObject *ret0Py=ret0?Py_True:Py_False;
3779 PyList_SetItem(res,0,ret0Py);
3780 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3786 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3789 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3790 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3791 static MEDFileData *New();
3792 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3793 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3794 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3795 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3796 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3797 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3798 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3800 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3801 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3802 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3803 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3804 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3808 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3810 return MEDFileData::New(fileName);
3813 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3815 return MEDFileData::New(db);
3820 return MEDFileData::New();
3823 std::string __str__() const throw(INTERP_KERNEL::Exception)
3825 return self->simpleRepr();
3828 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3830 MEDFileMeshes *ret=self->getMeshes();
3836 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3838 MEDFileParameters *ret=self->getParams();
3844 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3846 MEDFileFields *ret=self->getFields();
3852 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3854 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3855 return self->changeMeshNames(modifTab);
3858 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3860 std::vector<const MEDFileData *> mfdsCpp;
3861 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3862 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3868 class SauvReader : public RefCountObject
3871 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3872 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3875 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3877 return SauvReader::New(fileName);
3882 class SauvWriter : public RefCountObject
3885 static SauvWriter * New();
3886 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3887 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3888 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3889 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3892 SauvWriter() throw(INTERP_KERNEL::Exception)
3894 return SauvWriter::New();
3901 class MEDFileMeshStruct;
3903 class MEDFileField1TSStructItem
3906 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3909 class MEDFileMeshStruct : public RefCountObject
3912 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3914 ~MEDFileMeshStruct();
3917 class MEDMeshMultiLev : public RefCountObject
3920 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3921 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3922 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3928 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3930 DataArrayInt *famIds(0);
3931 bool isWithoutCopy(false);
3932 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3933 PyObject *ret=PyTuple_New(2);
3934 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3936 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3937 PyTuple_SetItem(ret,1,ret1Py);
3941 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3943 DataArrayInt *numIds(0);
3944 bool isWithoutCopy(false);
3945 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3946 PyObject *ret=PyTuple_New(2);
3947 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3949 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3950 PyTuple_SetItem(ret,1,ret1Py);
3954 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3956 DataArrayInt *famIds(0);
3957 bool isWithoutCopy(false);
3958 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3959 PyObject *ret=PyTuple_New(2);
3960 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3962 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3963 PyTuple_SetItem(ret,1,ret1Py);
3967 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3969 DataArrayInt *numIds(0);
3970 bool isWithoutCopy(false);
3971 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3972 PyObject *ret=PyTuple_New(2);
3973 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3975 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3976 PyTuple_SetItem(ret,1,ret1Py);
3980 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3982 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3983 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3984 PyObject *res(PyList_New(result.size()));
3985 for(int i=0;iL!=result.end(); i++, iL++)
3986 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3992 class MEDUMeshMultiLev : public MEDMeshMultiLev
3995 ~MEDUMeshMultiLev();
3999 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4001 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4002 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4003 PyObject *ret0Py=ncc?Py_True:Py_False;
4005 PyObject *ret=PyTuple_New(7);
4006 PyTuple_SetItem(ret,0,ret0Py);
4007 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4008 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4009 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4010 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4011 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4012 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4018 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4021 ~MEDStructuredMeshMultiLev();
4024 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4027 ~MEDCMeshMultiLev();
4031 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4034 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4035 std::size_t sz(objs.size());
4036 PyObject *ret(PyTuple_New(2));
4037 PyObject *ret0=PyList_New(sz);
4038 for(std::size_t i=0;i<sz;i++)
4039 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4040 PyTuple_SetItem(ret,0,ret0);
4041 PyObject *ret1Py(isInternal?Py_True:Py_False);
4043 PyTuple_SetItem(ret,1,ret1Py);
4049 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4052 ~MEDCurveLinearMeshMultiLev();
4056 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4058 DataArrayDouble *ret0(0);
4059 std::vector<int> ret1;
4061 self->buildVTUArrays(ret0,ret1,ret2);
4062 std::size_t sz(ret1.size());
4063 PyObject *ret=PyTuple_New(3);
4064 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4065 PyObject *ret1Py=PyList_New(sz);
4066 for(std::size_t i=0;i<sz;i++)
4067 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4068 PyTuple_SetItem(ret,1,ret1Py);
4069 PyObject *ret2Py(ret2?Py_True:Py_False);
4071 PyTuple_SetItem(ret,2,ret2Py);
4077 class MEDFileFastCellSupportComparator : public RefCountObject
4080 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4081 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4082 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4083 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4085 ~MEDFileFastCellSupportComparator();
4089 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4091 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4092 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4093 PyObject *res(PyList_New(result.size()));
4094 for(int i=0;iL!=result.end(); i++, iL++)
4095 PyList_SetItem(res,i,PyInt_FromLong(*iL));