1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileEntities.hxx"
41 #include "MEDFileMeshReadSelector.hxx"
42 #include "MEDFileFieldOverView.hxx"
43 #include "MEDLoaderTypemaps.i"
44 #include "SauvReader.hxx"
45 #include "SauvWriter.hxx"
47 using namespace MEDCoupling;
50 #if SWIG_VERSION >= 0x010329
51 %template() std::vector<std::string>;
54 %typemap(out) MEDCoupling::MEDFileMesh*
56 $result=convertMEDFileMesh($1,$owner);
59 %typemap(out) MEDCoupling::MEDFileParameter1TS*
61 $result=convertMEDFileParameter1TS($1,$owner);
64 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
66 $result=convertMEDFileFieldMultiTS($1,$owner);
69 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
71 $result=convertMEDFileField1TS($1,$owner);
74 %typemap(out) MEDCoupling::MEDMeshMultiLev*
76 $result=convertMEDMeshMultiLev($1,$owner);
79 %newobject ReadUMeshFromFamiliesSwig;
80 %newobject ReadUMeshFromGroupsSwig;
81 %newobject ReadFieldSwig;
82 %newobject MEDCoupling::ReadUMeshFromFile;
83 %newobject MEDCoupling::ReadMeshFromFile;
84 %newobject MEDCoupling::ReadFieldCell;
85 %newobject MEDCoupling::ReadFieldNode;
86 %newobject MEDCoupling::ReadFieldGauss;
87 %newobject MEDCoupling::ReadFieldGaussNE;
88 %newobject MEDCoupling::MEDFileMesh::New;
89 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
90 %newobject MEDCoupling::MEDFileMesh::deepCopy;
91 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
92 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
93 %newobject MEDCoupling::MEDFileMesh::__getitem__;
94 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
95 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
102 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
103 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
104 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
105 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
106 %newobject MEDCoupling::MEDFileMesh::cartesianize;
107 %newobject MEDCoupling::MEDFileData::getJoints;
108 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
109 %newobject MEDCoupling::MEDFileUMesh::New;
110 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
111 %newobject MEDCoupling::MEDFileUMesh::getCoords;
112 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
113 %newobject MEDCoupling::MEDFileUMesh::getGroup;
114 %newobject MEDCoupling::MEDFileUMesh::getGroups;
115 %newobject MEDCoupling::MEDFileUMesh::getFamily;
116 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
117 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
122 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
124 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
125 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
126 %newobject MEDCoupling::MEDFileUMesh::extractPart;
127 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
128 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
129 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
130 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
131 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
132 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
133 %newobject MEDCoupling::MEDFileCMesh::New;
134 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
137 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
138 %newobject MEDCoupling::MEDFileMeshes::New;
139 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
141 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
142 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
143 %newobject MEDCoupling::MEDFileMeshes::__iter__;
145 %newobject MEDCoupling::MEDFileMeshSupports::New;
146 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
148 %newobject MEDCoupling::MEDFileStructureElements::New;
150 %newobject MEDCoupling::MEDFileFields::New;
151 %newobject MEDCoupling::MEDFileFields::NewAdv;
152 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
153 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
154 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
155 %newobject MEDCoupling::MEDFileFields::deepCopy;
156 %newobject MEDCoupling::MEDFileFields::shallowCpy;
157 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
158 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
160 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
162 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
163 %newobject MEDCoupling::MEDFileFields::__iter__;
164 %newobject MEDCoupling::MEDFileFields::extractPart;
166 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
193 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
194 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
196 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
197 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
198 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
199 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
200 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
201 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
202 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
203 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
204 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
206 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
207 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
208 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
209 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
210 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
211 %newobject MEDCoupling::MEDFileField1TS::New;
212 %newobject MEDCoupling::MEDFileField1TS::field;
213 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
214 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
215 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
216 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
217 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
218 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
220 %newobject MEDCoupling::MEDFileIntField1TS::New;
221 %newobject MEDCoupling::MEDFileIntField1TS::field;
222 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
223 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
224 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
225 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
226 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
227 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
229 %newobject MEDCoupling::MEDFileFloatField1TS::New;
230 %newobject MEDCoupling::MEDFileFloatField1TS::field;
231 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
232 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
233 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
234 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
235 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
236 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
238 %newobject MEDCoupling::MEDFileData::New;
239 %newobject MEDCoupling::MEDFileData::deepCopy;
240 %newobject MEDCoupling::MEDFileData::getMeshes;
241 %newobject MEDCoupling::MEDFileData::getFields;
242 %newobject MEDCoupling::MEDFileData::getParams;
243 %newobject MEDCoupling::MEDFileData::Aggregate;
245 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
247 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
248 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
249 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
250 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
251 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
252 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
253 %newobject MEDCoupling::MEDFileParameters::New;
254 %newobject MEDCoupling::MEDFileParameters::deepCopy;
255 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
256 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
257 %newobject MEDCoupling::MEDFileParameters::__getitem__;
259 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
260 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
261 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
262 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
263 %newobject MEDCoupling::MEDFileJointOneStep::New;
264 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
265 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
266 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
267 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
268 %newobject MEDCoupling::MEDFileJoint::New;
269 %newobject MEDCoupling::MEDFileJoint::deepCopy;
270 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
271 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
272 %newobject MEDCoupling::MEDFileJoint::__getitem__;
273 %newobject MEDCoupling::MEDFileJoints::New;
274 %newobject MEDCoupling::MEDFileJoints::deepCopy;
275 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
276 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
277 %newobject MEDCoupling::MEDFileJoints::__getitem__;
278 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
279 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
280 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
281 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
282 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
283 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
284 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
285 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
286 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
288 %newobject MEDCoupling::SauvWriter::New;
289 %newobject MEDCoupling::SauvReader::New;
290 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
292 %newobject MEDCoupling::MEDFileMeshStruct::New;
293 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
294 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
295 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
296 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
297 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
299 %feature("unref") MEDFileMesh "$this->decrRef();"
300 %feature("unref") MEDFileUMesh "$this->decrRef();"
301 %feature("unref") MEDFileCMesh "$this->decrRef();"
302 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
303 %feature("unref") MEDFileMeshes "$this->decrRef();"
304 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
305 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
306 %feature("unref") MEDFileField1TS "$this->decrRef();"
307 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
308 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
309 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
310 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
311 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
312 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
313 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
314 %feature("unref") MEDFileStructureElements "$this->decrRef();"
315 %feature("unref") MEDFileFields "$this->decrRef();"
316 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
317 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
318 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
319 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
320 %feature("unref") MEDFileParameters "$this->decrRef();"
321 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
322 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
323 %feature("unref") MEDFileJoint "$this->decrRef();"
324 %feature("unref") MEDFileJoints "$this->decrRef();"
325 %feature("unref") MEDFileEquivalences "$this->decrRef();"
326 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
327 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
328 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
329 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
330 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
331 %feature("unref") MEDFileData "$this->decrRef();"
332 %feature("unref") SauvReader "$this->decrRef();"
333 %feature("unref") SauvWriter "$this->decrRef();"
334 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
335 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
336 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
337 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
338 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
339 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
341 namespace MEDCoupling
344 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
345 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
346 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
347 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
348 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
349 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
350 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
351 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
352 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
353 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
354 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
355 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
356 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
357 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
358 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
359 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
360 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
361 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
362 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
363 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
364 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
365 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
366 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
367 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
368 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
369 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
370 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
371 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
372 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
373 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
374 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
375 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
376 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
377 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
380 %rename (MEDFileVersion) MEDFileVersionSwig;
381 %rename (GetFieldIterations) GetFieldIterationsSwig;
382 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
383 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
384 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
385 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
386 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
387 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
388 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
389 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
390 %rename (WriteUMeshes) WriteUMeshesSwig;
391 %rename (GetTypesOfField) GetTypesOfFieldSwig;
392 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
393 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
394 %rename (ReadField) ReadFieldSwig;
398 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
400 int major,minor,release;
401 MEDCoupling::MEDFileVersion(major,minor,release);
402 PyObject *ret(PyTuple_New(3));
403 PyTuple_SetItem(ret,0,SWIG_From_int(major));
404 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
405 PyTuple_SetItem(ret,2,SWIG_From_int(release));
409 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
411 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
415 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
417 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
421 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
423 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
427 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
429 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
433 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
435 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
436 PyObject *ret=PyList_New(res.size());
438 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
440 PyObject *elt=PyTuple_New(2);
441 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
442 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
443 PyList_SetItem(ret,rk,elt);
448 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
450 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
451 PyObject *ret=PyList_New(res.size());
453 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
455 PyObject *elt=PyTuple_New(3);
456 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
457 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
458 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
459 PyList_SetItem(ret,rk,elt);
464 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
466 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
467 PyObject *ret=PyList_New(res.size());
469 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
471 PyObject *elt=PyTuple_New(2);
472 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
473 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
474 PyList_SetItem(ret,rk,elt);
479 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
481 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
482 PyObject *ret=PyList_New(res.size());
484 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
486 PyObject *elt=PyTuple_New(2);
487 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
488 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
489 PyList_SetItem(ret,rk,elt);
494 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
496 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
497 PyObject *ret=PyList_New(res.size());
499 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
501 PyObject *elt=PyTuple_New(2);
502 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
503 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
504 PyList_SetItem(ret,rk,elt);
509 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
511 int meshDim,spaceDim,numberOfNodes;
512 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
513 PyObject *ret=PyTuple_New(4);
514 PyObject *elt0=PyList_New(res.size());
516 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
518 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
520 PyObject *elt1=PyList_New(obj2.size());
521 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
523 PyObject *elt2=PyTuple_New(2);
524 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
525 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
526 PyList_SetItem(elt1,j,elt2);
528 PyList_SetItem(elt0,i,elt1);
530 PyTuple_SetItem(ret,0,elt0);
531 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
532 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
533 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
537 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
538 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
540 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
541 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
542 return convertFieldDoubleVecToPy(res);
545 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
547 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
548 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
549 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
552 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
554 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
555 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
556 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
559 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
561 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
562 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
563 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
566 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
568 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
570 PyObject *ret=PyList_New(size);
571 for(int i=0;i<size;i++)
572 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
576 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
578 std::vector<std::string> grps;
579 converPyListToVecString(li,grps);
580 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
583 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
585 std::vector<std::string> fams;
586 converPyListToVecString(li,fams);
587 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
591 namespace MEDCoupling
593 class MEDFileWritable
596 void copyOptionsFrom(const MEDFileWritable& other) const;
597 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
598 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
599 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
600 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
603 class MEDFileWritableStandAlone : public MEDFileWritable
606 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
607 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
610 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
612 MCAuto<DataArrayByte> ret(self->serialize());
616 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
618 PyObject *ret(PyList_New(0));
622 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
626 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
629 PyObject *ret(PyTuple_New(1));
630 PyObject *ret0(PyDict_New());
631 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
632 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
633 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
634 PyObject *tmp1(PyInt_FromLong(0));
635 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
636 PyTuple_SetItem(ret,0,ret0);
640 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
646 class MEDFileMeshReadSelector
649 MEDFileMeshReadSelector();
650 MEDFileMeshReadSelector(unsigned int code);
651 unsigned int getCode() const;
652 void setCode(unsigned int newCode);
653 bool isCellFamilyFieldReading() const;
654 bool isNodeFamilyFieldReading() const;
655 bool isCellNameFieldReading() const;
656 bool isNodeNameFieldReading() const;
657 bool isCellNumFieldReading() const;
658 bool isNodeNumFieldReading() const;
659 bool isGlobalNodeNumFieldReading() const;
660 void setCellFamilyFieldReading(bool b);
661 void setNodeFamilyFieldReading(bool b);
662 void setCellNameFieldReading(bool b);
663 void setNodeNameFieldReading(bool b);
664 void setCellNumFieldReading(bool b);
665 void setNodeNumFieldReading(bool b);
666 void setGlobalNodeNumFieldReading(bool b);
669 std::string __str__() const throw(INTERP_KERNEL::Exception)
671 std::ostringstream oss;
676 std::string __repr__() const throw(INTERP_KERNEL::Exception)
678 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
684 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
687 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
688 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
689 throw(INTERP_KERNEL::Exception);
690 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
691 INTERP_KERNEL::NormalizedCellType loc_geo_type,
692 INTERP_KERNEL::NormalizedCellType rem_geo_type)
693 throw(INTERP_KERNEL::Exception);
694 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
695 MEDFileJointCorrespondence *deepCopy() const;
696 MEDFileJointCorrespondence *shallowCpy() const;
697 void setIsNodal(bool isNodal);
698 bool getIsNodal() const;
699 bool isEqual(const MEDFileJointCorrespondence *other) const;
700 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
701 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
702 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
703 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
704 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
705 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);
706 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
709 MEDFileJointCorrespondence()
711 return MEDFileJointCorrespondence::New();
713 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
715 return MEDFileJointCorrespondence::New(correspondence);
717 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
718 INTERP_KERNEL::NormalizedCellType loc_geo_type,
719 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
721 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
724 std::string __str__() const throw(INTERP_KERNEL::Exception)
726 return self->simpleRepr();
729 DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception)
731 const DataArrayInt *ret(self->getCorrespondence());
734 return const_cast<DataArrayInt *>(ret);
739 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
742 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
743 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
744 MEDFileJointOneStep *deepCopy() const;
745 MEDFileJointOneStep *shallowCpy() const;
746 bool isEqual(const MEDFileJointOneStep *other) const;
747 void setOrder(int order);
748 int getOrder() const;
749 void setIteration(int it);
750 int getIteration() const;
751 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
752 int getNumberOfCorrespondences() const;
753 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
754 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
757 MEDFileJointOneStep()
759 return MEDFileJointOneStep::New();
762 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
764 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
767 std::string __str__() const throw(INTERP_KERNEL::Exception)
769 return self->simpleRepr();
772 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const throw(INTERP_KERNEL::Exception)
774 MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
780 MEDFileJointCorrespondence *__getitem__(int i) const throw(INTERP_KERNEL::Exception)
782 return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
787 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
790 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
791 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
792 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception);
793 MEDFileJoint *deepCopy() const;
794 MEDFileJoint *shallowCpy() const;
795 bool isEqual(const MEDFileJoint *other) const;
796 void setLocalMeshName(const std::string& name);
797 std::string getLocalMeshName() const;
798 void setRemoteMeshName(const std::string& name);
799 std::string getRemoteMeshName() const;
800 void setDescription(const std::string& name);
801 std::string getDescription() const;
802 void setJointName(const std::string& name);
803 std::string getJointName() const;
804 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
805 void setDomainNumber(const int& number);
806 int getDomainNumber() const;
807 void pushStep(MEDFileJointOneStep* step);
808 int getNumberOfSteps() const;
809 std::string simpleRepr() const;
814 return MEDFileJoint::New();
817 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
819 return MEDFileJoint::New(fileName,mName,num);
822 MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum) throw(INTERP_KERNEL::Exception)
824 return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
827 std::string __str__() const throw(INTERP_KERNEL::Exception)
829 return self->simpleRepr();
832 MEDFileJointOneStep *getStepAtPos(int i) const throw(INTERP_KERNEL::Exception)
834 MEDFileJointOneStep *ret(self->getStepAtPos(i));
840 MEDFileJointOneStep *__getitem__(int i) throw(INTERP_KERNEL::Exception)
842 return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
847 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
850 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
851 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
852 MEDFileJoints *deepCopy() const;
853 std::string simpleRepr() const;
854 std::string getMeshName() const;
855 int getNumberOfJoints() const;
856 std::vector<std::string> getJointsNames() const;
857 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
858 void resize(int newSize) throw(INTERP_KERNEL::Exception);
859 void pushJoint(MEDFileJoint *joint);
860 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
861 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
866 return MEDFileJoints::New();
869 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
871 return MEDFileJoints::New(fileName,meshName);
874 std::string __str__() const throw(INTERP_KERNEL::Exception)
876 return self->simpleRepr();
879 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
881 static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
884 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
889 MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
895 int __len__() const throw(INTERP_KERNEL::Exception)
897 return self->getNumberOfJoints();
900 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
902 MEDFileJoint *ret=self->getJointAtPos(i);
908 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
910 MEDFileJoint *ret=self->getJointWithName(paramName);
918 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
921 MEDFileEquivalenceBase();
924 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
927 MEDFileEquivalenceData();
929 void setArray(DataArrayInt *data);
932 DataArrayInt *getArray()
934 DataArrayInt *ret(self->getArray());
935 if(ret) ret->incrRef();
941 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
944 MEDFileEquivalenceNode();
947 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
950 MEDFileEquivalenceCell();
953 std::size_t size() const;
954 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
955 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
958 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
960 DataArrayInt *ret(self->getArray(type));
961 if(ret) ret->incrRef();
965 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
967 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
968 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
969 PyObject *res=PyList_New(result.size());
970 for(int i=0;iL!=result.end(); i++, iL++)
971 PyList_SetItem(res,i,PyInt_FromLong(*iL));
977 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
980 MEDFileEquivalencePair();
982 std::string getName() const;
983 void setName(const std::string& name);
984 std::string getDescription() const;
985 void setDescription(const std::string& descr);
986 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
989 MEDFileEquivalenceCell *initCell()
991 MEDFileEquivalenceCell *ret(self->initCell());
992 if(ret) ret->incrRef();
996 MEDFileEquivalenceNode *initNode()
998 MEDFileEquivalenceNode *ret(self->initNode());
999 if(ret) ret->incrRef();
1003 MEDFileEquivalenceCell *getCell()
1005 MEDFileEquivalenceCell *ret(self->getCell());
1006 if(ret) ret->incrRef();
1010 MEDFileEquivalenceNode *getNode()
1012 MEDFileEquivalenceNode *ret(self->getNode());
1013 if(ret) ret->incrRef();
1019 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
1022 MEDFileEquivalences();
1025 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
1026 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
1027 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
1031 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
1033 MEDFileEquivalencePair *ret(self->getEquivalence(i));
1034 if(ret) ret->incrRef();
1037 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1039 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
1040 if(ret) ret->incrRef();
1044 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
1046 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
1047 if(ret) ret->incrRef();
1053 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
1056 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1057 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1058 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1059 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
1060 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
1061 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
1062 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
1063 void setName(const std::string& name);
1064 std::string getName();
1065 std::string getUnivName() const;
1066 bool getUnivNameWrStatus() const;
1067 void setUnivNameWrStatus(bool newStatus);
1068 void setDescription(const std::string& name);
1069 std::string getDescription() const;
1070 void setOrder(int order);
1071 int getOrder() const;
1072 void setIteration(int it);
1074 void setTimeValue(double time);
1075 void setTime(int dt, int it, double time);
1076 double getTimeValue() const;
1077 void setTimeUnit(const std::string& unit);
1078 std::string getTimeUnit() const;
1079 void setAxisType(MEDCouplingAxisType at);
1080 MEDCouplingAxisType getAxisType() const;
1081 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1082 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1083 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1084 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1085 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1086 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1087 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1088 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1089 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1090 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1091 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1092 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1093 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1094 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1096 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1097 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1098 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1099 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1100 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1101 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1102 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1103 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1104 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1105 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1106 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1107 void clearFamMap() throw(INTERP_KERNEL::Exception);
1108 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1109 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1110 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1111 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1112 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1113 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1114 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1115 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1116 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1117 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1118 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1119 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1120 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1121 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1122 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1123 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1124 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1125 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1126 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1127 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1128 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1129 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1130 static std::string GetMagicFamilyStr();
1131 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1132 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1133 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1134 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1135 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1136 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1137 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1138 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1139 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1140 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1141 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1142 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1143 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1144 void setFamilyInfo(const std::map<std::string,int>& info);
1145 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1146 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1147 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1148 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1149 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1150 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1151 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1152 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1153 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1154 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1155 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1156 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1157 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1158 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1159 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1160 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1161 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1162 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1163 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1164 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1165 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1167 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1168 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1169 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1170 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1171 virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr) throw(INTERP_KERNEL::Exception);
1172 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1173 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1174 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1175 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1176 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1177 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1178 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1179 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1180 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1181 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1182 int getNumberOfJoints();
1183 MEDFileJoints *getJoints();
1184 void setJoints( MEDFileJoints* joints );
1185 void initializeEquivalences();
1186 void killEquivalences();
1187 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1188 void killStructureElements() throw(INTERP_KERNEL::Exception);
1191 std::string __str__() const throw(INTERP_KERNEL::Exception)
1193 return self->simpleRepr();
1196 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1198 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1201 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1204 double tmp0=self->getTime(tmp1,tmp2);
1205 PyObject *res = PyList_New(3);
1206 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1207 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1208 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1212 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1215 bool ret0=self->isEqual(other,eps,what);
1216 PyObject *res=PyList_New(2);
1217 PyObject *ret0Py=ret0?Py_True:Py_False;
1219 PyList_SetItem(res,0,ret0Py);
1220 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1224 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1226 std::vector<const DataArrayInt *> grps;
1227 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1228 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1231 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1234 bool ret0=self->areFamsEqual(other,what);
1235 PyObject *res=PyList_New(2);
1236 PyObject *ret0Py=ret0?Py_True:Py_False;
1238 PyList_SetItem(res,0,ret0Py);
1239 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1243 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1246 bool ret0=self->areGrpsEqual(other,what);
1247 PyObject *res=PyList_New(2);
1248 PyObject *ret0Py=ret0?Py_True:Py_False;
1250 PyList_SetItem(res,0,ret0Py);
1251 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1255 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1257 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1258 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1259 PyObject *res=PyList_New(result.size());
1260 for(int i=0;iL!=result.end(); i++, iL++)
1261 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1265 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1267 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1268 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1269 PyObject *res=PyList_New(result.size());
1270 for(int i=0;iL!=result.end(); i++, iL++)
1271 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1275 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1277 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1280 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1283 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1285 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1288 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1291 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1293 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1296 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1299 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1301 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1304 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1307 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1309 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1312 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1315 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1318 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1319 PyObject *ret=PyTuple_New(2);
1320 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1321 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1325 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1327 DataArrayInt *ret3=0;
1328 std::vector<int> ret1,ret2;
1329 bool ret0=self->unPolyze(ret1,ret2,ret3);
1330 PyObject *ret=PyTuple_New(4);
1331 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1333 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1334 for(int j=0;j<(int)ret1.size()/3;j++)
1336 PyObject *retLev2=PyList_New(3);
1337 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1338 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1339 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1340 PyList_SetItem(retLev1_0,j,retLev2);
1342 PyTuple_SetItem(ret,1,retLev1_0);
1344 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1345 for(int j=0;j<(int)ret2.size()/3;j++)
1347 PyObject *retLev2=PyList_New(3);
1348 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1349 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1350 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1351 PyList_SetItem(retLev1_1,j,retLev2);
1353 PyTuple_SetItem(ret,2,retLev1_1);
1355 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1359 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1361 MEDFileEquivalences *ret(self->getEquivalences());
1362 if(ret) ret->incrRef();
1366 virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1368 MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
1374 class MEDFileUMesh : public MEDFileMesh
1377 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1378 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1379 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1380 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1381 static MEDFileUMesh *New();
1382 static const char *GetSpeStr4ExtMesh();
1384 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1385 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1386 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1387 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1388 void clearNodeAndCellNumbers();
1390 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1391 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1392 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1393 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1394 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1395 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1396 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1397 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1398 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1399 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1401 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1402 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1403 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1404 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1405 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1406 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1407 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1408 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1409 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1410 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1411 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1412 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1413 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1414 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1415 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1418 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1420 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1423 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1425 return MEDFileUMesh::New(fileName,mrs);
1428 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1430 return MEDFileUMesh::New(mem);
1433 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1435 return MEDFileUMesh::New(db);
1440 return MEDFileUMesh::New();
1444 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1446 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1449 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)
1451 std::vector<int> typesCpp1;
1452 convertPyToNewIntArr3(types,typesCpp1);
1453 std::size_t sz(typesCpp1.size());
1454 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1455 for(std::size_t ii=0;ii<sz;ii++)
1456 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1457 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1460 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1461 {// put an empty dict in input to say to __new__ to call __init__...
1462 PyObject *ret(PyTuple_New(1));
1463 PyObject *ret0(PyDict_New());
1464 PyTuple_SetItem(ret,0,ret0);
1468 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1470 std::vector<double> a0;
1471 std::vector<int> a1;
1472 std::vector<std::string> a2;
1473 std::vector< MCAuto<DataArrayInt> > a3;
1474 MCAuto<DataArrayDouble> a4;
1475 self->serialize(a0,a1,a2,a3,a4);
1476 PyObject *ret(PyTuple_New(5));
1477 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1478 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1480 PyObject *ret2(PyList_New(sz));
1481 for(int i=0;i<sz;i++)
1482 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1483 PyTuple_SetItem(ret,2,ret2);
1485 PyObject *ret3(PyList_New(sz));
1486 for(int i=0;i<sz;i++)
1488 DataArrayInt *elt(a3[i]);
1491 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1493 PyTuple_SetItem(ret,3,ret3);
1494 DataArrayDouble *ret4(a4);
1497 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1501 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1503 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1504 if(!PyTuple_Check(inp))
1505 throw INTERP_KERNEL::Exception(MSG);
1506 int sz(PyTuple_Size(inp));
1508 throw INTERP_KERNEL::Exception(MSG);
1509 std::vector<double> a0;
1510 std::vector<int> a1;
1511 std::vector<std::string> a2;
1512 std::vector< MCAuto<DataArrayInt> > a3;
1513 MCAuto<DataArrayDouble> a4;
1515 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1517 fillArrayWithPyListDbl3(a0py,tmp,a0);
1518 convertPyToNewIntArr3(a1py,a1);
1519 fillStringVector(a2py,a2);
1521 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1523 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1524 if(!SWIG_IsOK(status))
1525 throw INTERP_KERNEL::Exception(MSG);
1526 a4=reinterpret_cast<DataArrayDouble *>(argp);
1527 if((DataArrayDouble *)a4)
1530 std::vector< DataArrayInt * > a3Tmp;
1531 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1532 std::size_t sz(a3Tmp.size());
1534 for(std::size_t i=0;i<sz;i++)
1538 a3Tmp[i]->incrRef();
1540 self->unserialize(a0,a1,a2,a3,a4);
1544 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1547 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1548 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1551 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1554 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1557 self->setMeshAtLevel(meshDimRelToMax,m1);
1560 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1563 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1565 self->removeMeshAtLevel(meshDimRelToMax);
1568 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1570 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1572 DataArrayDouble *a,*a2;
1573 DataArrayDoubleTuple *aa,*aa2;
1574 std::vector<double> bb,bb2;
1576 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1577 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1578 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1582 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1584 std::vector<const MEDFileUMesh *> meshesCpp;
1585 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1586 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1590 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1592 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1593 return convertVecPairIntToPy(ret);
1596 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1598 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1599 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1600 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1603 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1605 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1606 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1607 return self->extractPart(extractDefCpp);
1610 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1612 std::vector<const MEDCouplingUMesh *> ms;
1613 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1614 self->setMeshes(ms,renum);
1617 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1619 std::vector<const MEDCouplingUMesh *> ms;
1620 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1621 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1624 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1626 std::vector<const MEDCouplingUMesh *> ms;
1627 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1628 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1631 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1633 DataArrayDouble *ret=self->getCoords();
1639 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1641 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1644 return const_cast<PartDefinition *>(ret);
1647 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1649 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1650 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1651 PyObject *ret=PyTuple_New(3);
1652 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1653 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1654 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1658 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1660 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1666 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1668 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1669 std::size_t sz(tmp.size());
1670 PyObject *ret=PyList_New(sz);
1671 for(std::size_t i=0;i<sz;i++)
1675 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1682 class MEDFileStructuredMesh : public MEDFileMesh
1687 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1689 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1697 class MEDFileCMesh : public MEDFileStructuredMesh
1700 static MEDFileCMesh *New();
1701 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1702 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1703 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1704 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1705 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1710 return MEDFileCMesh::New();
1713 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1715 return MEDFileCMesh::New(fileName,mrs);
1718 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1720 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1723 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1725 return MEDFileCMesh::New(db);
1729 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1731 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1734 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1736 const MEDCouplingCMesh *tmp=self->getMesh();
1739 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1744 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1747 static MEDFileCurveLinearMesh *New();
1748 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1749 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1750 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1751 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1754 MEDFileCurveLinearMesh()
1756 return MEDFileCurveLinearMesh::New();
1759 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1761 return MEDFileCurveLinearMesh::New(fileName,mrs);
1764 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1766 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1769 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1771 return MEDFileCurveLinearMesh::New(db);
1775 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1777 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1780 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1782 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1785 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1790 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1793 static MEDFileMeshMultiTS *New();
1794 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1795 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1796 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1797 std::string getName() const throw(INTERP_KERNEL::Exception);
1798 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1799 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1802 MEDFileMeshMultiTS()
1804 return MEDFileMeshMultiTS::New();
1807 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1809 return MEDFileMeshMultiTS::New(fileName);
1812 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1814 return MEDFileMeshMultiTS::New(fileName,mName);
1817 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1819 MEDFileMesh *ret=self->getOneTimeStep();
1827 class MEDFileMeshesIterator
1832 PyObject *next() throw(INTERP_KERNEL::Exception)
1834 MEDFileMesh *ret=self->nextt();
1838 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1842 PyErr_SetString(PyExc_StopIteration,"No more data.");
1849 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1852 static MEDFileMeshes *New();
1853 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1854 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1855 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1856 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1858 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1859 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1860 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1861 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1862 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1863 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1864 void killStructureElements() throw(INTERP_KERNEL::Exception);
1869 return MEDFileMeshes::New();
1872 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1874 return MEDFileMeshes::New(fileName);
1877 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1879 return MEDFileMeshes::New(db);
1883 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1885 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1888 std::string __str__() const throw(INTERP_KERNEL::Exception)
1890 return self->simpleRepr();
1893 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1895 static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
1896 if(PyInt_Check(obj))
1898 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1903 MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
1909 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1911 self->setMeshAtPos(obj,mesh);
1915 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1917 return self->iterator();
1920 int __len__() const throw(INTERP_KERNEL::Exception)
1922 return self->getNumberOfMeshes();
1925 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1927 MEDFileMesh *ret=self->getMeshAtPos(i);
1932 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1934 MEDFileMesh *ret=self->getMeshWithName(mname);
1942 class MEDFileFieldLoc : public RefCountObject
1945 std::string getName() const;
1946 int getDimension() const;
1947 int getNumberOfGaussPoints() const;
1948 int getNumberOfPointsInCells() const;
1949 const std::vector<double>& getRefCoords() const;
1950 const std::vector<double>& getGaussCoords() const;
1951 const std::vector<double>& getGaussWeights() const;
1952 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1955 std::string __str__() const throw(INTERP_KERNEL::Exception)
1957 return self->repr();
1962 class MEDFileFieldGlobsReal
1965 void resetContent();
1966 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1967 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1968 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1969 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1970 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1971 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1972 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1973 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1974 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1975 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1976 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1977 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1978 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1979 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1980 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1981 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1982 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1983 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1984 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1985 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1986 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1987 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1988 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1989 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1990 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1991 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1992 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1995 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1997 const DataArrayInt *ret=self->getProfile(pflName);
2000 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2003 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
2005 const DataArrayInt *ret=self->getProfileFromId(pflId);
2008 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2011 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
2013 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
2016 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2019 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
2021 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
2024 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
2027 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
2029 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
2030 return convertVecPairVecStToPy(ret);
2033 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
2035 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
2036 return convertVecPairVecStToPy(ret);
2039 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2041 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2042 self->changePflsNames(v);
2045 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2047 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2048 self->changePflsRefsNamesGen(v);
2051 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2053 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2054 self->changePflsNamesInStruct(v);
2057 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2059 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2060 self->changeLocsNames(v);
2063 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
2065 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2066 self->changeLocsRefsNamesGen(v);
2069 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2071 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2072 self->changeLocsNamesInStruct(v);
2075 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2077 std::ostringstream oss;
2078 self->simpleReprGlobs(oss);
2084 class MEDFileEntities
2089 static MEDFileEntities *BuildFrom(PyObject *entities) throw(INTERP_KERNEL::Exception)
2091 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
2092 std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
2094 std::size_t sz(inp0.size());
2096 for(std::size_t i=0;i<sz;i++)
2097 inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
2099 return MEDFileEntities::BuildFrom(&inp);
2106 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2109 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2110 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2111 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2112 static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
2113 void loadArrays() throw(INTERP_KERNEL::Exception);
2114 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2115 void unloadArrays() throw(INTERP_KERNEL::Exception);
2116 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2117 int getDimension() const throw(INTERP_KERNEL::Exception);
2118 int getIteration() const throw(INTERP_KERNEL::Exception);
2119 int getOrder() const throw(INTERP_KERNEL::Exception);
2120 std::string getName() throw(INTERP_KERNEL::Exception);
2121 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2122 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2123 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2124 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2125 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2126 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2127 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2128 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2129 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2130 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2131 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2132 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2133 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2134 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2135 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2138 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2141 double tmp0=self->getTime(tmp1,tmp2);
2142 PyObject *res = PyList_New(3);
2143 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2144 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2145 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2149 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2151 std::pair<int,int> res=self->getDtIt();
2152 PyObject *elt=PyTuple_New(2);
2153 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2154 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2158 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2160 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2163 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2165 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2168 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2170 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2171 return self->changeMeshNames(modifTab);
2174 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2176 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2177 PyObject *ret2=PyList_New(ret.size());
2178 for(int i=0;i<(int)ret.size();i++)
2179 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2183 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2185 std::vector<int> ret1;
2186 int ret0=self->getNonEmptyLevels(mname,ret1);
2187 PyObject *elt=PyTuple_New(2);
2188 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2189 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2193 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2195 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2196 std::vector< std::vector<TypeOfField> > typesF;
2197 std::vector< std::vector<std::string> > pfls;
2198 std::vector< std::vector<std::string> > locs;
2199 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2201 PyObject *ret2=PyList_New(sz);
2202 for(int i=0;i<sz;i++)
2204 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2205 const std::vector<TypeOfField>& typesFI=typesF[i];
2206 const std::vector<std::string>& pflsI=pfls[i];
2207 const std::vector<std::string>& locsI=locs[i];
2208 PyObject *elt=PyTuple_New(2);
2209 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2210 int sz2=ret[i].size();
2211 PyObject *elt2=PyList_New(sz2);
2212 for(int j=0;j<sz2;j++)
2214 PyObject *elt3=PyTuple_New(4);
2215 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2216 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));
2217 PyTuple_SetItem(elt3,1,elt4);
2218 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2219 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2220 PyList_SetItem(elt2,j,elt3);
2222 PyTuple_SetItem(elt,1,elt2);
2223 PyList_SetItem(ret2,i,elt);
2228 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2230 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2231 std::size_t sz=ret.size();
2232 PyObject *retPy=PyList_New(sz);
2233 for(std::size_t i=0;i<sz;i++)
2234 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2238 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2240 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2241 std::size_t sz=ret.size();
2242 PyObject *retPy=PyList_New(sz);
2243 for(std::size_t i=0;i<sz;i++)
2244 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2248 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2250 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2251 std::size_t sz=ret.size();
2252 PyObject *retPy=PyList_New(sz);
2253 for(std::size_t i=0;i<sz;i++)
2254 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2258 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2260 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2261 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2262 return self->extractPart(extractDefCpp,mm);
2267 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2270 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2271 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2272 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2273 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2274 static MEDFileField1TS *New();
2275 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2276 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2277 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2278 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2279 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2280 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2281 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2283 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2284 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2285 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2286 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2289 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2291 return MEDFileField1TS::New(fileName,loadAll);
2294 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2296 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2299 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2301 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2304 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2306 return MEDFileField1TS::New(db);
2311 return MEDFileField1TS::New();
2315 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2317 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2320 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2322 const DataArrayDouble *arr=0;
2324 arr=field->getArray();
2325 self->copyTinyInfoFrom(field,arr);
2328 std::string __str__() const throw(INTERP_KERNEL::Exception)
2330 return self->simpleRepr();
2333 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2335 DataArrayInt *ret1=0;
2336 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2337 PyObject *ret=PyTuple_New(2);
2338 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2339 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2345 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2346 std::vector< std::vector<TypeOfField> > typesF;
2347 std::vector< std::vector<std::string> > pfls;
2348 std::vector< std::vector<std::string> > locs;
2349 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2351 PyObject *ret2=PyList_New(sz);
2352 for(int i=0;i<sz;i++)
2354 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2355 const std::vector<TypeOfField>& typesFI=typesF[i];
2356 const std::vector<std::string>& pflsI=pfls[i];
2357 const std::vector<std::string>& locsI=locs[i];
2358 PyObject *elt=PyTuple_New(2);
2359 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2360 int sz2=ret[i].size();
2361 PyObject *elt2=PyList_New(sz2);
2362 for(int j=0;j<sz2;j++)
2364 PyObject *elt3=PyTuple_New(4);
2365 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2366 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2367 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2368 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2369 PyList_SetItem(elt2,j,elt3);
2371 PyTuple_SetItem(elt,1,elt2);
2372 PyList_SetItem(ret2,i,elt);
2377 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2379 DataArrayDouble *ret=self->getUndergroundDataArray();
2385 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2387 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2388 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2391 PyObject *ret=PyTuple_New(2);
2392 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2393 std::size_t sz=elt1Cpp.size();
2394 PyObject *elt=PyList_New(sz);
2395 for(std::size_t i=0;i<sz;i++)
2397 PyObject *elt1=PyTuple_New(2);
2398 PyObject *elt2=PyTuple_New(2);
2399 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2400 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2401 PyObject *elt3=PyTuple_New(2);
2402 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2403 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2404 PyTuple_SetItem(elt1,0,elt2);
2405 PyTuple_SetItem(elt1,1,elt3);
2406 PyList_SetItem(elt,i,elt1);
2408 PyTuple_SetItem(ret,1,elt);
2414 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2417 static MEDFileIntField1TS *New();
2418 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2419 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2420 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2421 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2422 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2424 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2425 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2426 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2427 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2428 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2429 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2430 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2431 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2434 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2436 return MEDFileIntField1TS::New();
2439 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2441 return MEDFileIntField1TS::New(fileName,loadAll);
2444 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2446 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2449 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2451 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2454 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2456 return MEDFileIntField1TS::New(db);
2460 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2462 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2465 std::string __str__() const throw(INTERP_KERNEL::Exception)
2467 return self->simpleRepr();
2470 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2472 DataArrayInt *ret1=0;
2473 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2474 PyObject *ret=PyTuple_New(2);
2475 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2476 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2480 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2482 DataArrayInt *ret=self->getUndergroundDataArray();
2490 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2493 static MEDFileFloatField1TS *New();
2494 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2495 static MEDFileFloatField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2496 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2497 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2498 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2500 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
2501 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2502 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2503 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2504 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2505 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2506 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2507 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2510 MEDFileFloatField1TS() throw(INTERP_KERNEL::Exception)
2512 return MEDFileFloatField1TS::New();
2515 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2517 return MEDFileFloatField1TS::New(fileName,loadAll);
2520 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2522 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2525 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2527 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2530 MEDFileFloatField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2532 return MEDFileFloatField1TS::New(db);
2536 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2538 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatField1TS");
2541 std::string __str__() const throw(INTERP_KERNEL::Exception)
2543 return self->simpleRepr();
2546 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2548 DataArrayInt *ret1=0;
2549 DataArrayFloat *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2550 PyObject *ret=PyTuple_New(2);
2551 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2552 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
2556 DataArrayFloat *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2558 DataArrayFloat *ret=self->getUndergroundDataArray();
2566 class MEDFileAnyTypeFieldMultiTSIterator
2571 PyObject *next() throw(INTERP_KERNEL::Exception)
2573 MEDFileAnyTypeField1TS *ret=self->nextt();
2575 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2578 PyErr_SetString(PyExc_StopIteration,"No more data.");
2585 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2588 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2589 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2590 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2591 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2592 std::string getName() const throw(INTERP_KERNEL::Exception);
2593 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2594 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2595 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2596 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2597 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2598 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2599 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2600 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2601 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2602 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2603 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2604 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2605 void loadArrays() throw(INTERP_KERNEL::Exception);
2606 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2607 void unloadArrays() throw(INTERP_KERNEL::Exception);
2608 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2610 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2611 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2612 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2613 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2614 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2615 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2618 int __len__() const throw(INTERP_KERNEL::Exception)
2620 return self->getNumberOfTS();
2623 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2625 if(elt0 && PyInt_Check(elt0))
2627 int pos=PyInt_AS_LONG(elt0);
2630 else if(elt0 && PyTuple_Check(elt0))
2632 if(PyTuple_Size(elt0)==2)
2634 PyObject *o0=PyTuple_GetItem(elt0,0);
2635 PyObject *o1=PyTuple_GetItem(elt0,1);
2636 if(PyInt_Check(o0) && PyInt_Check(o1))
2638 int iter=PyInt_AS_LONG(o0);
2639 int order=PyInt_AS_LONG(o1);
2640 return self->getPosOfTimeStep(iter,order);
2643 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 !");
2646 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 !");
2648 else if(elt0 && PyFloat_Check(elt0))
2650 double val=PyFloat_AS_DOUBLE(elt0);
2651 return self->getPosGivenTime(val);
2654 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2657 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2659 std::vector< std::pair<int,int> > res(self->getIterations());
2660 return convertVecPairIntToPy(res);
2663 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2665 std::vector<double> ret1;
2666 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2667 std::size_t sz=ret.size();
2668 PyObject *ret2=PyList_New(sz);
2669 for(std::size_t i=0;i<sz;i++)
2671 PyObject *elt=PyTuple_New(3);
2672 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2673 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2674 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2675 PyList_SetItem(ret2,i,elt);
2680 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2682 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2683 PyObject *ret2=PyList_New(ret.size());
2684 for(int i=0;i<(int)ret.size();i++)
2686 const std::vector<TypeOfField>& rett=ret[i];
2687 PyObject *ret3=PyList_New(rett.size());
2688 for(int j=0;j<(int)rett.size();j++)
2689 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2690 PyList_SetItem(ret2,i,ret3);
2695 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2697 std::vector<int> ret1;
2698 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2699 PyObject *elt=PyTuple_New(2);
2700 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2701 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2705 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2707 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2708 std::vector< std::vector<TypeOfField> > typesF;
2709 std::vector< std::vector<std::string> > pfls;
2710 std::vector< std::vector<std::string> > locs;
2711 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2713 PyObject *ret2=PyList_New(sz);
2714 for(int i=0;i<sz;i++)
2716 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2717 const std::vector<TypeOfField>& typesFI=typesF[i];
2718 const std::vector<std::string>& pflsI=pfls[i];
2719 const std::vector<std::string>& locsI=locs[i];
2720 PyObject *elt=PyTuple_New(2);
2721 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2722 int sz2=ret[i].size();
2723 PyObject *elt2=PyList_New(sz2);
2724 for(int j=0;j<sz2;j++)
2726 PyObject *elt3=PyTuple_New(4);
2727 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2728 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));
2729 PyTuple_SetItem(elt3,1,elt4);
2730 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2731 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2732 PyList_SetItem(elt2,j,elt3);
2734 PyTuple_SetItem(elt,1,elt2);
2735 PyList_SetItem(ret2,i,elt);
2740 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2742 if(PyList_Check(elts))
2744 int sz=PyList_Size(elts);
2745 std::vector<int> ret(sz);
2746 for(int i=0;i<sz;i++)
2748 PyObject *elt=PyList_GetItem(elts,i);
2749 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2755 std::vector<int> ret(1);
2756 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2761 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2763 if(PySlice_Check(elts))
2765 Py_ssize_t strt=2,stp=2,step=2;
2766 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2767 self->eraseTimeStepIds2(strt,stp,step);
2771 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2772 if(!idsToRemove.empty())
2773 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2777 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2781 std::vector<int> pos2;
2782 DataArrayInt *pos3=0;
2783 DataArrayIntTuple *pos4=0;
2784 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2789 self->eraseTimeStepIds(&pos1,&pos1+1);
2796 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2801 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2805 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2809 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2811 return self->iterator();
2814 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2816 if(elt0 && PyList_Check(elt0))
2818 int sz=PyList_Size(elt0);
2819 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2820 int *pt=da->getPointer();
2821 for(int i=0;i<sz;i++,pt++)
2823 PyObject *elt1=PyList_GetItem(elt0,i);
2824 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2826 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2828 else if(elt0 && PySlice_Check(elt0))
2830 Py_ssize_t strt=2,stp=2,step=2;
2831 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2832 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2835 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2838 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2840 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2841 return self->changeMeshNames(modifTab);
2844 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2846 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2847 std::size_t sz=ret.size();
2848 PyObject *retPy=PyList_New(sz);
2849 for(std::size_t i=0;i<sz;i++)
2850 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2854 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2856 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2857 std::size_t sz=ret.size();
2858 PyObject *retPy=PyList_New(sz);
2859 for(std::size_t i=0;i<sz;i++)
2860 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2864 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2866 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2867 std::size_t sz=ret.size();
2868 PyObject *retPy=PyList_New(sz);
2869 for(std::size_t i=0;i<sz;i++)
2870 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2874 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2877 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2878 if(SWIG_IsOK(status))
2880 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2884 std::vector<MEDFileAnyTypeField1TS *> tmp;
2885 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2886 self->pushBackTimeSteps(tmp);
2890 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2892 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2893 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2894 return self->extractPart(extractDefCpp,mm);
2897 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2899 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2900 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2901 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2902 std::size_t sz=ret.size();
2903 PyObject *retPy=PyList_New(sz);
2904 for(std::size_t i=0;i<sz;i++)
2906 std::size_t sz2=ret[i].size();
2907 PyObject *ret1Py=PyList_New(sz2);
2908 for(std::size_t j=0;j<sz2;j++)
2910 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2913 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2915 PyList_SetItem(retPy,i,ret1Py);
2920 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2922 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2923 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2924 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2925 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2926 if(ret2.size()!=ret.size())
2928 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2929 throw INTERP_KERNEL::Exception(oss.str().c_str());
2931 std::size_t sz=ret.size();
2932 PyObject *retPy=PyList_New(sz);
2933 for(std::size_t i=0;i<sz;i++)
2935 std::size_t sz2=ret[i].size();
2936 PyObject *ret0Py=PyTuple_New(2);
2937 PyObject *ret1Py=PyList_New(sz2);
2938 for(std::size_t j=0;j<sz2;j++)
2940 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2943 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2945 PyTuple_SetItem(ret0Py,0,ret1Py);
2946 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2947 PyList_SetItem(retPy,i,ret0Py);
2954 class MEDFileIntFieldMultiTS;
2956 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2959 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2960 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2961 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2962 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2964 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2965 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2966 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2967 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2968 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2969 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2971 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2972 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2973 MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2976 MEDFileFieldMultiTS()
2978 return MEDFileFieldMultiTS::New();
2981 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2983 return MEDFileFieldMultiTS::New(fileName,loadAll);
2986 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2988 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2991 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2993 return MEDFileFieldMultiTS::New(db);
2997 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2999 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
3002 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3004 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3005 std::size_t sz(tmp.size());
3006 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3007 for(std::size_t i=0;i<sz;i++)
3009 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3010 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3012 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3015 std::string __str__() const throw(INTERP_KERNEL::Exception)
3017 return self->simpleRepr();
3020 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3022 DataArrayInt *ret1=0;
3023 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3024 PyObject *ret=PyTuple_New(2);
3025 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3026 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3030 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
3032 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3033 std::vector< std::vector<TypeOfField> > typesF;
3034 std::vector< std::vector<std::string> > pfls;
3035 std::vector< std::vector<std::string> > locs;
3036 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3038 PyObject *ret2=PyList_New(sz);
3039 for(int i=0;i<sz;i++)
3041 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3042 const std::vector<TypeOfField>& typesFI=typesF[i];
3043 const std::vector<std::string>& pflsI=pfls[i];
3044 const std::vector<std::string>& locsI=locs[i];
3045 PyObject *elt=PyTuple_New(2);
3046 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3047 int sz2=ret[i].size();
3048 PyObject *elt2=PyList_New(sz2);
3049 for(int j=0;j<sz2;j++)
3051 PyObject *elt3=PyTuple_New(4);
3052 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3053 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3054 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3055 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3056 PyList_SetItem(elt2,j,elt3);
3058 PyTuple_SetItem(elt,1,elt2);
3059 PyList_SetItem(ret2,i,elt);
3063 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3065 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3071 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3073 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
3074 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3077 PyObject *ret=PyTuple_New(2);
3078 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3079 std::size_t sz=elt1Cpp.size();
3080 PyObject *elt=PyList_New(sz);
3081 for(std::size_t i=0;i<sz;i++)
3083 PyObject *elt1=PyTuple_New(2);
3084 PyObject *elt2=PyTuple_New(2);
3085 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3086 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3087 PyObject *elt3=PyTuple_New(2);
3088 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
3089 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
3090 PyTuple_SetItem(elt1,0,elt2);
3091 PyTuple_SetItem(elt1,1,elt3);
3092 PyList_SetItem(elt,i,elt1);
3094 PyTuple_SetItem(ret,1,elt);
3100 class MEDFileFieldsIterator
3105 PyObject *next() throw(INTERP_KERNEL::Exception)
3107 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3109 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3112 PyErr_SetString(PyExc_StopIteration,"No more data.");
3119 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3122 static MEDFileIntFieldMultiTS *New();
3123 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3124 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3125 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3127 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
3128 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3129 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3130 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3131 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3132 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3133 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3134 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3135 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3138 MEDFileIntFieldMultiTS()
3140 return MEDFileIntFieldMultiTS::New();
3143 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3145 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3148 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3150 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3153 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3155 return MEDFileIntFieldMultiTS::New(db);
3159 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3161 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3164 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3166 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3167 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3168 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3171 std::string __str__() const throw(INTERP_KERNEL::Exception)
3173 return self->simpleRepr();
3176 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3178 DataArrayInt *ret1=0;
3179 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3180 PyObject *ret=PyTuple_New(2);
3181 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3186 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3188 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3196 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3199 static MEDFileFloatFieldMultiTS *New();
3200 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3201 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3202 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3204 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
3205 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3206 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3207 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3208 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3209 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3210 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3211 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3212 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3215 MEDFileFloatFieldMultiTS()
3217 return MEDFileFloatFieldMultiTS::New();
3220 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3222 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3225 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3227 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3230 MEDFileFloatFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3232 return MEDFileFloatFieldMultiTS::New(db);
3236 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3238 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatFieldMultiTS");
3241 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3243 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3244 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3245 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3248 std::string __str__() const throw(INTERP_KERNEL::Exception)
3250 return self->simpleRepr();
3253 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3255 DataArrayInt *ret1=0;
3256 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3257 PyObject *ret=PyTuple_New(2);
3258 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3259 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3263 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3265 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3273 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3276 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3277 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3280 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3282 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3283 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3291 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3294 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3296 MEDFileStructureElements();
3299 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3302 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3303 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3304 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3305 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3306 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3307 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3308 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3309 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3310 void loadArrays() throw(INTERP_KERNEL::Exception);
3311 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3312 void unloadArrays() throw(INTERP_KERNEL::Exception);
3313 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3314 int getNumberOfFields() const;
3315 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3316 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3318 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3319 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3320 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3321 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3322 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3323 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3324 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3325 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3326 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3327 void killStructureElements() throw(INTERP_KERNEL::Exception);
3328 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3329 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3330 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3331 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3332 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3337 return MEDFileFields::New();
3340 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3342 return MEDFileFields::New(fileName,loadAll);
3345 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3347 return MEDFileFields::New(db);
3350 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3352 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3356 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3358 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3361 std::string __str__() const throw(INTERP_KERNEL::Exception)
3363 return self->simpleRepr();
3366 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3368 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3372 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3374 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3378 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3380 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3381 std::size_t sz(tmp.size());
3382 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3383 for(std::size_t i=0;i<sz;i++)
3385 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3386 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3388 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3391 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3393 std::vector< std::pair<std::string,std::string> > ps;
3394 self->getMeshSENames(ps);
3395 return convertVectPairStToPy(ps);
3398 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3401 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3402 PyObject *ret=PyTuple_New(2);
3403 PyObject *ret_0=PyList_New(ret0.size());
3405 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3407 PyObject *elt=PyTuple_New(2);
3408 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3409 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3410 PyList_SetItem(ret_0,rk,elt);
3412 PyTuple_SetItem(ret,0,ret_0);
3413 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3414 PyTuple_SetItem(ret,1,ret_1);
3418 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3420 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3421 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3424 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3426 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3427 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3430 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3432 if(obj && PyList_Check(obj))
3434 int sz=PyList_Size(obj);
3435 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3436 int *pt=da->getPointer();
3437 for(int i=0;i<sz;i++,pt++)
3439 PyObject *elt1=PyList_GetItem(obj,i);
3440 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3442 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3445 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3448 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3450 self->setFieldAtPos(obj,field);
3454 int __len__() const throw(INTERP_KERNEL::Exception)
3456 return self->getNumberOfFields();
3459 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3461 return self->iterator();
3464 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3466 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3467 return self->changeMeshNames(modifTab);
3470 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3472 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3474 throw INTERP_KERNEL::Exception(msg);
3475 if(PyInt_Check(elt0))
3477 return PyInt_AS_LONG(elt0);
3479 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3482 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3484 if(PyList_Check(elts))
3486 int sz=PyList_Size(elts);
3487 std::vector<int> ret(sz);
3488 for(int i=0;i<sz;i++)
3490 PyObject *elt=PyList_GetItem(elts,i);
3491 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3497 std::vector<int> ret(1);
3498 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3503 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3505 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3506 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3507 self->pushFields(tmp);
3510 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3512 if(elts && PySlice_Check(elts))
3514 Py_ssize_t strt=2,stp=2,step=2;
3515 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3516 self->destroyFieldsAtPos2(strt,stp,step);
3520 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3521 if(!idsToRemove.empty())
3522 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3526 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3528 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3529 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3530 return self->extractPart(extractDefCpp,mm);
3535 class MEDFileParameter1TS : public RefCountObject
3538 void setIteration(int it);
3539 int getIteration() const;
3540 void setOrder(int order);
3541 int getOrder() const;
3542 void setTimeValue(double time);
3543 void setTime(int dt, int it, double time);
3544 double getTime(int& dt, int& it);
3545 double getTimeValue() const;
3548 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3551 void setValue(double val) throw(INTERP_KERNEL::Exception);
3552 double getValue() const throw(INTERP_KERNEL::Exception);
3553 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3556 std::string __str__() const throw(INTERP_KERNEL::Exception)
3558 return self->simpleRepr();
3563 class MEDFileParameterTinyInfo : public MEDFileWritable
3566 void setDescription(const std::string& name);
3567 std::string getDescription() const;
3568 void setTimeUnit(const std::string& unit);
3569 std::string getTimeUnit() const;
3572 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3575 static MEDFileParameterDouble1TS *New();
3576 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3577 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3578 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3579 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3580 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3581 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3582 std::string getName() const throw(INTERP_KERNEL::Exception);
3583 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3586 MEDFileParameterDouble1TS()
3588 return MEDFileParameterDouble1TS::New();
3591 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3593 return MEDFileParameterDouble1TS::New(fileName);
3596 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3598 return MEDFileParameterDouble1TS::New(fileName,paramName);
3601 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3603 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3606 std::string __str__() const throw(INTERP_KERNEL::Exception)
3608 return self->simpleRepr();
3611 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3614 bool ret0=self->isEqual(other,eps,what);
3615 PyObject *res=PyList_New(2);
3616 PyObject *ret0Py=ret0?Py_True:Py_False;
3618 PyList_SetItem(res,0,ret0Py);
3619 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3625 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3628 static MEDFileParameterMultiTS *New();
3629 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3630 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3631 std::string getName() const;
3632 void setName(const std::string& name);
3633 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3634 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3635 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3636 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3637 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3638 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3639 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3640 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3643 MEDFileParameterMultiTS()
3645 return MEDFileParameterMultiTS::New();
3648 MEDFileParameterMultiTS(const std::string& fileName)
3650 return MEDFileParameterMultiTS::New(fileName);
3653 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3655 return MEDFileParameterMultiTS::New(fileName,paramName);
3658 std::string __str__() const throw(INTERP_KERNEL::Exception)
3660 return self->simpleRepr();
3663 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3666 bool ret0=self->isEqual(other,eps,what);
3667 PyObject *res=PyList_New(2);
3668 PyObject *ret0Py=ret0?Py_True:Py_False;
3670 PyList_SetItem(res,0,ret0Py);
3671 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3675 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3679 std::vector<int> pos2;
3680 DataArrayInt *pos3=0;
3681 DataArrayIntTuple *pos4=0;
3682 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3687 self->eraseTimeStepIds(&pos1,&pos1+1);
3694 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3699 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3703 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3707 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3709 if(elt0 && PyInt_Check(elt0))
3711 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3714 else if(elt0 && PyTuple_Check(elt0))
3716 if(PyTuple_Size(elt0)==2)
3718 PyObject *o0=PyTuple_GetItem(elt0,0);
3719 PyObject *o1=PyTuple_GetItem(elt0,1);
3720 if(PyInt_Check(o0) && PyInt_Check(o1))
3722 int iter=PyInt_AS_LONG(o0);
3723 int order=PyInt_AS_LONG(o1);
3724 return self->getPosOfTimeStep(iter,order);
3727 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 !");
3730 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 !");
3732 else if(elt0 && PyFloat_Check(elt0))
3734 double val=PyFloat_AS_DOUBLE(elt0);
3735 return self->getPosGivenTime(val);
3738 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3741 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3743 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3749 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3751 if(PyList_Check(elts))
3753 int sz=PyList_Size(elts);
3754 std::vector<int> ret(sz);
3755 for(int i=0;i<sz;i++)
3757 PyObject *elt=PyList_GetItem(elts,i);
3758 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3764 std::vector<int> ret(1);
3765 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3770 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3772 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3773 if(!idsToRemove.empty())
3774 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3777 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3779 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3785 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3787 std::vector< std::pair<int,int> > res=self->getIterations();
3788 PyObject *ret=PyList_New(res.size());
3790 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3792 PyObject *elt=PyTuple_New(2);
3793 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3794 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3795 PyList_SetItem(ret,rk,elt);
3800 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3802 std::vector<double> res2;
3803 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3804 PyObject *ret=PyList_New(res.size());
3806 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3808 PyObject *elt=PyTuple_New(3);
3809 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3810 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3811 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3812 PyList_SetItem(ret,rk,elt);
3819 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3822 static MEDFileParameters *New();
3823 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3824 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3825 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3826 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3827 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3828 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3829 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3830 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3831 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3832 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3833 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3838 return MEDFileParameters::New();
3841 MEDFileParameters(const std::string& fileName)
3843 return MEDFileParameters::New(fileName);
3846 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3848 return MEDFileParameters::New(db);
3852 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3854 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3857 std::string __str__() const throw(INTERP_KERNEL::Exception)
3859 return self->simpleRepr();
3862 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3864 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3865 if(PyInt_Check(obj))
3867 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3872 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
3878 int __len__() const throw(INTERP_KERNEL::Exception)
3880 return self->getNumberOfParams();
3883 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3885 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3891 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3893 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3899 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3902 bool ret0=self->isEqual(other,eps,what);
3903 PyObject *res=PyList_New(2);
3904 PyObject *ret0Py=ret0?Py_True:Py_False;
3906 PyList_SetItem(res,0,ret0Py);
3907 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3913 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3916 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3917 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3918 static MEDFileData *New();
3919 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3920 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3921 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3922 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3923 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3924 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3925 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3927 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3928 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3929 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3930 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3931 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3935 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3937 return MEDFileData::New(fileName);
3940 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3942 return MEDFileData::New(db);
3947 return MEDFileData::New();
3950 std::string __str__() const throw(INTERP_KERNEL::Exception)
3952 return self->simpleRepr();
3955 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3957 MEDFileMeshes *ret=self->getMeshes();
3963 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3965 MEDFileParameters *ret=self->getParams();
3971 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3973 MEDFileFields *ret=self->getFields();
3979 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3981 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3982 return self->changeMeshNames(modifTab);
3985 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3987 std::vector<const MEDFileData *> mfdsCpp;
3988 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3989 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3994 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3996 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
4001 class SauvReader : public RefCountObject
4004 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
4005 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
4008 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
4010 return SauvReader::New(fileName);
4015 class SauvWriter : public RefCountObject
4018 static SauvWriter * New();
4019 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
4020 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
4021 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
4022 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
4025 SauvWriter() throw(INTERP_KERNEL::Exception)
4027 return SauvWriter::New();
4034 class MEDFileMeshStruct;
4036 class MEDFileField1TSStructItem
4039 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
4042 class MEDFileMeshStruct : public RefCountObject
4045 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
4047 ~MEDFileMeshStruct();
4050 class MEDMeshMultiLev : public RefCountObject
4053 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
4054 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
4055 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
4061 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
4063 DataArrayInt *famIds(0);
4064 bool isWithoutCopy(false);
4065 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4066 PyObject *ret=PyTuple_New(2);
4067 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4069 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4070 PyTuple_SetItem(ret,1,ret1Py);
4074 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
4076 DataArrayInt *numIds(0);
4077 bool isWithoutCopy(false);
4078 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4079 PyObject *ret=PyTuple_New(2);
4080 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4082 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4083 PyTuple_SetItem(ret,1,ret1Py);
4087 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
4089 DataArrayInt *famIds(0);
4090 bool isWithoutCopy(false);
4091 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4092 PyObject *ret=PyTuple_New(2);
4093 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4095 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4096 PyTuple_SetItem(ret,1,ret1Py);
4100 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
4102 DataArrayInt *numIds(0);
4103 bool isWithoutCopy(false);
4104 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4105 PyObject *ret=PyTuple_New(2);
4106 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4108 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4109 PyTuple_SetItem(ret,1,ret1Py);
4113 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
4115 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4116 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4117 PyObject *res(PyList_New(result.size()));
4118 for(int i=0;iL!=result.end(); i++, iL++)
4119 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4125 class MEDUMeshMultiLev : public MEDMeshMultiLev
4128 ~MEDUMeshMultiLev();
4132 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4134 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4135 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4136 PyObject *ret0Py=ncc?Py_True:Py_False;
4138 PyObject *ret=PyTuple_New(7);
4139 PyTuple_SetItem(ret,0,ret0Py);
4140 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4141 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4142 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4143 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4144 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4145 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4151 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4154 ~MEDStructuredMeshMultiLev();
4157 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4160 ~MEDCMeshMultiLev();
4164 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4167 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4168 std::size_t sz(objs.size());
4169 PyObject *ret(PyTuple_New(2));
4170 PyObject *ret0=PyList_New(sz);
4171 for(std::size_t i=0;i<sz;i++)
4172 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4173 PyTuple_SetItem(ret,0,ret0);
4174 PyObject *ret1Py(isInternal?Py_True:Py_False);
4176 PyTuple_SetItem(ret,1,ret1Py);
4182 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4185 ~MEDCurveLinearMeshMultiLev();
4189 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4191 DataArrayDouble *ret0(0);
4192 std::vector<int> ret1;
4194 self->buildVTUArrays(ret0,ret1,ret2);
4195 std::size_t sz(ret1.size());
4196 PyObject *ret=PyTuple_New(3);
4197 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4198 PyObject *ret1Py=PyList_New(sz);
4199 for(std::size_t i=0;i<sz;i++)
4200 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4201 PyTuple_SetItem(ret,1,ret1Py);
4202 PyObject *ret2Py(ret2?Py_True:Py_False);
4204 PyTuple_SetItem(ret,2,ret2Py);
4210 class MEDFileFastCellSupportComparator : public RefCountObject
4213 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4214 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4215 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4216 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4218 ~MEDFileFastCellSupportComparator();
4222 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4224 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4225 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4226 PyObject *res(PyList_New(result.size()));
4227 for(int i=0;iL!=result.end(); i++, iL++)
4228 PyList_SetItem(res,i,PyInt_FromLong(*iL));