1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileEntities.hxx"
41 #include "MEDFileMeshReadSelector.hxx"
42 #include "MEDFileFieldOverView.hxx"
43 #include "MEDLoaderTypemaps.i"
44 #include "SauvReader.hxx"
45 #include "SauvWriter.hxx"
47 using namespace MEDCoupling;
50 #if SWIG_VERSION >= 0x010329
51 %template() std::vector<std::string>;
54 %typemap(out) MEDCoupling::MEDFileMesh*
56 $result=convertMEDFileMesh($1,$owner);
59 %typemap(out) MEDCoupling::MEDFileParameter1TS*
61 $result=convertMEDFileParameter1TS($1,$owner);
64 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
66 $result=convertMEDFileFieldMultiTS($1,$owner);
69 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
71 $result=convertMEDFileField1TS($1,$owner);
74 %typemap(out) MEDCoupling::MEDMeshMultiLev*
76 $result=convertMEDMeshMultiLev($1,$owner);
79 %newobject ReadUMeshFromFamiliesSwig;
80 %newobject ReadUMeshFromGroupsSwig;
81 %newobject ReadFieldSwig;
82 %newobject MEDCoupling::ReadUMeshFromFile;
83 %newobject MEDCoupling::ReadMeshFromFile;
84 %newobject MEDCoupling::ReadFieldCell;
85 %newobject MEDCoupling::ReadFieldNode;
86 %newobject MEDCoupling::ReadFieldGauss;
87 %newobject MEDCoupling::ReadFieldGaussNE;
88 %newobject MEDCoupling::MEDFileMesh::New;
89 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
90 %newobject MEDCoupling::MEDFileMesh::deepCopy;
91 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
92 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
93 %newobject MEDCoupling::MEDFileMesh::__getitem__;
94 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
95 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
97 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
101 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
102 %newobject MEDCoupling::MEDFileMesh::getGlobalNumFieldAtLevel;
103 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
104 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
105 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
106 %newobject MEDCoupling::MEDFileMesh::cartesianize;
107 %newobject MEDCoupling::MEDFileData::getJoints;
108 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
109 %newobject MEDCoupling::MEDFileUMesh::New;
110 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
111 %newobject MEDCoupling::MEDFileUMesh::getCoords;
112 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
113 %newobject MEDCoupling::MEDFileUMesh::getGroup;
114 %newobject MEDCoupling::MEDFileUMesh::getGroups;
115 %newobject MEDCoupling::MEDFileUMesh::getFamily;
116 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
117 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
120 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
121 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
122 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
123 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
124 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
125 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
126 %newobject MEDCoupling::MEDFileUMesh::extractPart;
127 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
128 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
129 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
130 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
131 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
132 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
133 %newobject MEDCoupling::MEDFileCMesh::New;
134 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
136 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
137 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
138 %newobject MEDCoupling::MEDFileMeshes::New;
139 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
140 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
141 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
142 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
143 %newobject MEDCoupling::MEDFileMeshes::__iter__;
145 %newobject MEDCoupling::MEDFileMeshSupports::New;
146 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
148 %newobject MEDCoupling::MEDFileStructureElements::New;
150 %newobject MEDCoupling::MEDFileFields::New;
151 %newobject MEDCoupling::MEDFileFields::NewAdv;
152 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
153 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
154 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
155 %newobject MEDCoupling::MEDFileFields::deepCopy;
156 %newobject MEDCoupling::MEDFileFields::shallowCpy;
157 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
158 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
159 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
160 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
161 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
162 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
163 %newobject MEDCoupling::MEDFileFields::__iter__;
164 %newobject MEDCoupling::MEDFileFields::extractPart;
166 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
173 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
174 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
175 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
182 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
183 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
184 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
191 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
192 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
193 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
194 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
196 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
197 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
198 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
199 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
200 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
201 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
202 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
203 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
204 %newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
206 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
207 %newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
208 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
209 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
210 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
211 %newobject MEDCoupling::MEDFileField1TS::New;
212 %newobject MEDCoupling::MEDFileField1TS::field;
213 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
214 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
215 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
216 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
217 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
218 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
220 %newobject MEDCoupling::MEDFileIntField1TS::New;
221 %newobject MEDCoupling::MEDFileIntField1TS::field;
222 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
223 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
224 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
225 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
226 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
227 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
229 %newobject MEDCoupling::MEDFileFloatField1TS::New;
230 %newobject MEDCoupling::MEDFileFloatField1TS::field;
231 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
232 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
233 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
234 %newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
235 %newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
236 %newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
238 %newobject MEDCoupling::MEDFileData::New;
239 %newobject MEDCoupling::MEDFileData::deepCopy;
240 %newobject MEDCoupling::MEDFileData::getMeshes;
241 %newobject MEDCoupling::MEDFileData::getFields;
242 %newobject MEDCoupling::MEDFileData::getParams;
243 %newobject MEDCoupling::MEDFileData::Aggregate;
245 %newobject MEDCoupling::MEDFileEntities::BuildFrom;
247 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
248 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
249 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
250 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
251 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
252 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
253 %newobject MEDCoupling::MEDFileParameters::New;
254 %newobject MEDCoupling::MEDFileParameters::deepCopy;
255 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
256 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
257 %newobject MEDCoupling::MEDFileParameters::__getitem__;
259 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
260 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
261 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
262 %newobject MEDCoupling::MEDFileJointCorrespondence::getCorrespondence;
263 %newobject MEDCoupling::MEDFileJointOneStep::New;
264 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
265 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
266 %newobject MEDCoupling::MEDFileJointOneStep::getCorrespondenceAtPos;
267 %newobject MEDCoupling::MEDFileJointOneStep::__getitem__;
268 %newobject MEDCoupling::MEDFileJoint::New;
269 %newobject MEDCoupling::MEDFileJoint::deepCopy;
270 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
271 %newobject MEDCoupling::MEDFileJoint::getStepAtPos;
272 %newobject MEDCoupling::MEDFileJoint::__getitem__;
273 %newobject MEDCoupling::MEDFileJoints::New;
274 %newobject MEDCoupling::MEDFileJoints::deepCopy;
275 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
276 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
277 %newobject MEDCoupling::MEDFileJoints::__getitem__;
278 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
279 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
280 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
281 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
282 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
283 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
284 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
285 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
286 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
288 %newobject MEDCoupling::SauvWriter::New;
289 %newobject MEDCoupling::SauvReader::New;
290 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
292 %newobject MEDCoupling::MEDFileMeshStruct::New;
293 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
294 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
295 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
296 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
297 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
299 %feature("unref") MEDFileMesh "$this->decrRef();"
300 %feature("unref") MEDFileUMesh "$this->decrRef();"
301 %feature("unref") MEDFileCMesh "$this->decrRef();"
302 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
303 %feature("unref") MEDFileMeshes "$this->decrRef();"
304 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
305 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
306 %feature("unref") MEDFileField1TS "$this->decrRef();"
307 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
308 %feature("unref") MEDFileFloatField1TS "$this->decrRef();"
309 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
310 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
311 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
312 %feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
313 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
314 %feature("unref") MEDFileStructureElements "$this->decrRef();"
315 %feature("unref") MEDFileFields "$this->decrRef();"
316 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
317 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
318 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
319 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
320 %feature("unref") MEDFileParameters "$this->decrRef();"
321 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
322 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
323 %feature("unref") MEDFileJoint "$this->decrRef();"
324 %feature("unref") MEDFileJoints "$this->decrRef();"
325 %feature("unref") MEDFileEquivalences "$this->decrRef();"
326 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
327 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
328 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
329 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
330 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
331 %feature("unref") MEDFileData "$this->decrRef();"
332 %feature("unref") SauvReader "$this->decrRef();"
333 %feature("unref") SauvWriter "$this->decrRef();"
334 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
335 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
336 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
337 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
338 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
339 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
341 namespace MEDCoupling
344 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
345 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
346 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
347 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
348 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
349 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
350 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
351 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
352 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
353 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
354 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
355 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
356 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
357 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
358 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
359 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
360 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
361 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
362 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
363 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
364 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
365 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
366 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
367 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
368 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
369 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
370 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
371 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
372 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
373 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
374 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
375 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
376 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
377 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f) throw(INTERP_KERNEL::Exception);
380 %rename (MEDFileVersion) MEDFileVersionSwig;
381 %rename (GetFieldIterations) GetFieldIterationsSwig;
382 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
383 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
384 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
385 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
386 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
387 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
388 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
389 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
390 %rename (WriteUMeshes) WriteUMeshesSwig;
391 %rename (GetTypesOfField) GetTypesOfFieldSwig;
392 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
393 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
394 %rename (ReadField) ReadFieldSwig;
398 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
400 int major,minor,release;
401 MEDCoupling::MEDFileVersion(major,minor,release);
402 PyObject *ret(PyTuple_New(3));
403 PyTuple_SetItem(ret,0,SWIG_From_int(major));
404 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
405 PyTuple_SetItem(ret,2,SWIG_From_int(release));
409 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
411 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName));
415 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
417 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName));
421 MEDCoupling::MEDCouplingField *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
423 MCAuto<MEDCoupling::MEDCouplingField> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
427 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
429 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
433 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
435 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
436 PyObject *ret=PyList_New(res.size());
438 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
440 PyObject *elt=PyTuple_New(2);
441 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
442 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
443 PyList_SetItem(ret,rk,elt);
448 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
450 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
451 PyObject *ret=PyList_New(res.size());
453 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
455 PyObject *elt=PyTuple_New(3);
456 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
457 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
458 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
459 PyList_SetItem(ret,rk,elt);
464 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
466 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
467 PyObject *ret=PyList_New(res.size());
469 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
471 PyObject *elt=PyTuple_New(2);
472 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
473 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
474 PyList_SetItem(ret,rk,elt);
479 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
481 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
482 PyObject *ret=PyList_New(res.size());
484 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
486 PyObject *elt=PyTuple_New(2);
487 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
488 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
489 PyList_SetItem(ret,rk,elt);
494 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
496 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
497 PyObject *ret=PyList_New(res.size());
499 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
501 PyObject *elt=PyTuple_New(2);
502 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
503 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
504 PyList_SetItem(ret,rk,elt);
509 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
511 int meshDim,spaceDim,numberOfNodes;
512 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
513 PyObject *ret=PyTuple_New(4);
514 PyObject *elt0=PyList_New(res.size());
516 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
518 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
520 PyObject *elt1=PyList_New(obj2.size());
521 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
523 PyObject *elt2=PyTuple_New(2);
524 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
525 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
526 PyList_SetItem(elt1,j,elt2);
528 PyList_SetItem(elt0,i,elt1);
530 PyTuple_SetItem(ret,0,elt0);
531 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
532 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
533 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
537 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
538 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
540 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
541 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
542 return convertFieldDoubleVecToPy(res);
545 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
547 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
548 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
549 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
552 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
554 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
555 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
556 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
559 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
561 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
562 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
563 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
566 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
568 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
570 PyObject *ret=PyList_New(size);
571 for(int i=0;i<size;i++)
572 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
576 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
578 std::vector<std::string> grps;
579 converPyListToVecString(li,grps);
580 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
583 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
585 std::vector<std::string> fams;
586 converPyListToVecString(li,fams);
587 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
591 namespace MEDCoupling
593 class MEDFileWritable
596 void copyOptionsFrom(const MEDFileWritable& other) const;
597 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
598 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
599 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
600 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
603 class MEDFileWritableStandAlone : public MEDFileWritable
606 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
607 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
610 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
612 MCAuto<DataArrayByte> ret(self->serialize());
616 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
618 PyObject *ret(PyList_New(0));
622 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
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 return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
2338 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2340 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2341 std::vector< std::vector<TypeOfField> > typesF;
2342 std::vector< std::vector<std::string> > pfls;
2343 std::vector< std::vector<std::string> > locs;
2344 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2346 PyObject *ret2=PyList_New(sz);
2347 for(int i=0;i<sz;i++)
2349 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2350 const std::vector<TypeOfField>& typesFI=typesF[i];
2351 const std::vector<std::string>& pflsI=pfls[i];
2352 const std::vector<std::string>& locsI=locs[i];
2353 PyObject *elt=PyTuple_New(2);
2354 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2355 int sz2=ret[i].size();
2356 PyObject *elt2=PyList_New(sz2);
2357 for(int j=0;j<sz2;j++)
2359 PyObject *elt3=PyTuple_New(4);
2360 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2361 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2362 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2363 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2364 PyList_SetItem(elt2,j,elt3);
2366 PyTuple_SetItem(elt,1,elt2);
2367 PyList_SetItem(ret2,i,elt);
2372 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2374 DataArrayDouble *ret=self->getUndergroundDataArray();
2380 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2382 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2383 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2386 PyObject *ret=PyTuple_New(2);
2387 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2388 std::size_t sz=elt1Cpp.size();
2389 PyObject *elt=PyList_New(sz);
2390 for(std::size_t i=0;i<sz;i++)
2392 PyObject *elt1=PyTuple_New(2);
2393 PyObject *elt2=PyTuple_New(2);
2394 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2395 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2396 PyObject *elt3=PyTuple_New(2);
2397 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2398 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2399 PyTuple_SetItem(elt1,0,elt2);
2400 PyTuple_SetItem(elt1,1,elt3);
2401 PyList_SetItem(elt,i,elt1);
2403 PyTuple_SetItem(ret,1,elt);
2409 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2412 static MEDFileIntField1TS *New();
2413 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2414 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2415 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2416 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2417 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2419 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2420 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2421 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2422 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2423 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2424 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2425 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2426 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2429 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2431 return MEDFileIntField1TS::New();
2434 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2436 return MEDFileIntField1TS::New(fileName,loadAll);
2439 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2441 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2444 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2446 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2449 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2451 return MEDFileIntField1TS::New(db);
2455 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2457 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2460 std::string __str__() const throw(INTERP_KERNEL::Exception)
2462 return self->simpleRepr();
2465 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2467 return MEDFileField1TS_getFieldWithProfile<int>(self,type,meshDimRelToMax,mesh);
2470 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2472 DataArrayInt *ret=self->getUndergroundDataArray();
2480 class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
2483 static MEDFileFloatField1TS *New();
2484 static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2485 static MEDFileFloatField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2486 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2487 static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2488 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2490 void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
2491 void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2492 MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2493 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2494 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2495 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2496 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2497 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2500 MEDFileFloatField1TS() throw(INTERP_KERNEL::Exception)
2502 return MEDFileFloatField1TS::New();
2505 MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2507 return MEDFileFloatField1TS::New(fileName,loadAll);
2510 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2512 return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
2515 MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2517 return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
2520 MEDFileFloatField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2522 return MEDFileFloatField1TS::New(db);
2526 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2528 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatField1TS");
2531 std::string __str__() const throw(INTERP_KERNEL::Exception)
2533 return self->simpleRepr();
2536 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2538 return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
2541 DataArrayFloat *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2543 DataArrayFloat *ret=self->getUndergroundDataArray();
2551 class MEDFileAnyTypeFieldMultiTSIterator
2556 PyObject *next() throw(INTERP_KERNEL::Exception)
2558 MEDFileAnyTypeField1TS *ret=self->nextt();
2560 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2563 PyErr_SetString(PyExc_StopIteration,"No more data.");
2570 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2573 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2574 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2575 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2576 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2577 std::string getName() const throw(INTERP_KERNEL::Exception);
2578 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2579 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2580 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2581 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2582 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2583 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2584 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2585 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2586 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2587 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2588 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2589 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2590 void loadArrays() throw(INTERP_KERNEL::Exception);
2591 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2592 void unloadArrays() throw(INTERP_KERNEL::Exception);
2593 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2595 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2596 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2597 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2598 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2599 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2600 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2603 int __len__() const throw(INTERP_KERNEL::Exception)
2605 return self->getNumberOfTS();
2608 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2610 if(elt0 && PyInt_Check(elt0))
2612 int pos=PyInt_AS_LONG(elt0);
2615 else if(elt0 && PyTuple_Check(elt0))
2617 if(PyTuple_Size(elt0)==2)
2619 PyObject *o0=PyTuple_GetItem(elt0,0);
2620 PyObject *o1=PyTuple_GetItem(elt0,1);
2621 if(PyInt_Check(o0) && PyInt_Check(o1))
2623 int iter=PyInt_AS_LONG(o0);
2624 int order=PyInt_AS_LONG(o1);
2625 return self->getPosOfTimeStep(iter,order);
2628 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 !");
2631 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 !");
2633 else if(elt0 && PyFloat_Check(elt0))
2635 double val=PyFloat_AS_DOUBLE(elt0);
2636 return self->getPosGivenTime(val);
2639 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2642 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2644 std::vector< std::pair<int,int> > res(self->getIterations());
2645 return convertVecPairIntToPy(res);
2648 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2650 std::vector<double> ret1;
2651 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2652 std::size_t sz=ret.size();
2653 PyObject *ret2=PyList_New(sz);
2654 for(std::size_t i=0;i<sz;i++)
2656 PyObject *elt=PyTuple_New(3);
2657 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2658 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2659 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2660 PyList_SetItem(ret2,i,elt);
2665 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2667 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2668 PyObject *ret2=PyList_New(ret.size());
2669 for(int i=0;i<(int)ret.size();i++)
2671 const std::vector<TypeOfField>& rett=ret[i];
2672 PyObject *ret3=PyList_New(rett.size());
2673 for(int j=0;j<(int)rett.size();j++)
2674 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2675 PyList_SetItem(ret2,i,ret3);
2680 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2682 std::vector<int> ret1;
2683 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2684 PyObject *elt=PyTuple_New(2);
2685 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2686 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2690 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2692 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2693 std::vector< std::vector<TypeOfField> > typesF;
2694 std::vector< std::vector<std::string> > pfls;
2695 std::vector< std::vector<std::string> > locs;
2696 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2698 PyObject *ret2=PyList_New(sz);
2699 for(int i=0;i<sz;i++)
2701 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2702 const std::vector<TypeOfField>& typesFI=typesF[i];
2703 const std::vector<std::string>& pflsI=pfls[i];
2704 const std::vector<std::string>& locsI=locs[i];
2705 PyObject *elt=PyTuple_New(2);
2706 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2707 int sz2=ret[i].size();
2708 PyObject *elt2=PyList_New(sz2);
2709 for(int j=0;j<sz2;j++)
2711 PyObject *elt3=PyTuple_New(4);
2712 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2713 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));
2714 PyTuple_SetItem(elt3,1,elt4);
2715 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2716 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2717 PyList_SetItem(elt2,j,elt3);
2719 PyTuple_SetItem(elt,1,elt2);
2720 PyList_SetItem(ret2,i,elt);
2725 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2727 if(PyList_Check(elts))
2729 int sz=PyList_Size(elts);
2730 std::vector<int> ret(sz);
2731 for(int i=0;i<sz;i++)
2733 PyObject *elt=PyList_GetItem(elts,i);
2734 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2740 std::vector<int> ret(1);
2741 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2746 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2748 if(PySlice_Check(elts))
2750 Py_ssize_t strt=2,stp=2,step=2;
2751 GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2752 self->eraseTimeStepIds2(strt,stp,step);
2756 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2757 if(!idsToRemove.empty())
2758 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2762 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2766 std::vector<int> pos2;
2767 DataArrayInt *pos3=0;
2768 DataArrayIntTuple *pos4=0;
2769 convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2774 self->eraseTimeStepIds(&pos1,&pos1+1);
2781 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2786 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2790 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2794 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2796 return self->iterator();
2799 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2801 if(elt0 && PyList_Check(elt0))
2803 int sz=PyList_Size(elt0);
2804 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2805 int *pt=da->getPointer();
2806 for(int i=0;i<sz;i++,pt++)
2808 PyObject *elt1=PyList_GetItem(elt0,i);
2809 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2811 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2813 else if(elt0 && PySlice_Check(elt0))
2815 Py_ssize_t strt=2,stp=2,step=2;
2816 GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2817 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2820 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2823 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2825 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2826 return self->changeMeshNames(modifTab);
2829 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2831 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2832 std::size_t sz=ret.size();
2833 PyObject *retPy=PyList_New(sz);
2834 for(std::size_t i=0;i<sz;i++)
2835 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2839 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2841 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2842 std::size_t sz=ret.size();
2843 PyObject *retPy=PyList_New(sz);
2844 for(std::size_t i=0;i<sz;i++)
2845 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2849 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2851 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2852 std::size_t sz=ret.size();
2853 PyObject *retPy=PyList_New(sz);
2854 for(std::size_t i=0;i<sz;i++)
2855 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2859 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2862 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2863 if(SWIG_IsOK(status))
2865 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2869 std::vector<MEDFileAnyTypeField1TS *> tmp;
2870 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2871 self->pushBackTimeSteps(tmp);
2875 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2877 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2878 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2879 return self->extractPart(extractDefCpp,mm);
2882 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2884 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2885 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2886 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2887 std::size_t sz=ret.size();
2888 PyObject *retPy=PyList_New(sz);
2889 for(std::size_t i=0;i<sz;i++)
2891 std::size_t sz2=ret[i].size();
2892 PyObject *ret1Py=PyList_New(sz2);
2893 for(std::size_t j=0;j<sz2;j++)
2895 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2898 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2900 PyList_SetItem(retPy,i,ret1Py);
2905 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2907 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2908 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2909 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2910 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2911 if(ret2.size()!=ret.size())
2913 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2914 throw INTERP_KERNEL::Exception(oss.str().c_str());
2916 std::size_t sz=ret.size();
2917 PyObject *retPy=PyList_New(sz);
2918 for(std::size_t i=0;i<sz;i++)
2920 std::size_t sz2=ret[i].size();
2921 PyObject *ret0Py=PyTuple_New(2);
2922 PyObject *ret1Py=PyList_New(sz2);
2923 for(std::size_t j=0;j<sz2;j++)
2925 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2928 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2930 PyTuple_SetItem(ret0Py,0,ret1Py);
2931 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2932 PyList_SetItem(retPy,i,ret0Py);
2939 class MEDFileIntFieldMultiTS;
2941 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2944 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2945 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2946 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2947 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2949 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2950 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2951 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2952 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2953 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2954 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2956 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2957 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2958 MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2961 MEDFileFieldMultiTS()
2963 return MEDFileFieldMultiTS::New();
2966 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2968 return MEDFileFieldMultiTS::New(fileName,loadAll);
2971 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2973 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2976 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2978 return MEDFileFieldMultiTS::New(db);
2982 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2984 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2987 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2989 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2990 std::size_t sz(tmp.size());
2991 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2992 for(std::size_t i=0;i<sz;i++)
2994 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2995 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2997 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3000 std::string __str__() const throw(INTERP_KERNEL::Exception)
3002 return self->simpleRepr();
3005 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3007 DataArrayInt *ret1=0;
3008 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3009 PyObject *ret=PyTuple_New(2);
3010 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3011 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3015 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
3017 std::vector<INTERP_KERNEL::NormalizedCellType> types;
3018 std::vector< std::vector<TypeOfField> > typesF;
3019 std::vector< std::vector<std::string> > pfls;
3020 std::vector< std::vector<std::string> > locs;
3021 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
3023 PyObject *ret2=PyList_New(sz);
3024 for(int i=0;i<sz;i++)
3026 const std::vector<DataArrayDouble *>& dadsI=ret[i];
3027 const std::vector<TypeOfField>& typesFI=typesF[i];
3028 const std::vector<std::string>& pflsI=pfls[i];
3029 const std::vector<std::string>& locsI=locs[i];
3030 PyObject *elt=PyTuple_New(2);
3031 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
3032 int sz2=ret[i].size();
3033 PyObject *elt2=PyList_New(sz2);
3034 for(int j=0;j<sz2;j++)
3036 PyObject *elt3=PyTuple_New(4);
3037 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
3038 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3039 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
3040 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
3041 PyList_SetItem(elt2,j,elt3);
3043 PyTuple_SetItem(elt,1,elt2);
3044 PyList_SetItem(ret2,i,elt);
3048 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3050 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
3056 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3058 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
3059 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
3062 PyObject *ret=PyTuple_New(2);
3063 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3064 std::size_t sz=elt1Cpp.size();
3065 PyObject *elt=PyList_New(sz);
3066 for(std::size_t i=0;i<sz;i++)
3068 PyObject *elt1=PyTuple_New(2);
3069 PyObject *elt2=PyTuple_New(2);
3070 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
3071 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
3072 PyObject *elt3=PyTuple_New(2);
3073 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
3074 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
3075 PyTuple_SetItem(elt1,0,elt2);
3076 PyTuple_SetItem(elt1,1,elt3);
3077 PyList_SetItem(elt,i,elt1);
3079 PyTuple_SetItem(ret,1,elt);
3085 class MEDFileFieldsIterator
3090 PyObject *next() throw(INTERP_KERNEL::Exception)
3092 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
3094 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
3097 PyErr_SetString(PyExc_StopIteration,"No more data.");
3104 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3107 static MEDFileIntFieldMultiTS *New();
3108 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3109 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3110 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3112 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
3113 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3114 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3115 MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3116 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3117 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3118 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3119 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3120 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3123 MEDFileIntFieldMultiTS()
3125 return MEDFileIntFieldMultiTS::New();
3128 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3130 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
3133 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3135 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
3138 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3140 return MEDFileIntFieldMultiTS::New(db);
3144 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3146 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
3149 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3151 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3152 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3153 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3156 std::string __str__() const throw(INTERP_KERNEL::Exception)
3158 return self->simpleRepr();
3161 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3163 DataArrayInt *ret1=0;
3164 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3165 PyObject *ret=PyTuple_New(2);
3166 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3167 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3171 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3173 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3181 class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
3184 static MEDFileFloatFieldMultiTS *New();
3185 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3186 static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3187 static MEDFileFloatFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3189 void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
3190 void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
3191 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
3192 MEDCouplingFieldFloat *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
3193 MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3194 MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3195 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3196 MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3197 MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
3200 MEDFileFloatFieldMultiTS()
3202 return MEDFileFloatFieldMultiTS::New();
3205 MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3207 return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
3210 MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3212 return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
3215 MEDFileFloatFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3217 return MEDFileFloatFieldMultiTS::New(db);
3221 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3223 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatFieldMultiTS");
3226 static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
3228 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3229 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
3230 return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3233 std::string __str__() const throw(INTERP_KERNEL::Exception)
3235 return self->simpleRepr();
3238 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3240 DataArrayInt *ret1=0;
3241 DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3242 PyObject *ret=PyTuple_New(2);
3243 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
3244 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3248 DataArrayFloat *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3250 DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
3258 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3261 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3262 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3265 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3267 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3268 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3276 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3279 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3281 MEDFileStructureElements();
3284 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3287 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3288 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3289 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3290 static MEDFileFields *NewAdv(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception);
3291 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3292 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3293 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3294 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3295 void loadArrays() throw(INTERP_KERNEL::Exception);
3296 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3297 void unloadArrays() throw(INTERP_KERNEL::Exception);
3298 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3299 int getNumberOfFields() const;
3300 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3301 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3303 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3304 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3305 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3306 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3307 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3308 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3309 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3310 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3311 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3312 void killStructureElements() throw(INTERP_KERNEL::Exception);
3313 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3314 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3315 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3316 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3317 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3322 return MEDFileFields::New();
3325 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3327 return MEDFileFields::New(fileName,loadAll);
3330 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3332 return MEDFileFields::New(db);
3335 MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileEntities *entities) throw(INTERP_KERNEL::Exception)
3337 return MEDFileFields::NewAdv(fileName,loadAll,entities);
3341 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3343 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3346 std::string __str__() const throw(INTERP_KERNEL::Exception)
3348 return self->simpleRepr();
3351 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3353 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3357 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3359 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3363 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3365 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3366 std::size_t sz(tmp.size());
3367 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3368 for(std::size_t i=0;i<sz;i++)
3370 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3371 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3373 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3376 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3378 std::vector< std::pair<std::string,std::string> > ps;
3379 self->getMeshSENames(ps);
3380 return convertVectPairStToPy(ps);
3383 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3386 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3387 PyObject *ret=PyTuple_New(2);
3388 PyObject *ret_0=PyList_New(ret0.size());
3390 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3392 PyObject *elt=PyTuple_New(2);
3393 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3394 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3395 PyList_SetItem(ret_0,rk,elt);
3397 PyTuple_SetItem(ret,0,ret_0);
3398 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3399 PyTuple_SetItem(ret,1,ret_1);
3403 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3405 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3406 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3409 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3411 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3412 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3415 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3417 if(obj && PyList_Check(obj))
3419 int sz=PyList_Size(obj);
3420 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3421 int *pt=da->getPointer();
3422 for(int i=0;i<sz;i++,pt++)
3424 PyObject *elt1=PyList_GetItem(obj,i);
3425 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3427 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3430 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3433 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3435 self->setFieldAtPos(obj,field);
3439 int __len__() const throw(INTERP_KERNEL::Exception)
3441 return self->getNumberOfFields();
3444 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3446 return self->iterator();
3449 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3451 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3452 return self->changeMeshNames(modifTab);
3455 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3457 static const char msg[]="MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !";
3459 throw INTERP_KERNEL::Exception(msg);
3460 if(PyInt_Check(elt0))
3462 return PyInt_AS_LONG(elt0);
3464 return self->getPosFromFieldName(convertPyObjectToStr(elt0,msg));
3467 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3469 if(PyList_Check(elts))
3471 int sz=PyList_Size(elts);
3472 std::vector<int> ret(sz);
3473 for(int i=0;i<sz;i++)
3475 PyObject *elt=PyList_GetItem(elts,i);
3476 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3482 std::vector<int> ret(1);
3483 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3488 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3490 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3491 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3492 self->pushFields(tmp);
3495 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3497 if(elts && PySlice_Check(elts))
3499 Py_ssize_t strt=2,stp=2,step=2;
3500 GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3501 self->destroyFieldsAtPos2(strt,stp,step);
3505 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3506 if(!idsToRemove.empty())
3507 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3511 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3513 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3514 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3515 return self->extractPart(extractDefCpp,mm);
3520 class MEDFileParameter1TS : public RefCountObject
3523 void setIteration(int it);
3524 int getIteration() const;
3525 void setOrder(int order);
3526 int getOrder() const;
3527 void setTimeValue(double time);
3528 void setTime(int dt, int it, double time);
3529 double getTime(int& dt, int& it);
3530 double getTimeValue() const;
3533 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3536 void setValue(double val) throw(INTERP_KERNEL::Exception);
3537 double getValue() const throw(INTERP_KERNEL::Exception);
3538 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3541 std::string __str__() const throw(INTERP_KERNEL::Exception)
3543 return self->simpleRepr();
3548 class MEDFileParameterTinyInfo : public MEDFileWritable
3551 void setDescription(const std::string& name);
3552 std::string getDescription() const;
3553 void setTimeUnit(const std::string& unit);
3554 std::string getTimeUnit() const;
3557 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3560 static MEDFileParameterDouble1TS *New();
3561 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3562 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3563 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3564 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3565 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3566 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3567 std::string getName() const throw(INTERP_KERNEL::Exception);
3568 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3571 MEDFileParameterDouble1TS()
3573 return MEDFileParameterDouble1TS::New();
3576 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3578 return MEDFileParameterDouble1TS::New(fileName);
3581 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3583 return MEDFileParameterDouble1TS::New(fileName,paramName);
3586 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3588 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3591 std::string __str__() const throw(INTERP_KERNEL::Exception)
3593 return self->simpleRepr();
3596 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3599 bool ret0=self->isEqual(other,eps,what);
3600 PyObject *res=PyList_New(2);
3601 PyObject *ret0Py=ret0?Py_True:Py_False;
3603 PyList_SetItem(res,0,ret0Py);
3604 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3610 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3613 static MEDFileParameterMultiTS *New();
3614 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3615 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3616 std::string getName() const;
3617 void setName(const std::string& name);
3618 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3619 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3620 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3621 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3622 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3623 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3624 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3625 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3628 MEDFileParameterMultiTS()
3630 return MEDFileParameterMultiTS::New();
3633 MEDFileParameterMultiTS(const std::string& fileName)
3635 return MEDFileParameterMultiTS::New(fileName);
3638 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3640 return MEDFileParameterMultiTS::New(fileName,paramName);
3643 std::string __str__() const throw(INTERP_KERNEL::Exception)
3645 return self->simpleRepr();
3648 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3651 bool ret0=self->isEqual(other,eps,what);
3652 PyObject *res=PyList_New(2);
3653 PyObject *ret0Py=ret0?Py_True:Py_False;
3655 PyList_SetItem(res,0,ret0Py);
3656 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3660 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3664 std::vector<int> pos2;
3665 DataArrayInt *pos3=0;
3666 DataArrayIntTuple *pos4=0;
3667 convertIntStarLikePyObjToCpp(ids,sw,pos1,pos2,pos3,pos4);
3672 self->eraseTimeStepIds(&pos1,&pos1+1);
3679 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3684 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3688 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3692 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3694 if(elt0 && PyInt_Check(elt0))
3696 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3699 else if(elt0 && PyTuple_Check(elt0))
3701 if(PyTuple_Size(elt0)==2)
3703 PyObject *o0=PyTuple_GetItem(elt0,0);
3704 PyObject *o1=PyTuple_GetItem(elt0,1);
3705 if(PyInt_Check(o0) && PyInt_Check(o1))
3707 int iter=PyInt_AS_LONG(o0);
3708 int order=PyInt_AS_LONG(o1);
3709 return self->getPosOfTimeStep(iter,order);
3712 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 !");
3715 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 !");
3717 else if(elt0 && PyFloat_Check(elt0))
3719 double val=PyFloat_AS_DOUBLE(elt0);
3720 return self->getPosGivenTime(val);
3723 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3726 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3728 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3734 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3736 if(PyList_Check(elts))
3738 int sz=PyList_Size(elts);
3739 std::vector<int> ret(sz);
3740 for(int i=0;i<sz;i++)
3742 PyObject *elt=PyList_GetItem(elts,i);
3743 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3749 std::vector<int> ret(1);
3750 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3755 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3757 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3758 if(!idsToRemove.empty())
3759 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3762 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3764 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3770 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3772 std::vector< std::pair<int,int> > res=self->getIterations();
3773 PyObject *ret=PyList_New(res.size());
3775 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3777 PyObject *elt=PyTuple_New(2);
3778 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3779 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3780 PyList_SetItem(ret,rk,elt);
3785 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3787 std::vector<double> res2;
3788 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3789 PyObject *ret=PyList_New(res.size());
3791 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3793 PyObject *elt=PyTuple_New(3);
3794 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3795 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3796 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3797 PyList_SetItem(ret,rk,elt);
3804 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3807 static MEDFileParameters *New();
3808 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3809 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3810 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3811 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3812 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3813 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3814 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3815 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3816 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3817 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3818 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3823 return MEDFileParameters::New();
3826 MEDFileParameters(const std::string& fileName)
3828 return MEDFileParameters::New(fileName);
3831 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3833 return MEDFileParameters::New(db);
3837 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3839 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3842 std::string __str__() const throw(INTERP_KERNEL::Exception)
3844 return self->simpleRepr();
3847 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3849 static const char msg[]="MEDFileParameters::__getitem__ : only integer or string with meshname supported !";
3850 if(PyInt_Check(obj))
3852 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3857 MEDFileParameterMultiTS *ret(self->getParamWithName(convertPyObjectToStr(obj,msg)));
3863 int __len__() const throw(INTERP_KERNEL::Exception)
3865 return self->getNumberOfParams();
3868 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3870 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3876 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3878 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3884 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3887 bool ret0=self->isEqual(other,eps,what);
3888 PyObject *res=PyList_New(2);
3889 PyObject *ret0Py=ret0?Py_True:Py_False;
3891 PyList_SetItem(res,0,ret0Py);
3892 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3898 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3901 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3902 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3903 static MEDFileData *New();
3904 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3905 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3906 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3907 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3908 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3909 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3910 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3912 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3913 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3914 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3915 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3916 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3920 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3922 return MEDFileData::New(fileName);
3925 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3927 return MEDFileData::New(db);
3932 return MEDFileData::New();
3935 std::string __str__() const throw(INTERP_KERNEL::Exception)
3937 return self->simpleRepr();
3940 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3942 MEDFileMeshes *ret=self->getMeshes();
3948 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3950 MEDFileParameters *ret=self->getParams();
3956 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3958 MEDFileFields *ret=self->getFields();
3964 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3966 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3967 return self->changeMeshNames(modifTab);
3970 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3972 std::vector<const MEDFileData *> mfdsCpp;
3973 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3974 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3979 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3981 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3986 class SauvReader : public RefCountObject
3989 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3990 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3993 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3995 return SauvReader::New(fileName);
4000 class SauvWriter : public RefCountObject
4003 static SauvWriter * New();
4004 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
4005 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
4006 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
4007 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
4010 SauvWriter() throw(INTERP_KERNEL::Exception)
4012 return SauvWriter::New();
4019 class MEDFileMeshStruct;
4021 class MEDFileField1TSStructItem
4024 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
4027 class MEDFileMeshStruct : public RefCountObject
4030 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
4032 ~MEDFileMeshStruct();
4035 class MEDMeshMultiLev : public RefCountObject
4038 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
4039 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
4040 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
4046 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
4048 DataArrayInt *famIds(0);
4049 bool isWithoutCopy(false);
4050 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
4051 PyObject *ret=PyTuple_New(2);
4052 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4054 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4055 PyTuple_SetItem(ret,1,ret1Py);
4059 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
4061 DataArrayInt *numIds(0);
4062 bool isWithoutCopy(false);
4063 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
4064 PyObject *ret=PyTuple_New(2);
4065 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4067 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4068 PyTuple_SetItem(ret,1,ret1Py);
4072 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
4074 DataArrayInt *famIds(0);
4075 bool isWithoutCopy(false);
4076 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
4077 PyObject *ret=PyTuple_New(2);
4078 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4080 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4081 PyTuple_SetItem(ret,1,ret1Py);
4085 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
4087 DataArrayInt *numIds(0);
4088 bool isWithoutCopy(false);
4089 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
4090 PyObject *ret=PyTuple_New(2);
4091 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
4093 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4094 PyTuple_SetItem(ret,1,ret1Py);
4098 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
4100 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
4101 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4102 PyObject *res(PyList_New(result.size()));
4103 for(int i=0;iL!=result.end(); i++, iL++)
4104 PyList_SetItem(res,i,PyInt_FromLong(*iL));
4110 class MEDUMeshMultiLev : public MEDMeshMultiLev
4113 ~MEDUMeshMultiLev();
4117 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4119 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
4120 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
4121 PyObject *ret0Py=ncc?Py_True:Py_False;
4123 PyObject *ret=PyTuple_New(7);
4124 PyTuple_SetItem(ret,0,ret0Py);
4125 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4126 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
4127 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4128 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4129 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4130 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4136 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
4139 ~MEDStructuredMeshMultiLev();
4142 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
4145 ~MEDCMeshMultiLev();
4149 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4152 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
4153 std::size_t sz(objs.size());
4154 PyObject *ret(PyTuple_New(2));
4155 PyObject *ret0=PyList_New(sz);
4156 for(std::size_t i=0;i<sz;i++)
4157 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4158 PyTuple_SetItem(ret,0,ret0);
4159 PyObject *ret1Py(isInternal?Py_True:Py_False);
4161 PyTuple_SetItem(ret,1,ret1Py);
4167 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
4170 ~MEDCurveLinearMeshMultiLev();
4174 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
4176 DataArrayDouble *ret0(0);
4177 std::vector<int> ret1;
4179 self->buildVTUArrays(ret0,ret1,ret2);
4180 std::size_t sz(ret1.size());
4181 PyObject *ret=PyTuple_New(3);
4182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4183 PyObject *ret1Py=PyList_New(sz);
4184 for(std::size_t i=0;i<sz;i++)
4185 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
4186 PyTuple_SetItem(ret,1,ret1Py);
4187 PyObject *ret2Py(ret2?Py_True:Py_False);
4189 PyTuple_SetItem(ret,2,ret2Py);
4195 class MEDFileFastCellSupportComparator : public RefCountObject
4198 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
4199 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4200 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
4201 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
4203 ~MEDFileFastCellSupportComparator();
4207 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
4209 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
4210 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
4211 PyObject *res(PyList_New(result.size()));
4212 for(int i=0;iL!=result.end(); i++, iL++)
4213 PyList_SetItem(res,i,PyInt_FromLong(*iL));