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 ReadFieldSwig;
81 %newobject MEDCoupling::ReadUMeshFromFile;
82 %newobject MEDCoupling::ReadMeshFromFile;
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 *ReadFieldCell(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 *ReadFieldNode(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 *ReadFieldGauss(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 *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
339 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
340 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
341 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
342 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
343 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
344 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
347 %rename (MEDFileVersion) MEDFileVersionSwig;
348 %rename (GetFieldIterations) GetFieldIterationsSwig;
349 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
350 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
351 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
352 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
353 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
354 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
355 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
356 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
357 %rename (WriteUMeshes) WriteUMeshesSwig;
358 %rename (GetTypesOfField) GetTypesOfFieldSwig;
359 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
360 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
361 %rename (ReadField) ReadFieldSwig;
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 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName) throw(INTERP_KERNEL::Exception)
378 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName));
382 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
384 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName));
388 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
390 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(fileName,fieldName,iteration,order));
394 MEDCoupling::MEDCouplingFieldDouble *ReadFieldSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception)
396 MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret(MEDCoupling::ReadField(type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
400 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
402 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
403 PyObject *ret=PyList_New(res.size());
405 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
407 PyObject *elt=PyTuple_New(2);
408 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
409 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
410 PyList_SetItem(ret,rk,elt);
415 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
417 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
418 PyObject *ret=PyList_New(res.size());
420 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
422 PyObject *elt=PyTuple_New(3);
423 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
424 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
425 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
426 PyList_SetItem(ret,rk,elt);
431 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
433 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
434 PyObject *ret=PyList_New(res.size());
436 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
438 PyObject *elt=PyTuple_New(2);
439 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
440 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
441 PyList_SetItem(ret,rk,elt);
446 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
448 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
449 PyObject *ret=PyList_New(res.size());
451 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
453 PyObject *elt=PyTuple_New(2);
454 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
455 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
456 PyList_SetItem(ret,rk,elt);
461 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
463 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
464 PyObject *ret=PyList_New(res.size());
466 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
468 PyObject *elt=PyTuple_New(2);
469 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
470 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
471 PyList_SetItem(ret,rk,elt);
476 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
478 int meshDim,spaceDim,numberOfNodes;
479 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
480 PyObject *ret=PyTuple_New(4);
481 PyObject *elt0=PyList_New(res.size());
483 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
485 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
487 PyObject *elt1=PyList_New(obj2.size());
488 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
490 PyObject *elt2=PyTuple_New(2);
491 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
492 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
493 PyList_SetItem(elt1,j,elt2);
495 PyList_SetItem(elt0,i,elt1);
497 PyTuple_SetItem(ret,0,elt0);
498 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
499 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
500 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
504 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
505 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
507 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
508 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
509 return convertFieldDoubleVecToPy(res);
512 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
514 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
515 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
516 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
519 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
521 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
522 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
523 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
526 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
528 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
529 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
530 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
533 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
535 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
537 PyObject *ret=PyList_New(size);
538 for(int i=0;i<size;i++)
539 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
543 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
545 std::vector<std::string> grps;
546 converPyListToVecString(li,grps);
547 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
550 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
552 std::vector<std::string> fams;
553 converPyListToVecString(li,fams);
554 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
558 namespace MEDCoupling
560 class MEDFileWritable
563 void copyOptionsFrom(const MEDFileWritable& other) const;
564 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
565 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
566 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
567 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
570 class MEDFileWritableStandAlone : public MEDFileWritable
573 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
574 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
577 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
579 MCAuto<DataArrayByte> ret(self->serialize());
583 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
585 PyObject *ret(PyList_New(0));
589 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
593 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
596 PyObject *ret(PyTuple_New(1));
597 PyObject *ret0(PyDict_New());
598 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
599 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
600 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
601 PyObject *tmp1(PyInt_FromLong(0));
602 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
603 PyTuple_SetItem(ret,0,ret0);
607 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
613 class MEDFileMeshReadSelector
616 MEDFileMeshReadSelector();
617 MEDFileMeshReadSelector(unsigned int code);
618 unsigned int getCode() const;
619 void setCode(unsigned int newCode);
620 bool isCellFamilyFieldReading() const;
621 bool isNodeFamilyFieldReading() const;
622 bool isCellNameFieldReading() const;
623 bool isNodeNameFieldReading() const;
624 bool isCellNumFieldReading() const;
625 bool isNodeNumFieldReading() const;
626 void setCellFamilyFieldReading(bool b);
627 void setNodeFamilyFieldReading(bool b);
628 void setCellNameFieldReading(bool b);
629 void setNodeNameFieldReading(bool b);
630 void setCellNumFieldReading(bool b);
631 void setNodeNumFieldReading(bool b);
634 std::string __str__() const throw(INTERP_KERNEL::Exception)
636 std::ostringstream oss;
641 std::string __repr__() const throw(INTERP_KERNEL::Exception)
643 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
649 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
652 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
653 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
654 throw(INTERP_KERNEL::Exception);
655 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
656 INTERP_KERNEL::NormalizedCellType loc_geo_type,
657 INTERP_KERNEL::NormalizedCellType rem_geo_type)
658 throw(INTERP_KERNEL::Exception);
659 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
660 MEDFileJointCorrespondence *deepCopy() const;
661 MEDFileJointCorrespondence *shallowCpy() const;
662 void setIsNodal(bool isNodal);
663 bool getIsNodal() const;
664 bool isEqual(const MEDFileJointCorrespondence *other) const;
665 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
666 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
667 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
668 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
669 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
670 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
671 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);
672 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
675 MEDFileJointCorrespondence()
677 return MEDFileJointCorrespondence::New();
679 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
681 return MEDFileJointCorrespondence::New(correspondence);
683 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
684 INTERP_KERNEL::NormalizedCellType loc_geo_type,
685 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
687 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
690 std::string __str__() const throw(INTERP_KERNEL::Exception)
692 return self->simpleRepr();
697 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
700 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
701 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
702 MEDFileJointOneStep *deepCopy() const;
703 MEDFileJointOneStep *shallowCpy() const;
704 bool isEqual(const MEDFileJointOneStep *other) const;
705 void setOrder(int order);
706 int getOrder() const;
707 void setIteration(int it);
708 int getIteration() const;
709 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
710 int getNumberOfCorrespondences() const;
711 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
712 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
713 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
716 MEDFileJointOneStep()
718 return MEDFileJointOneStep::New();
721 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
723 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
726 std::string __str__() const throw(INTERP_KERNEL::Exception)
728 return self->simpleRepr();
733 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
736 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
737 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
738 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
739 MEDFileJoint *deepCopy() const;
740 MEDFileJoint *shallowCpy() const;
741 bool isEqual(const MEDFileJoint *other) const;
742 void setLocalMeshName(const std::string& name);
743 std::string getLocalMeshName() const;
744 void setRemoteMeshName(const std::string& name);
745 std::string getRemoteMeshName() const;
746 void setDescription(const std::string& name);
747 std::string getDescription() const;
748 void setJointName(const std::string& name);
749 std::string getJointName() const;
750 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
751 void setDomainNumber(const int& number);
752 int getDomainNumber() const;
753 void pushStep(MEDFileJointOneStep* step);
754 int getNumberOfSteps() const;
755 MEDFileJointOneStep *getStepAtPos(int i) const;
756 std::string simpleRepr() const;
761 return MEDFileJoint::New();
764 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
766 return MEDFileJoint::New(fileName,mName,num);
769 std::string __str__() const throw(INTERP_KERNEL::Exception)
771 return self->simpleRepr();
776 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
779 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
780 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
781 MEDFileJoints *deepCopy() const;
782 std::string simpleRepr() const;
783 std::string getMeshName() const;
784 int getNumberOfJoints() const;
785 std::vector<std::string> getJointsNames() const;
786 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
787 void resize(int newSize) throw(INTERP_KERNEL::Exception);
788 void pushJoint(MEDFileJoint *joint);
789 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
790 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
795 return MEDFileJoints::New();
798 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
800 return MEDFileJoints::New(fileName,meshName);
803 std::string __str__() const throw(INTERP_KERNEL::Exception)
805 return self->simpleRepr();
808 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
812 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
817 else if(PyString_Check(obj))
819 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
825 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
828 int __len__() const throw(INTERP_KERNEL::Exception)
830 return self->getNumberOfJoints();
833 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
835 MEDFileJoint *ret=self->getJointAtPos(i);
841 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
843 MEDFileJoint *ret=self->getJointWithName(paramName);
851 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
854 MEDFileEquivalenceBase();
857 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
860 MEDFileEquivalenceData();
862 void setArray(DataArrayInt *data);
865 DataArrayInt *getArray()
867 DataArrayInt *ret(self->getArray());
868 if(ret) ret->incrRef();
874 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
877 MEDFileEquivalenceNode();
880 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
883 MEDFileEquivalenceCell();
886 std::size_t size() const;
887 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
888 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
891 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
893 DataArrayInt *ret(self->getArray(type));
894 if(ret) ret->incrRef();
898 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
900 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
901 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
902 PyObject *res=PyList_New(result.size());
903 for(int i=0;iL!=result.end(); i++, iL++)
904 PyList_SetItem(res,i,PyInt_FromLong(*iL));
910 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
913 MEDFileEquivalencePair();
915 std::string getName() const;
916 void setName(const std::string& name);
917 std::string getDescription() const;
918 void setDescription(const std::string& descr);
919 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
922 MEDFileEquivalenceCell *initCell()
924 MEDFileEquivalenceCell *ret(self->initCell());
925 if(ret) ret->incrRef();
929 MEDFileEquivalenceNode *initNode()
931 MEDFileEquivalenceNode *ret(self->initNode());
932 if(ret) ret->incrRef();
936 MEDFileEquivalenceCell *getCell()
938 MEDFileEquivalenceCell *ret(self->getCell());
939 if(ret) ret->incrRef();
943 MEDFileEquivalenceNode *getNode()
945 MEDFileEquivalenceNode *ret(self->getNode());
946 if(ret) ret->incrRef();
952 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
955 MEDFileEquivalences();
958 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
959 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
960 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
964 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
966 MEDFileEquivalencePair *ret(self->getEquivalence(i));
967 if(ret) ret->incrRef();
970 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
972 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
973 if(ret) ret->incrRef();
977 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
979 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
980 if(ret) ret->incrRef();
986 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
989 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
990 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
991 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
992 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
993 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
994 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
995 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
996 void setName(const std::string& name);
997 std::string getName();
998 std::string getUnivName() const;
999 bool getUnivNameWrStatus() const;
1000 void setUnivNameWrStatus(bool newStatus);
1001 void setDescription(const std::string& name);
1002 std::string getDescription() const;
1003 void setOrder(int order);
1004 int getOrder() const;
1005 void setIteration(int it);
1007 void setTimeValue(double time);
1008 void setTime(int dt, int it, double time);
1009 double getTimeValue() const;
1010 void setTimeUnit(const std::string& unit);
1011 std::string getTimeUnit() const;
1012 void setAxisType(MEDCouplingAxisType at);
1013 MEDCouplingAxisType getAxisType() const;
1014 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
1015 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1016 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
1017 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1018 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
1019 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
1020 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1021 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1022 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1023 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
1024 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1025 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1026 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1027 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1029 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1030 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1031 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1032 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1033 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1034 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1035 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1036 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1037 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1038 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1039 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1040 void clearFamMap() throw(INTERP_KERNEL::Exception);
1041 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1042 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1043 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1044 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1045 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1046 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1047 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1048 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1049 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1050 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1051 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1052 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1053 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1054 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1055 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1056 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1057 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1058 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1059 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1060 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1061 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1062 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1063 static std::string GetMagicFamilyStr();
1064 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1065 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1066 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1067 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1068 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1069 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1070 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1071 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1072 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1073 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1074 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1075 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1076 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1077 void setFamilyInfo(const std::map<std::string,int>& info);
1078 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1079 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1080 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1081 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1082 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1083 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1084 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1085 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1086 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1087 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1088 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1089 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1090 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1091 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1092 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1093 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1094 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1095 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1096 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1097 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1098 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1100 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1101 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1102 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1103 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1104 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1105 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1106 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1107 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1108 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1109 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1110 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1111 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1112 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1113 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1114 int getNumberOfJoints();
1115 MEDFileJoints *getJoints();
1116 void setJoints( MEDFileJoints* joints );
1117 void initializeEquivalences();
1118 void killEquivalences();
1119 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1120 void killStructureElements() throw(INTERP_KERNEL::Exception);
1123 std::string __str__() const throw(INTERP_KERNEL::Exception)
1125 return self->simpleRepr();
1128 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1130 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1133 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1136 double tmp0=self->getTime(tmp1,tmp2);
1137 PyObject *res = PyList_New(3);
1138 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1139 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1140 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1144 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1147 bool ret0=self->isEqual(other,eps,what);
1148 PyObject *res=PyList_New(2);
1149 PyObject *ret0Py=ret0?Py_True:Py_False;
1151 PyList_SetItem(res,0,ret0Py);
1152 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1156 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1158 std::vector<const DataArrayInt *> grps;
1159 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1160 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1163 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1166 bool ret0=self->areFamsEqual(other,what);
1167 PyObject *res=PyList_New(2);
1168 PyObject *ret0Py=ret0?Py_True:Py_False;
1170 PyList_SetItem(res,0,ret0Py);
1171 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1175 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1178 bool ret0=self->areGrpsEqual(other,what);
1179 PyObject *res=PyList_New(2);
1180 PyObject *ret0Py=ret0?Py_True:Py_False;
1182 PyList_SetItem(res,0,ret0Py);
1183 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1187 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1189 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1190 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1191 PyObject *res=PyList_New(result.size());
1192 for(int i=0;iL!=result.end(); i++, iL++)
1193 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1197 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1199 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1200 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1201 PyObject *res=PyList_New(result.size());
1202 for(int i=0;iL!=result.end(); i++, iL++)
1203 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1207 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1209 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1212 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1215 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1217 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1220 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1223 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1225 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1228 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1231 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1233 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1236 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1239 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1241 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1244 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1247 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1250 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1251 PyObject *ret=PyTuple_New(2);
1252 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1253 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1257 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1259 DataArrayInt *ret3=0;
1260 std::vector<int> ret1,ret2;
1261 bool ret0=self->unPolyze(ret1,ret2,ret3);
1262 PyObject *ret=PyTuple_New(4);
1263 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1265 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1266 for(int j=0;j<(int)ret1.size()/3;j++)
1268 PyObject *retLev2=PyList_New(3);
1269 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1270 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1271 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1272 PyList_SetItem(retLev1_0,j,retLev2);
1274 PyTuple_SetItem(ret,1,retLev1_0);
1276 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1277 for(int j=0;j<(int)ret2.size()/3;j++)
1279 PyObject *retLev2=PyList_New(3);
1280 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1281 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1282 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1283 PyList_SetItem(retLev1_1,j,retLev2);
1285 PyTuple_SetItem(ret,2,retLev1_1);
1287 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1291 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1293 MEDFileEquivalences *ret(self->getEquivalences());
1294 if(ret) ret->incrRef();
1300 class MEDFileUMesh : public MEDFileMesh
1303 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1304 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1305 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1306 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1307 static MEDFileUMesh *New();
1308 static const char *GetSpeStr4ExtMesh();
1310 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1311 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1312 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1313 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1314 void clearNodeAndCellNumbers();
1316 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1317 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1318 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1319 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1320 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1321 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1322 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1323 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1324 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1325 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1327 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1328 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1329 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1330 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1331 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1332 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1333 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1334 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1335 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1336 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1337 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1338 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1339 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1340 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1341 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1344 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1346 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1349 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1351 return MEDFileUMesh::New(fileName,mrs);
1354 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1356 return MEDFileUMesh::New(mem);
1359 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1361 return MEDFileUMesh::New(db);
1366 return MEDFileUMesh::New();
1370 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1372 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1375 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)
1377 std::vector<int> typesCpp1;
1378 convertPyToNewIntArr3(types,typesCpp1);
1379 std::size_t sz(typesCpp1.size());
1380 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1381 for(std::size_t ii=0;ii<sz;ii++)
1382 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1383 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1386 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1387 {// put an empty dict in input to say to __new__ to call __init__...
1388 PyObject *ret(PyTuple_New(1));
1389 PyObject *ret0(PyDict_New());
1390 PyTuple_SetItem(ret,0,ret0);
1394 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1396 std::vector<double> a0;
1397 std::vector<int> a1;
1398 std::vector<std::string> a2;
1399 std::vector< MCAuto<DataArrayInt> > a3;
1400 MCAuto<DataArrayDouble> a4;
1401 self->serialize(a0,a1,a2,a3,a4);
1402 PyObject *ret(PyTuple_New(5));
1403 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1404 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1406 PyObject *ret2(PyList_New(sz));
1407 for(int i=0;i<sz;i++)
1408 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1409 PyTuple_SetItem(ret,2,ret2);
1411 PyObject *ret3(PyList_New(sz));
1412 for(int i=0;i<sz;i++)
1414 DataArrayInt *elt(a3[i]);
1417 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1419 PyTuple_SetItem(ret,3,ret3);
1420 DataArrayDouble *ret4(a4);
1423 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1427 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1429 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1430 if(!PyTuple_Check(inp))
1431 throw INTERP_KERNEL::Exception(MSG);
1432 int sz(PyTuple_Size(inp));
1434 throw INTERP_KERNEL::Exception(MSG);
1435 std::vector<double> a0;
1436 std::vector<int> a1;
1437 std::vector<std::string> a2;
1438 std::vector< MCAuto<DataArrayInt> > a3;
1439 MCAuto<DataArrayDouble> a4;
1441 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1443 fillArrayWithPyListDbl3(a0py,tmp,a0);
1444 convertPyToNewIntArr3(a1py,a1);
1445 fillStringVector(a2py,a2);
1447 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1449 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1450 if(!SWIG_IsOK(status))
1451 throw INTERP_KERNEL::Exception(MSG);
1452 a4=reinterpret_cast<DataArrayDouble *>(argp);
1453 if((DataArrayDouble *)a4)
1456 std::vector< DataArrayInt * > a3Tmp;
1457 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1458 std::size_t sz(a3Tmp.size());
1460 for(std::size_t i=0;i<sz;i++)
1464 a3Tmp[i]->incrRef();
1466 self->unserialize(a0,a1,a2,a3,a4);
1470 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1473 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1474 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1477 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1480 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1483 self->setMeshAtLevel(meshDimRelToMax,m1);
1486 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1489 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1491 self->removeMeshAtLevel(meshDimRelToMax);
1494 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1496 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1498 DataArrayDouble *a,*a2;
1499 DataArrayDoubleTuple *aa,*aa2;
1500 std::vector<double> bb,bb2;
1502 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1503 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1504 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1508 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1510 std::vector<const MEDFileUMesh *> meshesCpp;
1511 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1512 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1516 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1518 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1519 return convertVecPairIntToPy(ret);
1522 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1524 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1525 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1526 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1529 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1531 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1532 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1533 return self->extractPart(extractDefCpp);
1536 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1538 std::vector<const MEDCouplingUMesh *> ms;
1539 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1540 self->setMeshes(ms,renum);
1543 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1545 std::vector<const MEDCouplingUMesh *> ms;
1546 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1547 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1550 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1552 std::vector<const MEDCouplingUMesh *> ms;
1553 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1554 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1557 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1559 DataArrayDouble *ret=self->getCoords();
1565 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1567 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1570 return const_cast<PartDefinition *>(ret);
1573 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1575 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1576 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1577 PyObject *ret=PyTuple_New(3);
1578 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1579 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1580 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1584 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1586 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1592 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1594 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1595 std::size_t sz(tmp.size());
1596 PyObject *ret=PyList_New(sz);
1597 for(std::size_t i=0;i<sz;i++)
1601 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1608 class MEDFileStructuredMesh : public MEDFileMesh
1613 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1615 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1623 class MEDFileCMesh : public MEDFileStructuredMesh
1626 static MEDFileCMesh *New();
1627 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1628 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1629 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1630 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1631 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1636 return MEDFileCMesh::New();
1639 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1641 return MEDFileCMesh::New(fileName,mrs);
1644 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1646 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1649 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1651 return MEDFileCMesh::New(db);
1655 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1657 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1660 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1662 const MEDCouplingCMesh *tmp=self->getMesh();
1665 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1670 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1673 static MEDFileCurveLinearMesh *New();
1674 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1675 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1676 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1677 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1680 MEDFileCurveLinearMesh()
1682 return MEDFileCurveLinearMesh::New();
1685 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1687 return MEDFileCurveLinearMesh::New(fileName,mrs);
1690 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1692 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1695 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1697 return MEDFileCurveLinearMesh::New(db);
1701 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1703 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1706 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1708 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1711 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1716 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1719 static MEDFileMeshMultiTS *New();
1720 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1721 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1722 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1723 std::string getName() const throw(INTERP_KERNEL::Exception);
1724 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1725 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1728 MEDFileMeshMultiTS()
1730 return MEDFileMeshMultiTS::New();
1733 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1735 return MEDFileMeshMultiTS::New(fileName);
1738 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1740 return MEDFileMeshMultiTS::New(fileName,mName);
1743 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1745 MEDFileMesh *ret=self->getOneTimeStep();
1753 class MEDFileMeshesIterator
1758 PyObject *next() throw(INTERP_KERNEL::Exception)
1760 MEDFileMesh *ret=self->nextt();
1764 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1768 PyErr_SetString(PyExc_StopIteration,"No more data.");
1775 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1778 static MEDFileMeshes *New();
1779 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1780 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1781 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1782 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1784 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1785 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1786 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1787 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1788 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1789 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1790 void killStructureElements() throw(INTERP_KERNEL::Exception);
1795 return MEDFileMeshes::New();
1798 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1800 return MEDFileMeshes::New(fileName);
1803 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1805 return MEDFileMeshes::New(db);
1809 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1811 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1814 std::string __str__() const throw(INTERP_KERNEL::Exception)
1816 return self->simpleRepr();
1819 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1821 if(PyInt_Check(obj))
1823 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1828 else if(PyString_Check(obj))
1830 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1836 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1839 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1841 self->setMeshAtPos(obj,mesh);
1845 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1847 return self->iterator();
1850 int __len__() const throw(INTERP_KERNEL::Exception)
1852 return self->getNumberOfMeshes();
1855 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1857 MEDFileMesh *ret=self->getMeshAtPos(i);
1862 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1864 MEDFileMesh *ret=self->getMeshWithName(mname);
1872 class MEDFileFieldLoc : public RefCountObject
1875 std::string getName() const;
1876 int getDimension() const;
1877 int getNumberOfGaussPoints() const;
1878 int getNumberOfPointsInCells() const;
1879 const std::vector<double>& getRefCoords() const;
1880 const std::vector<double>& getGaussCoords() const;
1881 const std::vector<double>& getGaussWeights() const;
1882 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1885 std::string __str__() const throw(INTERP_KERNEL::Exception)
1887 return self->repr();
1892 class MEDFileFieldGlobsReal
1895 void resetContent();
1896 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1897 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1898 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1899 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1900 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1901 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1902 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1903 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1904 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1905 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1906 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1907 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1908 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1909 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1910 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1911 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1912 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1913 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1914 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1915 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1916 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1917 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1918 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1919 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1920 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1921 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1922 void killStructureElementsInGlobs() throw(INTERP_KERNEL::Exception);
1925 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1927 const DataArrayInt *ret=self->getProfile(pflName);
1930 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1933 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1935 const DataArrayInt *ret=self->getProfileFromId(pflId);
1938 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1941 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1943 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1946 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1949 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1951 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1954 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1957 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1959 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1960 return convertVecPairVecStToPy(ret);
1963 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1965 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1966 return convertVecPairVecStToPy(ret);
1969 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1971 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1972 self->changePflsNames(v);
1975 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1977 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1978 self->changePflsRefsNamesGen(v);
1981 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1983 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1984 self->changePflsNamesInStruct(v);
1987 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1989 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1990 self->changeLocsNames(v);
1993 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1995 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1996 self->changeLocsRefsNamesGen(v);
1999 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
2001 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
2002 self->changeLocsNamesInStruct(v);
2005 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
2007 std::ostringstream oss;
2008 self->simpleReprGlobs(oss);
2014 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2017 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2018 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2019 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2020 void loadArrays() throw(INTERP_KERNEL::Exception);
2021 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2022 void unloadArrays() throw(INTERP_KERNEL::Exception);
2023 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2024 int getDimension() const throw(INTERP_KERNEL::Exception);
2025 int getIteration() const throw(INTERP_KERNEL::Exception);
2026 int getOrder() const throw(INTERP_KERNEL::Exception);
2027 std::string getName() throw(INTERP_KERNEL::Exception);
2028 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2029 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2030 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2031 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2032 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2033 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2034 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2035 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2036 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2037 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2038 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2039 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2040 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2041 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2042 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2045 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2048 double tmp0=self->getTime(tmp1,tmp2);
2049 PyObject *res = PyList_New(3);
2050 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2051 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2052 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2056 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2058 std::pair<int,int> res=self->getDtIt();
2059 PyObject *elt=PyTuple_New(2);
2060 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2061 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2065 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2067 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2070 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2072 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2075 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2077 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2078 return self->changeMeshNames(modifTab);
2081 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2083 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2084 PyObject *ret2=PyList_New(ret.size());
2085 for(int i=0;i<(int)ret.size();i++)
2086 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2090 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2092 std::vector<int> ret1;
2093 int ret0=self->getNonEmptyLevels(mname,ret1);
2094 PyObject *elt=PyTuple_New(2);
2095 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2096 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2100 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2102 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2103 std::vector< std::vector<TypeOfField> > typesF;
2104 std::vector< std::vector<std::string> > pfls;
2105 std::vector< std::vector<std::string> > locs;
2106 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2108 PyObject *ret2=PyList_New(sz);
2109 for(int i=0;i<sz;i++)
2111 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2112 const std::vector<TypeOfField>& typesFI=typesF[i];
2113 const std::vector<std::string>& pflsI=pfls[i];
2114 const std::vector<std::string>& locsI=locs[i];
2115 PyObject *elt=PyTuple_New(2);
2116 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2117 int sz2=ret[i].size();
2118 PyObject *elt2=PyList_New(sz2);
2119 for(int j=0;j<sz2;j++)
2121 PyObject *elt3=PyTuple_New(4);
2122 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2123 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));
2124 PyTuple_SetItem(elt3,1,elt4);
2125 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2126 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2127 PyList_SetItem(elt2,j,elt3);
2129 PyTuple_SetItem(elt,1,elt2);
2130 PyList_SetItem(ret2,i,elt);
2135 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2137 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2138 std::size_t sz=ret.size();
2139 PyObject *retPy=PyList_New(sz);
2140 for(std::size_t i=0;i<sz;i++)
2141 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2145 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2147 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2148 std::size_t sz=ret.size();
2149 PyObject *retPy=PyList_New(sz);
2150 for(std::size_t i=0;i<sz;i++)
2151 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2155 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2157 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2158 std::size_t sz=ret.size();
2159 PyObject *retPy=PyList_New(sz);
2160 for(std::size_t i=0;i<sz;i++)
2161 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2165 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2167 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2168 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2169 return self->extractPart(extractDefCpp,mm);
2174 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2177 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2178 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2179 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2180 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2181 static MEDFileField1TS *New();
2182 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2183 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2184 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2185 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2186 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2187 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2188 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2190 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2191 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2192 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2193 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2196 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2198 return MEDFileField1TS::New(fileName,loadAll);
2201 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2203 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2206 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2208 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2211 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2213 return MEDFileField1TS::New(db);
2218 return MEDFileField1TS::New();
2222 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2224 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2227 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2229 const DataArrayDouble *arr=0;
2231 arr=field->getArray();
2232 self->copyTinyInfoFrom(field,arr);
2235 std::string __str__() const throw(INTERP_KERNEL::Exception)
2237 return self->simpleRepr();
2240 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2242 DataArrayInt *ret1=0;
2243 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2244 PyObject *ret=PyTuple_New(2);
2245 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2246 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2250 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2252 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2253 std::vector< std::vector<TypeOfField> > typesF;
2254 std::vector< std::vector<std::string> > pfls;
2255 std::vector< std::vector<std::string> > locs;
2256 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2258 PyObject *ret2=PyList_New(sz);
2259 for(int i=0;i<sz;i++)
2261 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2262 const std::vector<TypeOfField>& typesFI=typesF[i];
2263 const std::vector<std::string>& pflsI=pfls[i];
2264 const std::vector<std::string>& locsI=locs[i];
2265 PyObject *elt=PyTuple_New(2);
2266 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2267 int sz2=ret[i].size();
2268 PyObject *elt2=PyList_New(sz2);
2269 for(int j=0;j<sz2;j++)
2271 PyObject *elt3=PyTuple_New(4);
2272 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2273 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2274 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2275 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2276 PyList_SetItem(elt2,j,elt3);
2278 PyTuple_SetItem(elt,1,elt2);
2279 PyList_SetItem(ret2,i,elt);
2284 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2286 DataArrayDouble *ret=self->getUndergroundDataArray();
2292 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2294 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2295 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2298 PyObject *ret=PyTuple_New(2);
2299 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2300 std::size_t sz=elt1Cpp.size();
2301 PyObject *elt=PyList_New(sz);
2302 for(std::size_t i=0;i<sz;i++)
2304 PyObject *elt1=PyTuple_New(2);
2305 PyObject *elt2=PyTuple_New(2);
2306 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2307 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2308 PyObject *elt3=PyTuple_New(2);
2309 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2310 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2311 PyTuple_SetItem(elt1,0,elt2);
2312 PyTuple_SetItem(elt1,1,elt3);
2313 PyList_SetItem(elt,i,elt1);
2315 PyTuple_SetItem(ret,1,elt);
2321 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2324 static MEDFileIntField1TS *New();
2325 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2326 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2327 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2328 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2329 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2331 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2332 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2333 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2334 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2335 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2336 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2337 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2338 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2341 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2343 return MEDFileIntField1TS::New();
2346 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2348 return MEDFileIntField1TS::New(fileName,loadAll);
2351 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2353 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2356 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2358 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2361 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2363 return MEDFileIntField1TS::New(db);
2367 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2369 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2372 std::string __str__() const throw(INTERP_KERNEL::Exception)
2374 return self->simpleRepr();
2377 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2379 DataArrayInt *ret1=0;
2380 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2381 PyObject *ret=PyTuple_New(2);
2382 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2383 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2387 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2389 DataArrayInt *ret=self->getUndergroundDataArray();
2397 class MEDFileAnyTypeFieldMultiTSIterator
2402 PyObject *next() throw(INTERP_KERNEL::Exception)
2404 MEDFileAnyTypeField1TS *ret=self->nextt();
2406 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2409 PyErr_SetString(PyExc_StopIteration,"No more data.");
2416 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2419 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2420 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2421 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2422 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2423 std::string getName() const throw(INTERP_KERNEL::Exception);
2424 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2425 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2426 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2427 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2428 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2429 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2430 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2431 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2432 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2433 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2434 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2435 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2436 void loadArrays() throw(INTERP_KERNEL::Exception);
2437 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2438 void unloadArrays() throw(INTERP_KERNEL::Exception);
2439 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2441 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2442 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2443 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2444 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2445 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2446 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2449 int __len__() const throw(INTERP_KERNEL::Exception)
2451 return self->getNumberOfTS();
2454 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2456 if(elt0 && PyInt_Check(elt0))
2458 int pos=PyInt_AS_LONG(elt0);
2461 else if(elt0 && PyTuple_Check(elt0))
2463 if(PyTuple_Size(elt0)==2)
2465 PyObject *o0=PyTuple_GetItem(elt0,0);
2466 PyObject *o1=PyTuple_GetItem(elt0,1);
2467 if(PyInt_Check(o0) && PyInt_Check(o1))
2469 int iter=PyInt_AS_LONG(o0);
2470 int order=PyInt_AS_LONG(o1);
2471 return self->getPosOfTimeStep(iter,order);
2474 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 !");
2477 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 !");
2479 else if(elt0 && PyFloat_Check(elt0))
2481 double val=PyFloat_AS_DOUBLE(elt0);
2482 return self->getPosGivenTime(val);
2485 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2488 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2490 std::vector< std::pair<int,int> > res(self->getIterations());
2491 return convertVecPairIntToPy(res);
2494 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2496 std::vector<double> ret1;
2497 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2498 std::size_t sz=ret.size();
2499 PyObject *ret2=PyList_New(sz);
2500 for(std::size_t i=0;i<sz;i++)
2502 PyObject *elt=PyTuple_New(3);
2503 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2504 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2505 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2506 PyList_SetItem(ret2,i,elt);
2511 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2513 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2514 PyObject *ret2=PyList_New(ret.size());
2515 for(int i=0;i<(int)ret.size();i++)
2517 const std::vector<TypeOfField>& rett=ret[i];
2518 PyObject *ret3=PyList_New(rett.size());
2519 for(int j=0;j<(int)rett.size();j++)
2520 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2521 PyList_SetItem(ret2,i,ret3);
2526 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2528 std::vector<int> ret1;
2529 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2530 PyObject *elt=PyTuple_New(2);
2531 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2532 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2536 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2538 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2539 std::vector< std::vector<TypeOfField> > typesF;
2540 std::vector< std::vector<std::string> > pfls;
2541 std::vector< std::vector<std::string> > locs;
2542 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2544 PyObject *ret2=PyList_New(sz);
2545 for(int i=0;i<sz;i++)
2547 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2548 const std::vector<TypeOfField>& typesFI=typesF[i];
2549 const std::vector<std::string>& pflsI=pfls[i];
2550 const std::vector<std::string>& locsI=locs[i];
2551 PyObject *elt=PyTuple_New(2);
2552 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2553 int sz2=ret[i].size();
2554 PyObject *elt2=PyList_New(sz2);
2555 for(int j=0;j<sz2;j++)
2557 PyObject *elt3=PyTuple_New(4);
2558 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2559 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));
2560 PyTuple_SetItem(elt3,1,elt4);
2561 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2562 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2563 PyList_SetItem(elt2,j,elt3);
2565 PyTuple_SetItem(elt,1,elt2);
2566 PyList_SetItem(ret2,i,elt);
2571 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2573 if(PyList_Check(elts))
2575 int sz=PyList_Size(elts);
2576 std::vector<int> ret(sz);
2577 for(int i=0;i<sz;i++)
2579 PyObject *elt=PyList_GetItem(elts,i);
2580 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2586 std::vector<int> ret(1);
2587 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2592 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2594 if(PySlice_Check(elts))
2596 Py_ssize_t strt=2,stp=2,step=2;
2597 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2598 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2599 self->eraseTimeStepIds2(strt,stp,step);
2603 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2604 if(!idsToRemove.empty())
2605 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2609 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2613 std::vector<int> pos2;
2614 DataArrayInt *pos3=0;
2615 DataArrayIntTuple *pos4=0;
2616 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2621 self->eraseTimeStepIds(&pos1,&pos1+1);
2628 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2633 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2637 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2641 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2643 return self->iterator();
2646 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2648 if(elt0 && PyList_Check(elt0))
2650 int sz=PyList_Size(elt0);
2651 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2652 int *pt=da->getPointer();
2653 for(int i=0;i<sz;i++,pt++)
2655 PyObject *elt1=PyList_GetItem(elt0,i);
2656 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2658 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2660 else if(elt0 && PySlice_Check(elt0))
2662 Py_ssize_t strt=2,stp=2,step=2;
2663 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2664 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2665 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2668 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2671 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2673 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2674 return self->changeMeshNames(modifTab);
2677 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2679 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2680 std::size_t sz=ret.size();
2681 PyObject *retPy=PyList_New(sz);
2682 for(std::size_t i=0;i<sz;i++)
2683 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2687 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2689 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2690 std::size_t sz=ret.size();
2691 PyObject *retPy=PyList_New(sz);
2692 for(std::size_t i=0;i<sz;i++)
2693 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2697 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2699 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2700 std::size_t sz=ret.size();
2701 PyObject *retPy=PyList_New(sz);
2702 for(std::size_t i=0;i<sz;i++)
2703 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2707 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2710 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2711 if(SWIG_IsOK(status))
2713 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2717 std::vector<MEDFileAnyTypeField1TS *> tmp;
2718 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2719 self->pushBackTimeSteps(tmp);
2723 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2725 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2726 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2727 return self->extractPart(extractDefCpp,mm);
2730 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2732 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2733 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2734 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2735 std::size_t sz=ret.size();
2736 PyObject *retPy=PyList_New(sz);
2737 for(std::size_t i=0;i<sz;i++)
2739 std::size_t sz2=ret[i].size();
2740 PyObject *ret1Py=PyList_New(sz2);
2741 for(std::size_t j=0;j<sz2;j++)
2743 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2746 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2748 PyList_SetItem(retPy,i,ret1Py);
2753 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2755 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2756 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2757 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2758 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2759 if(ret2.size()!=ret.size())
2761 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2762 throw INTERP_KERNEL::Exception(oss.str().c_str());
2764 std::size_t sz=ret.size();
2765 PyObject *retPy=PyList_New(sz);
2766 for(std::size_t i=0;i<sz;i++)
2768 std::size_t sz2=ret[i].size();
2769 PyObject *ret0Py=PyTuple_New(2);
2770 PyObject *ret1Py=PyList_New(sz2);
2771 for(std::size_t j=0;j<sz2;j++)
2773 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2776 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2778 PyTuple_SetItem(ret0Py,0,ret1Py);
2779 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2780 PyList_SetItem(retPy,i,ret0Py);
2787 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2790 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2791 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2792 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2793 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2795 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2796 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2797 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2798 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2799 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2800 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2802 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2803 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2804 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2807 MEDFileFieldMultiTS()
2809 return MEDFileFieldMultiTS::New();
2812 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2814 return MEDFileFieldMultiTS::New(fileName,loadAll);
2817 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2819 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2822 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2824 return MEDFileFieldMultiTS::New(db);
2828 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2830 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2833 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2835 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2836 std::size_t sz(tmp.size());
2837 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2838 for(std::size_t i=0;i<sz;i++)
2840 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2841 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2843 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2846 std::string __str__() const throw(INTERP_KERNEL::Exception)
2848 return self->simpleRepr();
2851 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2853 DataArrayInt *ret1=0;
2854 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2855 PyObject *ret=PyTuple_New(2);
2856 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2857 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2861 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2863 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2864 std::vector< std::vector<TypeOfField> > typesF;
2865 std::vector< std::vector<std::string> > pfls;
2866 std::vector< std::vector<std::string> > locs;
2867 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2869 PyObject *ret2=PyList_New(sz);
2870 for(int i=0;i<sz;i++)
2872 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2873 const std::vector<TypeOfField>& typesFI=typesF[i];
2874 const std::vector<std::string>& pflsI=pfls[i];
2875 const std::vector<std::string>& locsI=locs[i];
2876 PyObject *elt=PyTuple_New(2);
2877 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2878 int sz2=ret[i].size();
2879 PyObject *elt2=PyList_New(sz2);
2880 for(int j=0;j<sz2;j++)
2882 PyObject *elt3=PyTuple_New(4);
2883 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2884 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2885 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2886 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2887 PyList_SetItem(elt2,j,elt3);
2889 PyTuple_SetItem(elt,1,elt2);
2890 PyList_SetItem(ret2,i,elt);
2894 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2896 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2902 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2904 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2905 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2908 PyObject *ret=PyTuple_New(2);
2909 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2910 std::size_t sz=elt1Cpp.size();
2911 PyObject *elt=PyList_New(sz);
2912 for(std::size_t i=0;i<sz;i++)
2914 PyObject *elt1=PyTuple_New(2);
2915 PyObject *elt2=PyTuple_New(2);
2916 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2917 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2918 PyObject *elt3=PyTuple_New(2);
2919 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2920 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2921 PyTuple_SetItem(elt1,0,elt2);
2922 PyTuple_SetItem(elt1,1,elt3);
2923 PyList_SetItem(elt,i,elt1);
2925 PyTuple_SetItem(ret,1,elt);
2931 class MEDFileFieldsIterator
2936 PyObject *next() throw(INTERP_KERNEL::Exception)
2938 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2940 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2943 PyErr_SetString(PyExc_StopIteration,"No more data.");
2950 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2953 static MEDFileIntFieldMultiTS *New();
2954 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2955 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2956 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2958 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2959 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2960 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2961 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2962 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2963 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2964 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2965 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2966 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2969 MEDFileIntFieldMultiTS()
2971 return MEDFileIntFieldMultiTS::New();
2974 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2976 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2979 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2981 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2984 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2986 return MEDFileIntFieldMultiTS::New(db);
2990 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2992 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
2995 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2997 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2998 std::size_t sz(tmp.size());
2999 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3000 for(std::size_t i=0;i<sz;i++)
3002 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3003 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3005 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
3008 std::string __str__() const throw(INTERP_KERNEL::Exception)
3010 return self->simpleRepr();
3013 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
3015 DataArrayInt *ret1=0;
3016 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
3017 PyObject *ret=PyTuple_New(2);
3018 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3019 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3023 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
3025 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3033 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3036 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3037 std::vector<std::string> getSupMeshNames() const throw(INTERP_KERNEL::Exception);
3040 MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception)
3042 const MEDFileUMesh *ret(self->getSupMeshWithName(name));
3043 MEDFileUMesh *ret2(const_cast<MEDFileUMesh *>(ret));
3051 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3054 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3056 MEDFileStructureElements();
3059 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3062 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3063 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3064 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3065 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3066 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3067 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3068 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3069 void loadArrays() throw(INTERP_KERNEL::Exception);
3070 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3071 void unloadArrays() throw(INTERP_KERNEL::Exception);
3072 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3073 int getNumberOfFields() const;
3074 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3075 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3077 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3078 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3079 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3080 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3081 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3082 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3083 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3084 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3085 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3086 void killStructureElements() throw(INTERP_KERNEL::Exception);
3087 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3088 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3089 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3090 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3091 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3096 return MEDFileFields::New();
3099 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3101 return MEDFileFields::New(fileName,loadAll);
3104 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3106 return MEDFileFields::New(db);
3110 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3112 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3115 std::string __str__() const throw(INTERP_KERNEL::Exception)
3117 return self->simpleRepr();
3120 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3122 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3126 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3128 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3132 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3134 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3135 std::size_t sz(tmp.size());
3136 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3137 for(std::size_t i=0;i<sz;i++)
3139 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3140 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3142 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3145 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3147 std::vector< std::pair<std::string,std::string> > ps;
3148 self->getMeshSENames(ps);
3149 return convertVectPairStToPy(ps);
3152 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3155 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3156 PyObject *ret=PyTuple_New(2);
3157 PyObject *ret_0=PyList_New(ret0.size());
3159 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3161 PyObject *elt=PyTuple_New(2);
3162 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3163 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3164 PyList_SetItem(ret_0,rk,elt);
3166 PyTuple_SetItem(ret,0,ret_0);
3167 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3168 PyTuple_SetItem(ret,1,ret_1);
3172 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3174 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3175 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3178 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3180 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3181 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3184 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3186 if(obj && PyList_Check(obj))
3188 int sz=PyList_Size(obj);
3189 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3190 int *pt=da->getPointer();
3191 for(int i=0;i<sz;i++,pt++)
3193 PyObject *elt1=PyList_GetItem(obj,i);
3194 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3196 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3199 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3202 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3204 self->setFieldAtPos(obj,field);
3208 int __len__() const throw(INTERP_KERNEL::Exception)
3210 return self->getNumberOfFields();
3213 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3215 return self->iterator();
3218 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3220 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3221 return self->changeMeshNames(modifTab);
3224 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3226 if(elt0 && PyInt_Check(elt0))
3228 return PyInt_AS_LONG(elt0);
3230 else if(elt0 && PyString_Check(elt0))
3231 return self->getPosFromFieldName(PyString_AsString(elt0));
3233 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3236 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3238 if(PyList_Check(elts))
3240 int sz=PyList_Size(elts);
3241 std::vector<int> ret(sz);
3242 for(int i=0;i<sz;i++)
3244 PyObject *elt=PyList_GetItem(elts,i);
3245 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3251 std::vector<int> ret(1);
3252 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3257 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3259 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3260 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3261 self->pushFields(tmp);
3264 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3266 if(elts && PySlice_Check(elts))
3268 Py_ssize_t strt=2,stp=2,step=2;
3269 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3270 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3271 self->destroyFieldsAtPos2(strt,stp,step);
3275 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3276 if(!idsToRemove.empty())
3277 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3281 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3283 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3284 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3285 return self->extractPart(extractDefCpp,mm);
3290 class MEDFileParameter1TS : public RefCountObject
3293 void setIteration(int it);
3294 int getIteration() const;
3295 void setOrder(int order);
3296 int getOrder() const;
3297 void setTimeValue(double time);
3298 void setTime(int dt, int it, double time);
3299 double getTime(int& dt, int& it);
3300 double getTimeValue() const;
3303 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3306 void setValue(double val) throw(INTERP_KERNEL::Exception);
3307 double getValue() const throw(INTERP_KERNEL::Exception);
3308 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3311 std::string __str__() const throw(INTERP_KERNEL::Exception)
3313 return self->simpleRepr();
3318 class MEDFileParameterTinyInfo : public MEDFileWritable
3321 void setDescription(const std::string& name);
3322 std::string getDescription() const;
3323 void setTimeUnit(const std::string& unit);
3324 std::string getTimeUnit() const;
3327 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3330 static MEDFileParameterDouble1TS *New();
3331 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3332 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3333 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3334 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3335 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3336 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3337 std::string getName() const throw(INTERP_KERNEL::Exception);
3338 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3341 MEDFileParameterDouble1TS()
3343 return MEDFileParameterDouble1TS::New();
3346 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3348 return MEDFileParameterDouble1TS::New(fileName);
3351 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3353 return MEDFileParameterDouble1TS::New(fileName,paramName);
3356 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3358 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3361 std::string __str__() const throw(INTERP_KERNEL::Exception)
3363 return self->simpleRepr();
3366 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3369 bool ret0=self->isEqual(other,eps,what);
3370 PyObject *res=PyList_New(2);
3371 PyObject *ret0Py=ret0?Py_True:Py_False;
3373 PyList_SetItem(res,0,ret0Py);
3374 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3380 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3383 static MEDFileParameterMultiTS *New();
3384 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3385 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3386 std::string getName() const;
3387 void setName(const std::string& name);
3388 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3389 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3390 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3391 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3392 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3393 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3394 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3395 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3398 MEDFileParameterMultiTS()
3400 return MEDFileParameterMultiTS::New();
3403 MEDFileParameterMultiTS(const std::string& fileName)
3405 return MEDFileParameterMultiTS::New(fileName);
3408 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3410 return MEDFileParameterMultiTS::New(fileName,paramName);
3413 std::string __str__() const throw(INTERP_KERNEL::Exception)
3415 return self->simpleRepr();
3418 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3421 bool ret0=self->isEqual(other,eps,what);
3422 PyObject *res=PyList_New(2);
3423 PyObject *ret0Py=ret0?Py_True:Py_False;
3425 PyList_SetItem(res,0,ret0Py);
3426 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3430 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3434 std::vector<int> pos2;
3435 DataArrayInt *pos3=0;
3436 DataArrayIntTuple *pos4=0;
3437 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3442 self->eraseTimeStepIds(&pos1,&pos1+1);
3449 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3454 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3458 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3462 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3464 if(elt0 && PyInt_Check(elt0))
3466 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3469 else if(elt0 && PyTuple_Check(elt0))
3471 if(PyTuple_Size(elt0)==2)
3473 PyObject *o0=PyTuple_GetItem(elt0,0);
3474 PyObject *o1=PyTuple_GetItem(elt0,1);
3475 if(PyInt_Check(o0) && PyInt_Check(o1))
3477 int iter=PyInt_AS_LONG(o0);
3478 int order=PyInt_AS_LONG(o1);
3479 return self->getPosOfTimeStep(iter,order);
3482 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 !");
3485 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 !");
3487 else if(elt0 && PyFloat_Check(elt0))
3489 double val=PyFloat_AS_DOUBLE(elt0);
3490 return self->getPosGivenTime(val);
3493 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3496 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3498 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3504 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3506 if(PyList_Check(elts))
3508 int sz=PyList_Size(elts);
3509 std::vector<int> ret(sz);
3510 for(int i=0;i<sz;i++)
3512 PyObject *elt=PyList_GetItem(elts,i);
3513 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3519 std::vector<int> ret(1);
3520 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3525 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3527 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3528 if(!idsToRemove.empty())
3529 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3532 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3534 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3540 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3542 std::vector< std::pair<int,int> > res=self->getIterations();
3543 PyObject *ret=PyList_New(res.size());
3545 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3547 PyObject *elt=PyTuple_New(2);
3548 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3549 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3550 PyList_SetItem(ret,rk,elt);
3555 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3557 std::vector<double> res2;
3558 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3559 PyObject *ret=PyList_New(res.size());
3561 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3563 PyObject *elt=PyTuple_New(3);
3564 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3565 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3566 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3567 PyList_SetItem(ret,rk,elt);
3574 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3577 static MEDFileParameters *New();
3578 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3579 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3580 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3581 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3582 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3583 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3584 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3585 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3586 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3587 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3588 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3593 return MEDFileParameters::New();
3596 MEDFileParameters(const std::string& fileName)
3598 return MEDFileParameters::New(fileName);
3601 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3603 return MEDFileParameters::New(db);
3607 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3609 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3612 std::string __str__() const throw(INTERP_KERNEL::Exception)
3614 return self->simpleRepr();
3617 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3619 if(PyInt_Check(obj))
3621 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3626 else if(PyString_Check(obj))
3628 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3634 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3637 int __len__() const throw(INTERP_KERNEL::Exception)
3639 return self->getNumberOfParams();
3642 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3644 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3650 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3652 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3658 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3661 bool ret0=self->isEqual(other,eps,what);
3662 PyObject *res=PyList_New(2);
3663 PyObject *ret0Py=ret0?Py_True:Py_False;
3665 PyList_SetItem(res,0,ret0Py);
3666 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3672 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3675 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3676 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3677 static MEDFileData *New();
3678 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3679 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3680 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3681 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3682 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3683 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3684 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3686 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3687 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3688 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3689 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3690 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3694 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3696 return MEDFileData::New(fileName);
3699 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3701 return MEDFileData::New(db);
3706 return MEDFileData::New();
3709 std::string __str__() const throw(INTERP_KERNEL::Exception)
3711 return self->simpleRepr();
3714 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3716 MEDFileMeshes *ret=self->getMeshes();
3722 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3724 MEDFileParameters *ret=self->getParams();
3730 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3732 MEDFileFields *ret=self->getFields();
3738 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3740 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3741 return self->changeMeshNames(modifTab);
3744 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3746 std::vector<const MEDFileData *> mfdsCpp;
3747 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3748 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3753 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3755 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3760 class SauvReader : public RefCountObject
3763 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3764 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3767 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3769 return SauvReader::New(fileName);
3774 class SauvWriter : public RefCountObject
3777 static SauvWriter * New();
3778 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3779 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3780 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3781 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3784 SauvWriter() throw(INTERP_KERNEL::Exception)
3786 return SauvWriter::New();
3793 class MEDFileMeshStruct;
3795 class MEDFileField1TSStructItem
3798 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3801 class MEDFileMeshStruct : public RefCountObject
3804 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3806 ~MEDFileMeshStruct();
3809 class MEDMeshMultiLev : public RefCountObject
3812 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3813 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3814 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3820 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3822 DataArrayInt *famIds(0);
3823 bool isWithoutCopy(false);
3824 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3825 PyObject *ret=PyTuple_New(2);
3826 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3829 PyTuple_SetItem(ret,1,ret1Py);
3833 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3835 DataArrayInt *numIds(0);
3836 bool isWithoutCopy(false);
3837 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3838 PyObject *ret=PyTuple_New(2);
3839 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3841 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3842 PyTuple_SetItem(ret,1,ret1Py);
3846 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3848 DataArrayInt *famIds(0);
3849 bool isWithoutCopy(false);
3850 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3851 PyObject *ret=PyTuple_New(2);
3852 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3854 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3855 PyTuple_SetItem(ret,1,ret1Py);
3859 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3861 DataArrayInt *numIds(0);
3862 bool isWithoutCopy(false);
3863 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3864 PyObject *ret=PyTuple_New(2);
3865 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3867 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3868 PyTuple_SetItem(ret,1,ret1Py);
3872 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3874 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3875 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3876 PyObject *res(PyList_New(result.size()));
3877 for(int i=0;iL!=result.end(); i++, iL++)
3878 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3884 class MEDUMeshMultiLev : public MEDMeshMultiLev
3887 ~MEDUMeshMultiLev();
3891 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3893 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3894 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3895 PyObject *ret0Py=ncc?Py_True:Py_False;
3897 PyObject *ret=PyTuple_New(7);
3898 PyTuple_SetItem(ret,0,ret0Py);
3899 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3900 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3901 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3902 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3903 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3904 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3910 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3913 ~MEDStructuredMeshMultiLev();
3916 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3919 ~MEDCMeshMultiLev();
3923 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3926 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3927 std::size_t sz(objs.size());
3928 PyObject *ret(PyTuple_New(2));
3929 PyObject *ret0=PyList_New(sz);
3930 for(std::size_t i=0;i<sz;i++)
3931 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3932 PyTuple_SetItem(ret,0,ret0);
3933 PyObject *ret1Py(isInternal?Py_True:Py_False);
3935 PyTuple_SetItem(ret,1,ret1Py);
3941 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3944 ~MEDCurveLinearMeshMultiLev();
3948 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3950 DataArrayDouble *ret0(0);
3951 std::vector<int> ret1;
3953 self->buildVTUArrays(ret0,ret1,ret2);
3954 std::size_t sz(ret1.size());
3955 PyObject *ret=PyTuple_New(3);
3956 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3957 PyObject *ret1Py=PyList_New(sz);
3958 for(std::size_t i=0;i<sz;i++)
3959 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3960 PyTuple_SetItem(ret,1,ret1Py);
3961 PyObject *ret2Py(ret2?Py_True:Py_False);
3963 PyTuple_SetItem(ret,2,ret2Py);
3969 class MEDFileFastCellSupportComparator : public RefCountObject
3972 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3973 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3974 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3975 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3977 ~MEDFileFastCellSupportComparator();
3981 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3983 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3984 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3985 PyObject *res(PyList_New(result.size()));
3986 for(int i=0;iL!=result.end(); i++, iL++)
3987 PyList_SetItem(res,i,PyInt_FromLong(*iL));