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 (CEA/DEN)
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 "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileMeshSupports::New;
144 %newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName;
146 %newobject MEDCoupling::MEDFileStructureElements::New;
148 %newobject MEDCoupling::MEDFileFields::New;
149 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
150 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
151 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
152 %newobject MEDCoupling::MEDFileFields::deepCopy;
153 %newobject MEDCoupling::MEDFileFields::shallowCpy;
154 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
155 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
156 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
157 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
158 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
159 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
160 %newobject MEDCoupling::MEDFileFields::__iter__;
161 %newobject MEDCoupling::MEDFileFields::extractPart;
163 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
166 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
172 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
175 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
181 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
183 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
184 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
185 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
190 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
192 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
193 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
194 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
195 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
196 %newobject MEDCoupling::MEDFileField1TS::New;
197 %newobject MEDCoupling::MEDFileField1TS::field;
198 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
199 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
200 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
201 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
202 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
203 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
205 %newobject MEDCoupling::MEDFileIntField1TS::New;
206 %newobject MEDCoupling::MEDFileIntField1TS::field;
207 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
208 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
209 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
210 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
211 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
212 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
214 %newobject MEDCoupling::MEDFileData::New;
215 %newobject MEDCoupling::MEDFileData::deepCopy;
216 %newobject MEDCoupling::MEDFileData::getMeshes;
217 %newobject MEDCoupling::MEDFileData::getFields;
218 %newobject MEDCoupling::MEDFileData::getParams;
219 %newobject MEDCoupling::MEDFileData::Aggregate;
221 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
222 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
223 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
224 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
225 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
226 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
227 %newobject MEDCoupling::MEDFileParameters::New;
228 %newobject MEDCoupling::MEDFileParameters::deepCopy;
229 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
230 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
231 %newobject MEDCoupling::MEDFileParameters::__getitem__;
233 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
234 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
235 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
236 %newobject MEDCoupling::MEDFileJointOneStep::New;
237 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
238 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
239 %newobject MEDCoupling::MEDFileJoint::New;
240 %newobject MEDCoupling::MEDFileJoint::deepCopy;
241 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
242 %newobject MEDCoupling::MEDFileJoints::New;
243 %newobject MEDCoupling::MEDFileJoints::deepCopy;
244 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
245 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
246 %newobject MEDCoupling::MEDFileJoints::__getitem__;
247 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
248 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
249 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
250 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
251 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
252 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
253 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
254 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
255 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
257 %newobject MEDCoupling::SauvWriter::New;
258 %newobject MEDCoupling::SauvReader::New;
259 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
261 %newobject MEDCoupling::MEDFileMeshStruct::New;
262 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
263 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
264 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
265 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
266 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
268 %feature("unref") MEDFileMesh "$this->decrRef();"
269 %feature("unref") MEDFileUMesh "$this->decrRef();"
270 %feature("unref") MEDFileCMesh "$this->decrRef();"
271 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileMeshes "$this->decrRef();"
273 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
274 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
275 %feature("unref") MEDFileField1TS "$this->decrRef();"
276 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
277 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
278 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
279 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
280 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
281 %feature("unref") MEDFileStructureElements "$this->decrRef();"
282 %feature("unref") MEDFileFields "$this->decrRef();"
283 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
284 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
285 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
286 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
287 %feature("unref") MEDFileParameters "$this->decrRef();"
288 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
289 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
290 %feature("unref") MEDFileJoint "$this->decrRef();"
291 %feature("unref") MEDFileJoints "$this->decrRef();"
292 %feature("unref") MEDFileEquivalences "$this->decrRef();"
293 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
294 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
295 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
296 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
297 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
298 %feature("unref") MEDFileData "$this->decrRef();"
299 %feature("unref") SauvReader "$this->decrRef();"
300 %feature("unref") SauvWriter "$this->decrRef();"
301 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
302 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
303 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
304 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
305 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
306 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
308 namespace MEDCoupling
311 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
312 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
313 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
314 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
315 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
316 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
318 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
319 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
320 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
321 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
322 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
323 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
324 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
325 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
327 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
328 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
329 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
330 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
331 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
332 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
333 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
334 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
335 MEDCoupling::MEDCouplingFieldDouble *ReadField(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);
336 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);
337 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);
338 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);
339 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);
340 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
341 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
342 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
343 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
344 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
345 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
348 %rename (MEDFileVersion) MEDFileVersionSwig;
349 %rename (GetFieldIterations) GetFieldIterationsSwig;
350 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
351 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
352 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
353 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
354 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
355 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
356 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
357 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
358 %rename (WriteUMeshes) WriteUMeshesSwig;
359 %rename (GetTypesOfField) GetTypesOfFieldSwig;
360 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
361 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
365 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
367 int major,minor,release;
368 MEDCoupling::MEDFileVersion(major,minor,release);
369 PyObject *ret(PyTuple_New(3));
370 PyTuple_SetItem(ret,0,SWIG_From_int(major));
371 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
372 PyTuple_SetItem(ret,2,SWIG_From_int(release));
376 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
378 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
379 PyObject *ret=PyList_New(res.size());
381 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
383 PyObject *elt=PyTuple_New(2);
384 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
385 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
386 PyList_SetItem(ret,rk,elt);
391 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
393 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
394 PyObject *ret=PyList_New(res.size());
396 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
398 PyObject *elt=PyTuple_New(3);
399 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
400 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
401 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
402 PyList_SetItem(ret,rk,elt);
407 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
409 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
410 PyObject *ret=PyList_New(res.size());
412 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
414 PyObject *elt=PyTuple_New(2);
415 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
416 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
417 PyList_SetItem(ret,rk,elt);
422 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
424 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
425 PyObject *ret=PyList_New(res.size());
427 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
429 PyObject *elt=PyTuple_New(2);
430 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
431 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
432 PyList_SetItem(ret,rk,elt);
437 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
439 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
440 PyObject *ret=PyList_New(res.size());
442 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
444 PyObject *elt=PyTuple_New(2);
445 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
446 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
447 PyList_SetItem(ret,rk,elt);
452 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
454 int meshDim,spaceDim,numberOfNodes;
455 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
456 PyObject *ret=PyTuple_New(4);
457 PyObject *elt0=PyList_New(res.size());
459 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
461 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
463 PyObject *elt1=PyList_New(obj2.size());
464 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
466 PyObject *elt2=PyTuple_New(2);
467 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
468 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
469 PyList_SetItem(elt1,j,elt2);
471 PyList_SetItem(elt0,i,elt1);
473 PyTuple_SetItem(ret,0,elt0);
474 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
475 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
476 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
480 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
481 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
483 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
484 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
485 return convertFieldDoubleVecToPy(res);
488 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
490 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
491 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
492 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
495 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
497 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
498 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
499 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
502 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
504 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
505 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
506 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
509 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
511 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
513 PyObject *ret=PyList_New(size);
514 for(int i=0;i<size;i++)
515 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
519 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
521 std::vector<std::string> grps;
522 converPyListToVecString(li,grps);
523 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
526 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
528 std::vector<std::string> fams;
529 converPyListToVecString(li,fams);
530 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
534 namespace MEDCoupling
536 class MEDFileWritable
539 void copyOptionsFrom(const MEDFileWritable& other) const;
540 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
541 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
542 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
543 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
546 class MEDFileWritableStandAlone : public MEDFileWritable
549 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
550 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
553 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
555 MCAuto<DataArrayByte> ret(self->serialize());
559 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
561 PyObject *ret(PyList_New(0));
565 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
569 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
572 PyObject *ret(PyTuple_New(1));
573 PyObject *ret0(PyDict_New());
574 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
575 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
576 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
577 PyObject *tmp1(PyInt_FromLong(0));
578 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
579 PyTuple_SetItem(ret,0,ret0);
583 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
589 class MEDFileMeshReadSelector
592 MEDFileMeshReadSelector();
593 MEDFileMeshReadSelector(unsigned int code);
594 unsigned int getCode() const;
595 void setCode(unsigned int newCode);
596 bool isCellFamilyFieldReading() const;
597 bool isNodeFamilyFieldReading() const;
598 bool isCellNameFieldReading() const;
599 bool isNodeNameFieldReading() const;
600 bool isCellNumFieldReading() const;
601 bool isNodeNumFieldReading() const;
602 void setCellFamilyFieldReading(bool b);
603 void setNodeFamilyFieldReading(bool b);
604 void setCellNameFieldReading(bool b);
605 void setNodeNameFieldReading(bool b);
606 void setCellNumFieldReading(bool b);
607 void setNodeNumFieldReading(bool b);
610 std::string __str__() const throw(INTERP_KERNEL::Exception)
612 std::ostringstream oss;
617 std::string __repr__() const throw(INTERP_KERNEL::Exception)
619 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
625 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
628 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
629 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
630 throw(INTERP_KERNEL::Exception);
631 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
632 INTERP_KERNEL::NormalizedCellType loc_geo_type,
633 INTERP_KERNEL::NormalizedCellType rem_geo_type)
634 throw(INTERP_KERNEL::Exception);
635 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
636 MEDFileJointCorrespondence *deepCopy() const;
637 MEDFileJointCorrespondence *shallowCpy() const;
638 void setIsNodal(bool isNodal);
639 bool getIsNodal() const;
640 bool isEqual(const MEDFileJointCorrespondence *other) const;
641 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
642 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
643 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
644 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
645 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
646 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
647 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);
648 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
651 MEDFileJointCorrespondence()
653 return MEDFileJointCorrespondence::New();
655 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
657 return MEDFileJointCorrespondence::New(correspondence);
659 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
660 INTERP_KERNEL::NormalizedCellType loc_geo_type,
661 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
663 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
666 std::string __str__() const throw(INTERP_KERNEL::Exception)
668 return self->simpleRepr();
673 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
676 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
677 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
678 MEDFileJointOneStep *deepCopy() const;
679 MEDFileJointOneStep *shallowCpy() const;
680 bool isEqual(const MEDFileJointOneStep *other) const;
681 void setOrder(int order);
682 int getOrder() const;
683 void setIteration(int it);
684 int getIteration() const;
685 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
686 int getNumberOfCorrespondences() const;
687 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
688 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
689 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
692 MEDFileJointOneStep()
694 return MEDFileJointOneStep::New();
697 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
699 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
702 std::string __str__() const throw(INTERP_KERNEL::Exception)
704 return self->simpleRepr();
709 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
712 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
713 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
714 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
715 MEDFileJoint *deepCopy() const;
716 MEDFileJoint *shallowCpy() const;
717 bool isEqual(const MEDFileJoint *other) const;
718 void setLocalMeshName(const std::string& name);
719 std::string getLocalMeshName() const;
720 void setRemoteMeshName(const std::string& name);
721 std::string getRemoteMeshName() const;
722 void setDescription(const std::string& name);
723 std::string getDescription() const;
724 void setJointName(const std::string& name);
725 std::string getJointName() const;
726 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
727 void setDomainNumber(const int& number);
728 int getDomainNumber() const;
729 void pushStep(MEDFileJointOneStep* step);
730 int getNumberOfSteps() const;
731 MEDFileJointOneStep *getStepAtPos(int i) const;
732 std::string simpleRepr() const;
737 return MEDFileJoint::New();
740 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
742 return MEDFileJoint::New(fileName,mName,num);
745 std::string __str__() const throw(INTERP_KERNEL::Exception)
747 return self->simpleRepr();
752 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
755 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
756 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
757 MEDFileJoints *deepCopy() const;
758 std::string simpleRepr() const;
759 std::string getMeshName() const;
760 int getNumberOfJoints() const;
761 std::vector<std::string> getJointsNames() const;
762 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
763 void resize(int newSize) throw(INTERP_KERNEL::Exception);
764 void pushJoint(MEDFileJoint *joint);
765 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
766 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
771 return MEDFileJoints::New();
774 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
776 return MEDFileJoints::New(fileName,meshName);
779 std::string __str__() const throw(INTERP_KERNEL::Exception)
781 return self->simpleRepr();
784 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
788 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
793 else if(PyString_Check(obj))
795 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
801 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
804 int __len__() const throw(INTERP_KERNEL::Exception)
806 return self->getNumberOfJoints();
809 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
811 MEDFileJoint *ret=self->getJointAtPos(i);
817 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
819 MEDFileJoint *ret=self->getJointWithName(paramName);
827 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
830 MEDFileEquivalenceBase();
833 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
836 MEDFileEquivalenceData();
838 void setArray(DataArrayInt *data);
841 DataArrayInt *getArray()
843 DataArrayInt *ret(self->getArray());
844 if(ret) ret->incrRef();
850 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
853 MEDFileEquivalenceNode();
856 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
859 MEDFileEquivalenceCell();
862 std::size_t size() const;
863 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
864 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
867 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
869 DataArrayInt *ret(self->getArray(type));
870 if(ret) ret->incrRef();
874 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
876 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
877 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
878 PyObject *res=PyList_New(result.size());
879 for(int i=0;iL!=result.end(); i++, iL++)
880 PyList_SetItem(res,i,PyInt_FromLong(*iL));
886 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
889 MEDFileEquivalencePair();
891 std::string getName() const;
892 void setName(const std::string& name);
893 std::string getDescription() const;
894 void setDescription(const std::string& descr);
895 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
898 MEDFileEquivalenceCell *initCell()
900 MEDFileEquivalenceCell *ret(self->initCell());
901 if(ret) ret->incrRef();
905 MEDFileEquivalenceNode *initNode()
907 MEDFileEquivalenceNode *ret(self->initNode());
908 if(ret) ret->incrRef();
912 MEDFileEquivalenceCell *getCell()
914 MEDFileEquivalenceCell *ret(self->getCell());
915 if(ret) ret->incrRef();
919 MEDFileEquivalenceNode *getNode()
921 MEDFileEquivalenceNode *ret(self->getNode());
922 if(ret) ret->incrRef();
928 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
931 MEDFileEquivalences();
934 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
935 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
936 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
940 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
942 MEDFileEquivalencePair *ret(self->getEquivalence(i));
943 if(ret) ret->incrRef();
946 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
948 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
949 if(ret) ret->incrRef();
953 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
955 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
956 if(ret) ret->incrRef();
962 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
965 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
966 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
967 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
968 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
969 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
970 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
971 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
972 void setName(const std::string& name);
973 std::string getName();
974 std::string getUnivName() const;
975 bool getUnivNameWrStatus() const;
976 void setUnivNameWrStatus(bool newStatus);
977 void setDescription(const std::string& name);
978 std::string getDescription() const;
979 void setOrder(int order);
980 int getOrder() const;
981 void setIteration(int it);
983 void setTimeValue(double time);
984 void setTime(int dt, int it, double time);
985 double getTimeValue() const;
986 void setTimeUnit(const std::string& unit);
987 std::string getTimeUnit() const;
988 void setAxisType(MEDCouplingAxisType at);
989 MEDCouplingAxisType getAxisType() const;
990 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
991 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
992 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
993 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
994 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
995 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
996 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
997 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
998 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
999 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1000 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1001 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1002 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1003 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1005 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1006 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1007 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1008 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1009 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1010 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1011 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1012 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1013 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1014 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1015 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1016 void clearFamMap() throw(INTERP_KERNEL::Exception);
1017 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1018 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1019 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1020 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1021 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1022 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1023 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1024 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1025 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1026 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1027 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1028 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1029 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1030 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1031 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1032 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1033 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1034 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1035 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1036 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1037 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1038 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1039 static std::string GetMagicFamilyStr();
1040 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1041 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1042 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1043 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1044 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1045 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1046 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1047 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1048 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1049 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1050 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1051 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1052 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1053 void setFamilyInfo(const std::map<std::string,int>& info);
1054 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1055 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1056 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1057 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1058 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1059 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1060 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1061 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1062 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1063 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1064 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1065 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1066 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1067 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1068 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1069 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1070 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1071 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1072 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1073 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1074 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1076 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1077 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1078 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1079 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1080 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1081 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1082 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1083 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1084 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1085 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1086 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1087 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1088 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1089 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1090 int getNumberOfJoints();
1091 MEDFileJoints *getJoints();
1092 void setJoints( MEDFileJoints* joints );
1093 void initializeEquivalences();
1094 void killEquivalences();
1095 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1096 void killStructureElements() throw(INTERP_KERNEL::Exception);
1099 std::string __str__() const throw(INTERP_KERNEL::Exception)
1101 return self->simpleRepr();
1104 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1106 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1109 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1112 double tmp0=self->getTime(tmp1,tmp2);
1113 PyObject *res = PyList_New(3);
1114 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1115 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1116 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1120 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1123 bool ret0=self->isEqual(other,eps,what);
1124 PyObject *res=PyList_New(2);
1125 PyObject *ret0Py=ret0?Py_True:Py_False;
1127 PyList_SetItem(res,0,ret0Py);
1128 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1132 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1134 std::vector<const DataArrayInt *> grps;
1135 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1136 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1139 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1142 bool ret0=self->areFamsEqual(other,what);
1143 PyObject *res=PyList_New(2);
1144 PyObject *ret0Py=ret0?Py_True:Py_False;
1146 PyList_SetItem(res,0,ret0Py);
1147 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1151 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1154 bool ret0=self->areGrpsEqual(other,what);
1155 PyObject *res=PyList_New(2);
1156 PyObject *ret0Py=ret0?Py_True:Py_False;
1158 PyList_SetItem(res,0,ret0Py);
1159 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1163 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1165 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1166 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1167 PyObject *res=PyList_New(result.size());
1168 for(int i=0;iL!=result.end(); i++, iL++)
1169 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1173 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1175 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1176 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1177 PyObject *res=PyList_New(result.size());
1178 for(int i=0;iL!=result.end(); i++, iL++)
1179 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1183 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1185 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1188 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1191 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1193 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1196 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1199 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1201 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1204 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1207 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1209 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1212 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1215 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1217 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1220 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1223 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1226 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1227 PyObject *ret=PyTuple_New(2);
1228 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1229 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1233 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1235 DataArrayInt *ret3=0;
1236 std::vector<int> ret1,ret2;
1237 bool ret0=self->unPolyze(ret1,ret2,ret3);
1238 PyObject *ret=PyTuple_New(4);
1239 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1241 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1242 for(int j=0;j<(int)ret1.size()/3;j++)
1244 PyObject *retLev2=PyList_New(3);
1245 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1246 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1247 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1248 PyList_SetItem(retLev1_0,j,retLev2);
1250 PyTuple_SetItem(ret,1,retLev1_0);
1252 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1253 for(int j=0;j<(int)ret2.size()/3;j++)
1255 PyObject *retLev2=PyList_New(3);
1256 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1257 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1258 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1259 PyList_SetItem(retLev1_1,j,retLev2);
1261 PyTuple_SetItem(ret,2,retLev1_1);
1263 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1267 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1269 MEDFileEquivalences *ret(self->getEquivalences());
1270 if(ret) ret->incrRef();
1276 class MEDFileUMesh : public MEDFileMesh
1279 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1280 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1281 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1282 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1283 static MEDFileUMesh *New();
1284 static const char *GetSpeStr4ExtMesh();
1286 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1287 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1288 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1289 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1290 void clearNodeAndCellNumbers();
1292 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1293 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1294 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1295 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1296 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1297 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1298 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1299 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1300 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1301 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1303 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1304 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1305 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1306 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1307 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1308 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1309 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1310 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1311 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1312 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1313 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1314 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1315 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1316 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1317 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1320 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1322 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1325 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1327 return MEDFileUMesh::New(fileName,mrs);
1330 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1332 return MEDFileUMesh::New(mem);
1335 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1337 return MEDFileUMesh::New(db);
1342 return MEDFileUMesh::New();
1346 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1348 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1351 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)
1353 std::vector<int> typesCpp1;
1354 convertPyToNewIntArr3(types,typesCpp1);
1355 std::size_t sz(typesCpp1.size());
1356 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1357 for(std::size_t ii=0;ii<sz;ii++)
1358 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1359 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1362 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1363 {// put an empty dict in input to say to __new__ to call __init__...
1364 PyObject *ret(PyTuple_New(1));
1365 PyObject *ret0(PyDict_New());
1366 PyTuple_SetItem(ret,0,ret0);
1370 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1372 std::vector<double> a0;
1373 std::vector<int> a1;
1374 std::vector<std::string> a2;
1375 std::vector< MCAuto<DataArrayInt> > a3;
1376 MCAuto<DataArrayDouble> a4;
1377 self->serialize(a0,a1,a2,a3,a4);
1378 PyObject *ret(PyTuple_New(5));
1379 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1380 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1382 PyObject *ret2(PyList_New(sz));
1383 for(int i=0;i<sz;i++)
1384 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1385 PyTuple_SetItem(ret,2,ret2);
1387 PyObject *ret3(PyList_New(sz));
1388 for(int i=0;i<sz;i++)
1390 DataArrayInt *elt(a3[i]);
1393 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1395 PyTuple_SetItem(ret,3,ret3);
1396 DataArrayDouble *ret4(a4);
1399 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1403 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1405 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1406 if(!PyTuple_Check(inp))
1407 throw INTERP_KERNEL::Exception(MSG);
1408 int sz(PyTuple_Size(inp));
1410 throw INTERP_KERNEL::Exception(MSG);
1411 std::vector<double> a0;
1412 std::vector<int> a1;
1413 std::vector<std::string> a2;
1414 std::vector< MCAuto<DataArrayInt> > a3;
1415 MCAuto<DataArrayDouble> a4;
1417 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1419 fillArrayWithPyListDbl3(a0py,tmp,a0);
1420 convertPyToNewIntArr3(a1py,a1);
1421 fillStringVector(a2py,a2);
1423 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1425 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1426 if(!SWIG_IsOK(status))
1427 throw INTERP_KERNEL::Exception(MSG);
1428 a4=reinterpret_cast<DataArrayDouble *>(argp);
1429 if((DataArrayDouble *)a4)
1432 std::vector< DataArrayInt * > a3Tmp;
1433 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1434 std::size_t sz(a3Tmp.size());
1436 for(std::size_t i=0;i<sz;i++)
1440 a3Tmp[i]->incrRef();
1442 self->unserialize(a0,a1,a2,a3,a4);
1446 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1449 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1450 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1453 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1456 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1459 self->setMeshAtLevel(meshDimRelToMax,m1);
1462 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1465 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1467 self->removeMeshAtLevel(meshDimRelToMax);
1470 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1472 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1474 DataArrayDouble *a,*a2;
1475 DataArrayDoubleTuple *aa,*aa2;
1476 std::vector<double> bb,bb2;
1478 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1479 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1480 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1484 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1486 std::vector<const MEDFileUMesh *> meshesCpp;
1487 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1488 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1492 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1494 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1495 return convertVecPairIntToPy(ret);
1498 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1500 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1501 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1502 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1505 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1507 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1508 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1509 return self->extractPart(extractDefCpp);
1512 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1514 std::vector<const MEDCouplingUMesh *> ms;
1515 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1516 self->setMeshes(ms,renum);
1519 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1521 std::vector<const MEDCouplingUMesh *> ms;
1522 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1523 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1526 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1528 std::vector<const MEDCouplingUMesh *> ms;
1529 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1530 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1533 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1535 DataArrayDouble *ret=self->getCoords();
1541 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1543 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1546 return const_cast<PartDefinition *>(ret);
1549 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1551 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1552 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1553 PyObject *ret=PyTuple_New(3);
1554 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1555 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1556 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1560 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1562 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1568 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1570 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1571 std::size_t sz(tmp.size());
1572 PyObject *ret=PyList_New(sz);
1573 for(std::size_t i=0;i<sz;i++)
1577 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1584 class MEDFileStructuredMesh : public MEDFileMesh
1589 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1591 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1599 class MEDFileCMesh : public MEDFileStructuredMesh
1602 static MEDFileCMesh *New();
1603 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1604 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1605 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1606 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1607 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1612 return MEDFileCMesh::New();
1615 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1617 return MEDFileCMesh::New(fileName,mrs);
1620 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1622 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1625 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1627 return MEDFileCMesh::New(db);
1631 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1633 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1636 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1638 const MEDCouplingCMesh *tmp=self->getMesh();
1641 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1646 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1649 static MEDFileCurveLinearMesh *New();
1650 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1651 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1652 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1653 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1656 MEDFileCurveLinearMesh()
1658 return MEDFileCurveLinearMesh::New();
1661 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1663 return MEDFileCurveLinearMesh::New(fileName,mrs);
1666 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1668 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1671 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1673 return MEDFileCurveLinearMesh::New(db);
1677 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1679 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1682 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1684 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1687 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1692 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1695 static MEDFileMeshMultiTS *New();
1696 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1697 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1698 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1699 std::string getName() const throw(INTERP_KERNEL::Exception);
1700 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1701 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1704 MEDFileMeshMultiTS()
1706 return MEDFileMeshMultiTS::New();
1709 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1711 return MEDFileMeshMultiTS::New(fileName);
1714 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1716 return MEDFileMeshMultiTS::New(fileName,mName);
1719 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1721 MEDFileMesh *ret=self->getOneTimeStep();
1729 class MEDFileMeshesIterator
1734 PyObject *next() throw(INTERP_KERNEL::Exception)
1736 MEDFileMesh *ret=self->nextt();
1740 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1744 PyErr_SetString(PyExc_StopIteration,"No more data.");
1751 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1754 static MEDFileMeshes *New();
1755 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1756 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1757 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1758 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1760 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1761 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1762 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1763 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1764 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1765 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1766 void killStructureElements() throw(INTERP_KERNEL::Exception);
1771 return MEDFileMeshes::New();
1774 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1776 return MEDFileMeshes::New(fileName);
1779 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1781 return MEDFileMeshes::New(db);
1785 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1787 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1790 std::string __str__() const throw(INTERP_KERNEL::Exception)
1792 return self->simpleRepr();
1795 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1797 if(PyInt_Check(obj))
1799 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1804 else if(PyString_Check(obj))
1806 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1812 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1815 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1817 self->setMeshAtPos(obj,mesh);
1821 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1823 return self->iterator();
1826 int __len__() const throw(INTERP_KERNEL::Exception)
1828 return self->getNumberOfMeshes();
1831 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1833 MEDFileMesh *ret=self->getMeshAtPos(i);
1838 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1840 MEDFileMesh *ret=self->getMeshWithName(mname);
1848 class MEDFileFieldLoc : public RefCountObject
1851 std::string getName() const;
1852 int getDimension() const;
1853 int getNumberOfGaussPoints() const;
1854 int getNumberOfPointsInCells() const;
1855 const std::vector<double>& getRefCoords() const;
1856 const std::vector<double>& getGaussCoords() const;
1857 const std::vector<double>& getGaussWeights() const;
1858 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1861 std::string __str__() const throw(INTERP_KERNEL::Exception)
1863 return self->repr();
1868 class MEDFileFieldGlobsReal
1871 void resetContent();
1872 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1873 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1874 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1875 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1876 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1877 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1878 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1879 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1880 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1881 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1882 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1883 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1884 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1885 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1886 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1887 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1888 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1889 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1890 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1891 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1892 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1893 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1894 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1895 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1896 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1897 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1898 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1901 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1903 const DataArrayInt *ret=self->getProfile(pflName);
1906 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1909 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1911 const DataArrayInt *ret=self->getProfileFromId(pflId);
1914 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1917 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1919 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1922 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1925 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1927 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1930 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1933 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1935 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1936 return convertVecPairVecStToPy(ret);
1939 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1941 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1942 return convertVecPairVecStToPy(ret);
1945 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1947 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1948 self->changePflsNames(v);
1951 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1953 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1954 self->changePflsRefsNamesGen(v);
1957 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1959 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1960 self->changePflsNamesInStruct(v);
1963 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1965 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1966 self->changeLocsNames(v);
1969 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1971 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1972 self->changeLocsRefsNamesGen(v);
1975 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1977 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1978 self->changeLocsNamesInStruct(v);
1981 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1983 std::ostringstream oss;
1984 self->simpleReprGlobs(oss);
1990 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1993 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1994 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1995 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1996 void loadArrays() throw(INTERP_KERNEL::Exception);
1997 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1998 void unloadArrays() throw(INTERP_KERNEL::Exception);
1999 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2000 int getDimension() const throw(INTERP_KERNEL::Exception);
2001 int getIteration() const throw(INTERP_KERNEL::Exception);
2002 int getOrder() const throw(INTERP_KERNEL::Exception);
2003 std::string getName() throw(INTERP_KERNEL::Exception);
2004 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2005 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2006 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2007 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2008 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2009 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2010 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2011 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2012 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2013 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2014 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2015 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2016 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2017 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2018 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2021 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2024 double tmp0=self->getTime(tmp1,tmp2);
2025 PyObject *res = PyList_New(3);
2026 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2027 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2028 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2032 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2034 std::pair<int,int> res=self->getDtIt();
2035 PyObject *elt=PyTuple_New(2);
2036 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2037 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2041 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2043 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2046 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2048 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2051 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2053 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2054 return self->changeMeshNames(modifTab);
2057 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2059 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2060 PyObject *ret2=PyList_New(ret.size());
2061 for(int i=0;i<(int)ret.size();i++)
2062 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2066 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2068 std::vector<int> ret1;
2069 int ret0=self->getNonEmptyLevels(mname,ret1);
2070 PyObject *elt=PyTuple_New(2);
2071 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2072 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2076 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2078 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2079 std::vector< std::vector<TypeOfField> > typesF;
2080 std::vector< std::vector<std::string> > pfls;
2081 std::vector< std::vector<std::string> > locs;
2082 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2084 PyObject *ret2=PyList_New(sz);
2085 for(int i=0;i<sz;i++)
2087 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2088 const std::vector<TypeOfField>& typesFI=typesF[i];
2089 const std::vector<std::string>& pflsI=pfls[i];
2090 const std::vector<std::string>& locsI=locs[i];
2091 PyObject *elt=PyTuple_New(2);
2092 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2093 int sz2=ret[i].size();
2094 PyObject *elt2=PyList_New(sz2);
2095 for(int j=0;j<sz2;j++)
2097 PyObject *elt3=PyTuple_New(4);
2098 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2099 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));
2100 PyTuple_SetItem(elt3,1,elt4);
2101 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2102 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2103 PyList_SetItem(elt2,j,elt3);
2105 PyTuple_SetItem(elt,1,elt2);
2106 PyList_SetItem(ret2,i,elt);
2111 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2113 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2114 std::size_t sz=ret.size();
2115 PyObject *retPy=PyList_New(sz);
2116 for(std::size_t i=0;i<sz;i++)
2117 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2121 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2123 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2124 std::size_t sz=ret.size();
2125 PyObject *retPy=PyList_New(sz);
2126 for(std::size_t i=0;i<sz;i++)
2127 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2131 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2133 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2134 std::size_t sz=ret.size();
2135 PyObject *retPy=PyList_New(sz);
2136 for(std::size_t i=0;i<sz;i++)
2137 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2141 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2143 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2144 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2145 return self->extractPart(extractDefCpp,mm);
2150 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2153 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2154 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2155 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2156 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2157 static MEDFileField1TS *New();
2158 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2159 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2160 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2161 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2162 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2163 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2164 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2166 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2167 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2168 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2169 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2172 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2174 return MEDFileField1TS::New(fileName,loadAll);
2177 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2179 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2182 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2184 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2187 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2189 return MEDFileField1TS::New(db);
2194 return MEDFileField1TS::New();
2198 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2200 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2203 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2205 const DataArrayDouble *arr=0;
2207 arr=field->getArray();
2208 self->copyTinyInfoFrom(field,arr);
2211 std::string __str__() const throw(INTERP_KERNEL::Exception)
2213 return self->simpleRepr();
2216 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2218 DataArrayInt *ret1=0;
2219 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2220 PyObject *ret=PyTuple_New(2);
2221 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2222 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2226 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2228 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2229 std::vector< std::vector<TypeOfField> > typesF;
2230 std::vector< std::vector<std::string> > pfls;
2231 std::vector< std::vector<std::string> > locs;
2232 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2234 PyObject *ret2=PyList_New(sz);
2235 for(int i=0;i<sz;i++)
2237 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2238 const std::vector<TypeOfField>& typesFI=typesF[i];
2239 const std::vector<std::string>& pflsI=pfls[i];
2240 const std::vector<std::string>& locsI=locs[i];
2241 PyObject *elt=PyTuple_New(2);
2242 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2243 int sz2=ret[i].size();
2244 PyObject *elt2=PyList_New(sz2);
2245 for(int j=0;j<sz2;j++)
2247 PyObject *elt3=PyTuple_New(4);
2248 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2249 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2250 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2251 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2252 PyList_SetItem(elt2,j,elt3);
2254 PyTuple_SetItem(elt,1,elt2);
2255 PyList_SetItem(ret2,i,elt);
2260 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2262 DataArrayDouble *ret=self->getUndergroundDataArray();
2268 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2270 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2271 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2274 PyObject *ret=PyTuple_New(2);
2275 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2276 std::size_t sz=elt1Cpp.size();
2277 PyObject *elt=PyList_New(sz);
2278 for(std::size_t i=0;i<sz;i++)
2280 PyObject *elt1=PyTuple_New(2);
2281 PyObject *elt2=PyTuple_New(2);
2282 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2283 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2284 PyObject *elt3=PyTuple_New(2);
2285 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2286 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2287 PyTuple_SetItem(elt1,0,elt2);
2288 PyTuple_SetItem(elt1,1,elt3);
2289 PyList_SetItem(elt,i,elt1);
2291 PyTuple_SetItem(ret,1,elt);
2297 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2300 static MEDFileIntField1TS *New();
2301 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2302 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2303 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2304 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2305 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2307 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2308 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2309 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2310 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2311 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2312 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2313 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2314 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2317 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2319 return MEDFileIntField1TS::New();
2322 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2324 return MEDFileIntField1TS::New(fileName,loadAll);
2327 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2329 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2332 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2334 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2337 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2339 return MEDFileIntField1TS::New(db);
2343 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2345 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2348 std::string __str__() const throw(INTERP_KERNEL::Exception)
2350 return self->simpleRepr();
2353 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2355 DataArrayInt *ret1=0;
2356 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2357 PyObject *ret=PyTuple_New(2);
2358 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2359 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2363 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2365 DataArrayInt *ret=self->getUndergroundDataArray();
2373 class MEDFileAnyTypeFieldMultiTSIterator
2378 PyObject *next() throw(INTERP_KERNEL::Exception)
2380 MEDFileAnyTypeField1TS *ret=self->nextt();
2382 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2385 PyErr_SetString(PyExc_StopIteration,"No more data.");
2392 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2395 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2396 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2397 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2398 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2399 std::string getName() const throw(INTERP_KERNEL::Exception);
2400 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2401 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2402 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2403 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2404 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2405 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2406 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2407 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2408 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2409 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2410 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2411 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2412 void loadArrays() throw(INTERP_KERNEL::Exception);
2413 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2414 void unloadArrays() throw(INTERP_KERNEL::Exception);
2415 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2417 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2418 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2419 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2420 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2421 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2422 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2425 int __len__() const throw(INTERP_KERNEL::Exception)
2427 return self->getNumberOfTS();
2430 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2432 if(elt0 && PyInt_Check(elt0))
2434 int pos=PyInt_AS_LONG(elt0);
2437 else if(elt0 && PyTuple_Check(elt0))
2439 if(PyTuple_Size(elt0)==2)
2441 PyObject *o0=PyTuple_GetItem(elt0,0);
2442 PyObject *o1=PyTuple_GetItem(elt0,1);
2443 if(PyInt_Check(o0) && PyInt_Check(o1))
2445 int iter=PyInt_AS_LONG(o0);
2446 int order=PyInt_AS_LONG(o1);
2447 return self->getPosOfTimeStep(iter,order);
2450 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 !");
2453 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 !");
2455 else if(elt0 && PyFloat_Check(elt0))
2457 double val=PyFloat_AS_DOUBLE(elt0);
2458 return self->getPosGivenTime(val);
2461 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2464 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2466 std::vector< std::pair<int,int> > res(self->getIterations());
2467 return convertVecPairIntToPy(res);
2470 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2472 std::vector<double> ret1;
2473 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2474 std::size_t sz=ret.size();
2475 PyObject *ret2=PyList_New(sz);
2476 for(std::size_t i=0;i<sz;i++)
2478 PyObject *elt=PyTuple_New(3);
2479 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2480 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2481 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2482 PyList_SetItem(ret2,i,elt);
2487 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2489 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2490 PyObject *ret2=PyList_New(ret.size());
2491 for(int i=0;i<(int)ret.size();i++)
2493 const std::vector<TypeOfField>& rett=ret[i];
2494 PyObject *ret3=PyList_New(rett.size());
2495 for(int j=0;j<(int)rett.size();j++)
2496 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2497 PyList_SetItem(ret2,i,ret3);
2502 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2504 std::vector<int> ret1;
2505 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2506 PyObject *elt=PyTuple_New(2);
2507 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2508 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2512 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2514 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2515 std::vector< std::vector<TypeOfField> > typesF;
2516 std::vector< std::vector<std::string> > pfls;
2517 std::vector< std::vector<std::string> > locs;
2518 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2520 PyObject *ret2=PyList_New(sz);
2521 for(int i=0;i<sz;i++)
2523 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2524 const std::vector<TypeOfField>& typesFI=typesF[i];
2525 const std::vector<std::string>& pflsI=pfls[i];
2526 const std::vector<std::string>& locsI=locs[i];
2527 PyObject *elt=PyTuple_New(2);
2528 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2529 int sz2=ret[i].size();
2530 PyObject *elt2=PyList_New(sz2);
2531 for(int j=0;j<sz2;j++)
2533 PyObject *elt3=PyTuple_New(4);
2534 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2535 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));
2536 PyTuple_SetItem(elt3,1,elt4);
2537 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2538 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2539 PyList_SetItem(elt2,j,elt3);
2541 PyTuple_SetItem(elt,1,elt2);
2542 PyList_SetItem(ret2,i,elt);
2547 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2549 if(PyList_Check(elts))
2551 int sz=PyList_Size(elts);
2552 std::vector<int> ret(sz);
2553 for(int i=0;i<sz;i++)
2555 PyObject *elt=PyList_GetItem(elts,i);
2556 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2562 std::vector<int> ret(1);
2563 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2568 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2570 if(PySlice_Check(elts))
2572 Py_ssize_t strt=2,stp=2,step=2;
2573 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2574 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2575 self->eraseTimeStepIds2(strt,stp,step);
2579 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2580 if(!idsToRemove.empty())
2581 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2585 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2589 std::vector<int> pos2;
2590 DataArrayInt *pos3=0;
2591 DataArrayIntTuple *pos4=0;
2592 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2597 self->eraseTimeStepIds(&pos1,&pos1+1);
2604 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2609 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2613 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2617 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2619 return self->iterator();
2622 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2624 if(elt0 && PyList_Check(elt0))
2626 int sz=PyList_Size(elt0);
2627 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2628 int *pt=da->getPointer();
2629 for(int i=0;i<sz;i++,pt++)
2631 PyObject *elt1=PyList_GetItem(elt0,i);
2632 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2634 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2636 else if(elt0 && PySlice_Check(elt0))
2638 Py_ssize_t strt=2,stp=2,step=2;
2639 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2640 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2641 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2644 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2647 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2649 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2650 return self->changeMeshNames(modifTab);
2653 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2655 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2656 std::size_t sz=ret.size();
2657 PyObject *retPy=PyList_New(sz);
2658 for(std::size_t i=0;i<sz;i++)
2659 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2663 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2665 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2666 std::size_t sz=ret.size();
2667 PyObject *retPy=PyList_New(sz);
2668 for(std::size_t i=0;i<sz;i++)
2669 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2673 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2675 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2676 std::size_t sz=ret.size();
2677 PyObject *retPy=PyList_New(sz);
2678 for(std::size_t i=0;i<sz;i++)
2679 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2683 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2686 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2687 if(SWIG_IsOK(status))
2689 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2693 std::vector<MEDFileAnyTypeField1TS *> tmp;
2694 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2695 self->pushBackTimeSteps(tmp);
2699 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2701 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2702 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2703 return self->extractPart(extractDefCpp,mm);
2706 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2708 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2709 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2710 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2711 std::size_t sz=ret.size();
2712 PyObject *retPy=PyList_New(sz);
2713 for(std::size_t i=0;i<sz;i++)
2715 std::size_t sz2=ret[i].size();
2716 PyObject *ret1Py=PyList_New(sz2);
2717 for(std::size_t j=0;j<sz2;j++)
2719 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2722 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2724 PyList_SetItem(retPy,i,ret1Py);
2729 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2731 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2732 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2733 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2734 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2735 if(ret2.size()!=ret.size())
2737 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2738 throw INTERP_KERNEL::Exception(oss.str().c_str());
2740 std::size_t sz=ret.size();
2741 PyObject *retPy=PyList_New(sz);
2742 for(std::size_t i=0;i<sz;i++)
2744 std::size_t sz2=ret[i].size();
2745 PyObject *ret0Py=PyTuple_New(2);
2746 PyObject *ret1Py=PyList_New(sz2);
2747 for(std::size_t j=0;j<sz2;j++)
2749 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2752 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2754 PyTuple_SetItem(ret0Py,0,ret1Py);
2755 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2756 PyList_SetItem(retPy,i,ret0Py);
2763 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2766 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2767 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2768 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2769 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2771 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2772 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2773 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2774 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2775 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2776 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2778 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2779 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2780 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2783 MEDFileFieldMultiTS()
2785 return MEDFileFieldMultiTS::New();
2788 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2790 return MEDFileFieldMultiTS::New(fileName,loadAll);
2793 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2795 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2798 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2800 return MEDFileFieldMultiTS::New(db);
2804 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2806 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2809 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2811 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2812 std::size_t sz(tmp.size());
2813 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2814 for(std::size_t i=0;i<sz;i++)
2816 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2817 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2819 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2822 std::string __str__() const throw(INTERP_KERNEL::Exception)
2824 return self->simpleRepr();
2827 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2829 DataArrayInt *ret1=0;
2830 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2831 PyObject *ret=PyTuple_New(2);
2832 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2833 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2837 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2839 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2840 std::vector< std::vector<TypeOfField> > typesF;
2841 std::vector< std::vector<std::string> > pfls;
2842 std::vector< std::vector<std::string> > locs;
2843 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2845 PyObject *ret2=PyList_New(sz);
2846 for(int i=0;i<sz;i++)
2848 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2849 const std::vector<TypeOfField>& typesFI=typesF[i];
2850 const std::vector<std::string>& pflsI=pfls[i];
2851 const std::vector<std::string>& locsI=locs[i];
2852 PyObject *elt=PyTuple_New(2);
2853 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2854 int sz2=ret[i].size();
2855 PyObject *elt2=PyList_New(sz2);
2856 for(int j=0;j<sz2;j++)
2858 PyObject *elt3=PyTuple_New(4);
2859 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2860 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2861 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2862 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2863 PyList_SetItem(elt2,j,elt3);
2865 PyTuple_SetItem(elt,1,elt2);
2866 PyList_SetItem(ret2,i,elt);
2870 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2872 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2878 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2880 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2881 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2884 PyObject *ret=PyTuple_New(2);
2885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2886 std::size_t sz=elt1Cpp.size();
2887 PyObject *elt=PyList_New(sz);
2888 for(std::size_t i=0;i<sz;i++)
2890 PyObject *elt1=PyTuple_New(2);
2891 PyObject *elt2=PyTuple_New(2);
2892 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2893 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2894 PyObject *elt3=PyTuple_New(2);
2895 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2896 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2897 PyTuple_SetItem(elt1,0,elt2);
2898 PyTuple_SetItem(elt1,1,elt3);
2899 PyList_SetItem(elt,i,elt1);
2901 PyTuple_SetItem(ret,1,elt);
2907 class MEDFileFieldsIterator
2912 PyObject *next() throw(INTERP_KERNEL::Exception)
2914 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2916 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2919 PyErr_SetString(PyExc_StopIteration,"No more data.");
2926 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2929 static MEDFileIntFieldMultiTS *New();
2930 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2931 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2932 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2934 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2935 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2936 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2937 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2938 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2939 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2940 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2941 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2942 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2945 MEDFileIntFieldMultiTS()
2947 return MEDFileIntFieldMultiTS::New();
2950 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2952 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2955 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2957 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2960 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2962 return MEDFileIntFieldMultiTS::New(db);
2966 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2968 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
2971 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2973 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2974 std::size_t sz(tmp.size());
2975 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2976 for(std::size_t i=0;i<sz;i++)
2978 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2979 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2981 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2984 std::string __str__() const throw(INTERP_KERNEL::Exception)
2986 return self->simpleRepr();
2989 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2991 DataArrayInt *ret1=0;
2992 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2993 PyObject *ret=PyTuple_New(2);
2994 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2995 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2999 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3001 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3009 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3012 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3013 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3016 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3018 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3019 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3027 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3030 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3032 MEDFileStructureElements();
3035 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3038 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3039 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3040 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3041 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3042 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3043 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3044 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3045 void loadArrays() throw(INTERP_KERNEL::Exception);
3046 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3047 void unloadArrays() throw(INTERP_KERNEL::Exception);
3048 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3049 int getNumberOfFields() const;
3050 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3051 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3053 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3054 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3055 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3056 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3057 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3058 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3059 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3060 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3061 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3062 void killStructureElements() throw(INTERP_KERNEL::Exception);
3063 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3064 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3065 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3066 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3067 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3072 return MEDFileFields::New();
3075 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3077 return MEDFileFields::New(fileName,loadAll);
3080 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3082 return MEDFileFields::New(db);
3086 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3088 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3091 std::string __str__() const throw(INTERP_KERNEL::Exception)
3093 return self->simpleRepr();
3096 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3098 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3102 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3104 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3108 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3110 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3111 std::size_t sz(tmp.size());
3112 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3113 for(std::size_t i=0;i<sz;i++)
3115 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3116 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3118 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3121 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3123 std::vector< std::pair<std::string,std::string> > ps;
3124 self->getMeshSENames(ps);
3125 return convertVectPairStToPy(ps);
3128 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3131 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3132 PyObject *ret=PyTuple_New(2);
3133 PyObject *ret_0=PyList_New(ret0.size());
3135 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3137 PyObject *elt=PyTuple_New(2);
3138 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3139 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3140 PyList_SetItem(ret_0,rk,elt);
3142 PyTuple_SetItem(ret,0,ret_0);
3143 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3144 PyTuple_SetItem(ret,1,ret_1);
3148 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3150 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3151 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3154 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3156 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3157 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3160 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3162 if(obj && PyList_Check(obj))
3164 int sz=PyList_Size(obj);
3165 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3166 int *pt=da->getPointer();
3167 for(int i=0;i<sz;i++,pt++)
3169 PyObject *elt1=PyList_GetItem(obj,i);
3170 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3172 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3175 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3178 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3180 self->setFieldAtPos(obj,field);
3184 int __len__() const throw(INTERP_KERNEL::Exception)
3186 return self->getNumberOfFields();
3189 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3191 return self->iterator();
3194 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3196 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3197 return self->changeMeshNames(modifTab);
3200 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3202 if(elt0 && PyInt_Check(elt0))
3204 return PyInt_AS_LONG(elt0);
3206 else if(elt0 && PyString_Check(elt0))
3207 return self->getPosFromFieldName(PyString_AsString(elt0));
3209 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3212 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3214 if(PyList_Check(elts))
3216 int sz=PyList_Size(elts);
3217 std::vector<int> ret(sz);
3218 for(int i=0;i<sz;i++)
3220 PyObject *elt=PyList_GetItem(elts,i);
3221 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3227 std::vector<int> ret(1);
3228 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3233 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3235 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3236 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3237 self->pushFields(tmp);
3240 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3242 if(elts && PySlice_Check(elts))
3244 Py_ssize_t strt=2,stp=2,step=2;
3245 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3246 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3247 self->destroyFieldsAtPos2(strt,stp,step);
3251 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3252 if(!idsToRemove.empty())
3253 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3257 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3259 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3260 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3261 return self->extractPart(extractDefCpp,mm);
3266 class MEDFileParameter1TS : public RefCountObject
3269 void setIteration(int it);
3270 int getIteration() const;
3271 void setOrder(int order);
3272 int getOrder() const;
3273 void setTimeValue(double time);
3274 void setTime(int dt, int it, double time);
3275 double getTime(int& dt, int& it);
3276 double getTimeValue() const;
3279 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3282 void setValue(double val) throw(INTERP_KERNEL::Exception);
3283 double getValue() const throw(INTERP_KERNEL::Exception);
3284 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3287 std::string __str__() const throw(INTERP_KERNEL::Exception)
3289 return self->simpleRepr();
3294 class MEDFileParameterTinyInfo : public MEDFileWritable
3297 void setDescription(const std::string& name);
3298 std::string getDescription() const;
3299 void setTimeUnit(const std::string& unit);
3300 std::string getTimeUnit() const;
3303 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3306 static MEDFileParameterDouble1TS *New();
3307 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3308 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3309 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3310 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3311 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3312 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3313 std::string getName() const throw(INTERP_KERNEL::Exception);
3314 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3317 MEDFileParameterDouble1TS()
3319 return MEDFileParameterDouble1TS::New();
3322 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3324 return MEDFileParameterDouble1TS::New(fileName);
3327 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3329 return MEDFileParameterDouble1TS::New(fileName,paramName);
3332 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3334 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3337 std::string __str__() const throw(INTERP_KERNEL::Exception)
3339 return self->simpleRepr();
3342 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3345 bool ret0=self->isEqual(other,eps,what);
3346 PyObject *res=PyList_New(2);
3347 PyObject *ret0Py=ret0?Py_True:Py_False;
3349 PyList_SetItem(res,0,ret0Py);
3350 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3356 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3359 static MEDFileParameterMultiTS *New();
3360 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3361 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3362 std::string getName() const;
3363 void setName(const std::string& name);
3364 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3365 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3366 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3367 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3368 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3369 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3370 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3371 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3374 MEDFileParameterMultiTS()
3376 return MEDFileParameterMultiTS::New();
3379 MEDFileParameterMultiTS(const std::string& fileName)
3381 return MEDFileParameterMultiTS::New(fileName);
3384 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3386 return MEDFileParameterMultiTS::New(fileName,paramName);
3389 std::string __str__() const throw(INTERP_KERNEL::Exception)
3391 return self->simpleRepr();
3394 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3397 bool ret0=self->isEqual(other,eps,what);
3398 PyObject *res=PyList_New(2);
3399 PyObject *ret0Py=ret0?Py_True:Py_False;
3401 PyList_SetItem(res,0,ret0Py);
3402 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3406 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3410 std::vector<int> pos2;
3411 DataArrayInt *pos3=0;
3412 DataArrayIntTuple *pos4=0;
3413 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3418 self->eraseTimeStepIds(&pos1,&pos1+1);
3425 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3430 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3434 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3438 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3440 if(elt0 && PyInt_Check(elt0))
3442 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3445 else if(elt0 && PyTuple_Check(elt0))
3447 if(PyTuple_Size(elt0)==2)
3449 PyObject *o0=PyTuple_GetItem(elt0,0);
3450 PyObject *o1=PyTuple_GetItem(elt0,1);
3451 if(PyInt_Check(o0) && PyInt_Check(o1))
3453 int iter=PyInt_AS_LONG(o0);
3454 int order=PyInt_AS_LONG(o1);
3455 return self->getPosOfTimeStep(iter,order);
3458 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 !");
3461 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 !");
3463 else if(elt0 && PyFloat_Check(elt0))
3465 double val=PyFloat_AS_DOUBLE(elt0);
3466 return self->getPosGivenTime(val);
3469 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3472 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3474 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3480 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3482 if(PyList_Check(elts))
3484 int sz=PyList_Size(elts);
3485 std::vector<int> ret(sz);
3486 for(int i=0;i<sz;i++)
3488 PyObject *elt=PyList_GetItem(elts,i);
3489 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3495 std::vector<int> ret(1);
3496 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3501 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3503 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3504 if(!idsToRemove.empty())
3505 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3508 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3510 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3516 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3518 std::vector< std::pair<int,int> > res=self->getIterations();
3519 PyObject *ret=PyList_New(res.size());
3521 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3523 PyObject *elt=PyTuple_New(2);
3524 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3525 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3526 PyList_SetItem(ret,rk,elt);
3531 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3533 std::vector<double> res2;
3534 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3535 PyObject *ret=PyList_New(res.size());
3537 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3539 PyObject *elt=PyTuple_New(3);
3540 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3541 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3542 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3543 PyList_SetItem(ret,rk,elt);
3550 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3553 static MEDFileParameters *New();
3554 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3555 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3556 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3557 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3558 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3559 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3560 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3561 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3562 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3563 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3564 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3569 return MEDFileParameters::New();
3572 MEDFileParameters(const std::string& fileName)
3574 return MEDFileParameters::New(fileName);
3577 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3579 return MEDFileParameters::New(db);
3583 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3585 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3588 std::string __str__() const throw(INTERP_KERNEL::Exception)
3590 return self->simpleRepr();
3593 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3595 if(PyInt_Check(obj))
3597 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3602 else if(PyString_Check(obj))
3604 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3610 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3613 int __len__() const throw(INTERP_KERNEL::Exception)
3615 return self->getNumberOfParams();
3618 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3620 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3626 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3628 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3634 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3637 bool ret0=self->isEqual(other,eps,what);
3638 PyObject *res=PyList_New(2);
3639 PyObject *ret0Py=ret0?Py_True:Py_False;
3641 PyList_SetItem(res,0,ret0Py);
3642 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3648 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3651 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3652 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3653 static MEDFileData *New();
3654 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3655 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3656 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3657 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3658 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3659 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3660 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3662 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3663 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3664 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3665 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3666 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3670 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3672 return MEDFileData::New(fileName);
3675 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3677 return MEDFileData::New(db);
3682 return MEDFileData::New();
3685 std::string __str__() const throw(INTERP_KERNEL::Exception)
3687 return self->simpleRepr();
3690 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3692 MEDFileMeshes *ret=self->getMeshes();
3698 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3700 MEDFileParameters *ret=self->getParams();
3706 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3708 MEDFileFields *ret=self->getFields();
3714 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3716 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3717 return self->changeMeshNames(modifTab);
3720 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3722 std::vector<const MEDFileData *> mfdsCpp;
3723 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3724 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3729 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3731 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3736 class SauvReader : public RefCountObject
3739 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3740 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3743 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3745 return SauvReader::New(fileName);
3750 class SauvWriter : public RefCountObject
3753 static SauvWriter * New();
3754 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3755 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3756 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3757 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3760 SauvWriter() throw(INTERP_KERNEL::Exception)
3762 return SauvWriter::New();
3769 class MEDFileMeshStruct;
3771 class MEDFileField1TSStructItem
3774 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3777 class MEDFileMeshStruct : public RefCountObject
3780 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3782 ~MEDFileMeshStruct();
3785 class MEDMeshMultiLev : public RefCountObject
3788 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3789 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3790 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3796 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3798 DataArrayInt *famIds(0);
3799 bool isWithoutCopy(false);
3800 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3801 PyObject *ret=PyTuple_New(2);
3802 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3804 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3805 PyTuple_SetItem(ret,1,ret1Py);
3809 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3811 DataArrayInt *numIds(0);
3812 bool isWithoutCopy(false);
3813 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3814 PyObject *ret=PyTuple_New(2);
3815 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3817 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3818 PyTuple_SetItem(ret,1,ret1Py);
3822 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3824 DataArrayInt *famIds(0);
3825 bool isWithoutCopy(false);
3826 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3827 PyObject *ret=PyTuple_New(2);
3828 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3830 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3831 PyTuple_SetItem(ret,1,ret1Py);
3835 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3837 DataArrayInt *numIds(0);
3838 bool isWithoutCopy(false);
3839 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3840 PyObject *ret=PyTuple_New(2);
3841 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3843 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3844 PyTuple_SetItem(ret,1,ret1Py);
3848 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3850 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3851 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3852 PyObject *res(PyList_New(result.size()));
3853 for(int i=0;iL!=result.end(); i++, iL++)
3854 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3860 class MEDUMeshMultiLev : public MEDMeshMultiLev
3863 ~MEDUMeshMultiLev();
3867 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3869 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3870 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3871 PyObject *ret0Py=ncc?Py_True:Py_False;
3873 PyObject *ret=PyTuple_New(7);
3874 PyTuple_SetItem(ret,0,ret0Py);
3875 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3876 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3877 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3878 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3879 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3880 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3886 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3889 ~MEDStructuredMeshMultiLev();
3892 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3895 ~MEDCMeshMultiLev();
3899 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3902 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3903 std::size_t sz(objs.size());
3904 PyObject *ret(PyTuple_New(2));
3905 PyObject *ret0=PyList_New(sz);
3906 for(std::size_t i=0;i<sz;i++)
3907 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3908 PyTuple_SetItem(ret,0,ret0);
3909 PyObject *ret1Py(isInternal?Py_True:Py_False);
3911 PyTuple_SetItem(ret,1,ret1Py);
3917 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3920 ~MEDCurveLinearMeshMultiLev();
3924 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3926 DataArrayDouble *ret0(0);
3927 std::vector<int> ret1;
3929 self->buildVTUArrays(ret0,ret1,ret2);
3930 std::size_t sz(ret1.size());
3931 PyObject *ret=PyTuple_New(3);
3932 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3933 PyObject *ret1Py=PyList_New(sz);
3934 for(std::size_t i=0;i<sz;i++)
3935 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3936 PyTuple_SetItem(ret,1,ret1Py);
3937 PyObject *ret2Py(ret2?Py_True:Py_False);
3939 PyTuple_SetItem(ret,2,ret2Py);
3945 class MEDFileFastCellSupportComparator : public RefCountObject
3948 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3949 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3950 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3951 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3953 ~MEDFileFastCellSupportComparator();
3957 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3959 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3960 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3961 PyObject *res(PyList_New(result.size()));
3962 for(int i=0;iL!=result.end(); i++, iL++)
3963 PyList_SetItem(res,i,PyInt_FromLong(*iL));