1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileMeshSupports::New;
145 %newobject MEDCoupling::MEDFileStructureElements::New;
147 %newobject MEDCoupling::MEDFileFields::New;
148 %newobject MEDCoupling::MEDFileFields::NewWithDynGT;
149 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
150 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
151 %newobject MEDCoupling::MEDFileFields::deepCopy;
152 %newobject MEDCoupling::MEDFileFields::shallowCpy;
153 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
154 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
155 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
156 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
157 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
158 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
159 %newobject MEDCoupling::MEDFileFields::__iter__;
160 %newobject MEDCoupling::MEDFileFields::extractPart;
162 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
166 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
167 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
168 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
169 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
170 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
171 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
175 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
176 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
177 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
178 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
179 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
180 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
183 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
184 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
185 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
186 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
187 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
188 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
189 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
191 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
192 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
193 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
194 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
195 %newobject MEDCoupling::MEDFileField1TS::New;
196 %newobject MEDCoupling::MEDFileField1TS::field;
197 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
198 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
199 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
200 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
201 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
202 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
204 %newobject MEDCoupling::MEDFileIntField1TS::New;
205 %newobject MEDCoupling::MEDFileIntField1TS::field;
206 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
207 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
208 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
209 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
210 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
211 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
213 %newobject MEDCoupling::MEDFileData::New;
214 %newobject MEDCoupling::MEDFileData::deepCopy;
215 %newobject MEDCoupling::MEDFileData::getMeshes;
216 %newobject MEDCoupling::MEDFileData::getFields;
217 %newobject MEDCoupling::MEDFileData::getParams;
218 %newobject MEDCoupling::MEDFileData::Aggregate;
220 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
221 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
222 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
223 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
224 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
225 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
226 %newobject MEDCoupling::MEDFileParameters::New;
227 %newobject MEDCoupling::MEDFileParameters::deepCopy;
228 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
229 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
230 %newobject MEDCoupling::MEDFileParameters::__getitem__;
232 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
233 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
234 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
235 %newobject MEDCoupling::MEDFileJointOneStep::New;
236 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
237 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
238 %newobject MEDCoupling::MEDFileJoint::New;
239 %newobject MEDCoupling::MEDFileJoint::deepCopy;
240 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
241 %newobject MEDCoupling::MEDFileJoints::New;
242 %newobject MEDCoupling::MEDFileJoints::deepCopy;
243 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
244 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
245 %newobject MEDCoupling::MEDFileJoints::__getitem__;
246 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
247 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
248 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
249 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
250 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
251 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
252 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
253 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
254 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
256 %newobject MEDCoupling::SauvWriter::New;
257 %newobject MEDCoupling::SauvReader::New;
258 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
260 %newobject MEDCoupling::MEDFileMeshStruct::New;
261 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
262 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
263 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
264 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
265 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
267 %feature("unref") MEDFileMesh "$this->decrRef();"
268 %feature("unref") MEDFileUMesh "$this->decrRef();"
269 %feature("unref") MEDFileCMesh "$this->decrRef();"
270 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileMeshes "$this->decrRef();"
272 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
273 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
274 %feature("unref") MEDFileField1TS "$this->decrRef();"
275 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
276 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
277 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
278 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
279 %feature("unref") MEDFileMeshSupports "$this->decrRef();"
280 %feature("unref") MEDFileStructureElements "$this->decrRef();"
281 %feature("unref") MEDFileFields "$this->decrRef();"
282 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
283 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
284 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
285 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
286 %feature("unref") MEDFileParameters "$this->decrRef();"
287 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
288 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
289 %feature("unref") MEDFileJoint "$this->decrRef();"
290 %feature("unref") MEDFileJoints "$this->decrRef();"
291 %feature("unref") MEDFileEquivalences "$this->decrRef();"
292 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
293 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
294 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
295 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
296 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
297 %feature("unref") MEDFileData "$this->decrRef();"
298 %feature("unref") SauvReader "$this->decrRef();"
299 %feature("unref") SauvWriter "$this->decrRef();"
300 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
301 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
302 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
303 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
304 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
305 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
307 namespace MEDCoupling
310 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
311 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
312 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
313 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
314 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
315 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
318 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
319 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
320 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
321 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
322 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
323 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
324 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
325 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
327 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
328 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
329 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
330 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
331 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
332 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
333 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
334 MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
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;
364 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
366 int major,minor,release;
367 MEDCoupling::MEDFileVersion(major,minor,release);
368 PyObject *ret(PyTuple_New(3));
369 PyTuple_SetItem(ret,0,SWIG_From_int(major));
370 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
371 PyTuple_SetItem(ret,2,SWIG_From_int(release));
375 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
377 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
378 PyObject *ret=PyList_New(res.size());
380 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
382 PyObject *elt=PyTuple_New(2);
383 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
384 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
385 PyList_SetItem(ret,rk,elt);
390 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
392 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
393 PyObject *ret=PyList_New(res.size());
395 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
397 PyObject *elt=PyTuple_New(3);
398 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
399 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
400 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
401 PyList_SetItem(ret,rk,elt);
406 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
408 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
409 PyObject *ret=PyList_New(res.size());
411 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
413 PyObject *elt=PyTuple_New(2);
414 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
415 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
416 PyList_SetItem(ret,rk,elt);
421 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
423 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
424 PyObject *ret=PyList_New(res.size());
426 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
428 PyObject *elt=PyTuple_New(2);
429 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
430 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
431 PyList_SetItem(ret,rk,elt);
436 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
438 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
439 PyObject *ret=PyList_New(res.size());
441 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
443 PyObject *elt=PyTuple_New(2);
444 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
445 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
446 PyList_SetItem(ret,rk,elt);
451 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
453 int meshDim,spaceDim,numberOfNodes;
454 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
455 PyObject *ret=PyTuple_New(4);
456 PyObject *elt0=PyList_New(res.size());
458 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
460 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
462 PyObject *elt1=PyList_New(obj2.size());
463 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
465 PyObject *elt2=PyTuple_New(2);
466 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
467 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
468 PyList_SetItem(elt1,j,elt2);
470 PyList_SetItem(elt0,i,elt1);
472 PyTuple_SetItem(ret,0,elt0);
473 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
474 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
475 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
479 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
480 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
482 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
483 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
484 return convertFieldDoubleVecToPy(res);
487 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
489 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
490 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
491 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
494 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
496 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
497 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
498 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
501 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
503 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
504 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
505 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
508 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
510 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
512 PyObject *ret=PyList_New(size);
513 for(int i=0;i<size;i++)
514 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
518 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
520 std::vector<std::string> grps;
521 converPyListToVecString(li,grps);
522 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
525 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
527 std::vector<std::string> fams;
528 converPyListToVecString(li,fams);
529 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
533 namespace MEDCoupling
535 class MEDFileWritable
538 void copyOptionsFrom(const MEDFileWritable& other) const;
539 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
540 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
541 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
542 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
545 class MEDFileWritableStandAlone : public MEDFileWritable
548 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
549 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
552 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
554 MCAuto<DataArrayByte> ret(self->serialize());
558 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
560 PyObject *ret(PyList_New(0));
564 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
568 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
571 PyObject *ret(PyTuple_New(1));
572 PyObject *ret0(PyDict_New());
573 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
574 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
575 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
576 PyObject *tmp1(PyInt_FromLong(0));
577 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
578 PyTuple_SetItem(ret,0,ret0);
582 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
588 class MEDFileMeshReadSelector
591 MEDFileMeshReadSelector();
592 MEDFileMeshReadSelector(unsigned int code);
593 unsigned int getCode() const;
594 void setCode(unsigned int newCode);
595 bool isCellFamilyFieldReading() const;
596 bool isNodeFamilyFieldReading() const;
597 bool isCellNameFieldReading() const;
598 bool isNodeNameFieldReading() const;
599 bool isCellNumFieldReading() const;
600 bool isNodeNumFieldReading() const;
601 void setCellFamilyFieldReading(bool b);
602 void setNodeFamilyFieldReading(bool b);
603 void setCellNameFieldReading(bool b);
604 void setNodeNameFieldReading(bool b);
605 void setCellNumFieldReading(bool b);
606 void setNodeNumFieldReading(bool b);
609 std::string __str__() const throw(INTERP_KERNEL::Exception)
611 std::ostringstream oss;
616 std::string __repr__() const throw(INTERP_KERNEL::Exception)
618 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
624 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
627 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
628 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
629 throw(INTERP_KERNEL::Exception);
630 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
631 INTERP_KERNEL::NormalizedCellType loc_geo_type,
632 INTERP_KERNEL::NormalizedCellType rem_geo_type)
633 throw(INTERP_KERNEL::Exception);
634 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
635 MEDFileJointCorrespondence *deepCopy() const;
636 MEDFileJointCorrespondence *shallowCpy() const;
637 void setIsNodal(bool isNodal);
638 bool getIsNodal() const;
639 bool isEqual(const MEDFileJointCorrespondence *other) const;
640 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
641 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
642 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
643 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
644 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
645 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
646 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);
647 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
650 MEDFileJointCorrespondence()
652 return MEDFileJointCorrespondence::New();
654 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
656 return MEDFileJointCorrespondence::New(correspondence);
658 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
659 INTERP_KERNEL::NormalizedCellType loc_geo_type,
660 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
662 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
665 std::string __str__() const throw(INTERP_KERNEL::Exception)
667 return self->simpleRepr();
672 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
675 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
676 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
677 MEDFileJointOneStep *deepCopy() const;
678 MEDFileJointOneStep *shallowCpy() const;
679 bool isEqual(const MEDFileJointOneStep *other) const;
680 void setOrder(int order);
681 int getOrder() const;
682 void setIteration(int it);
683 int getIteration() const;
684 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
685 int getNumberOfCorrespondences() const;
686 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
687 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
688 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
691 MEDFileJointOneStep()
693 return MEDFileJointOneStep::New();
696 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
698 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
701 std::string __str__() const throw(INTERP_KERNEL::Exception)
703 return self->simpleRepr();
708 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
711 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
712 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
713 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
714 MEDFileJoint *deepCopy() const;
715 MEDFileJoint *shallowCpy() const;
716 bool isEqual(const MEDFileJoint *other) const;
717 void setLocalMeshName(const std::string& name);
718 std::string getLocalMeshName() const;
719 void setRemoteMeshName(const std::string& name);
720 std::string getRemoteMeshName() const;
721 void setDescription(const std::string& name);
722 std::string getDescription() const;
723 void setJointName(const std::string& name);
724 std::string getJointName() const;
725 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
726 void setDomainNumber(const int& number);
727 int getDomainNumber() const;
728 void pushStep(MEDFileJointOneStep* step);
729 int getNumberOfSteps() const;
730 MEDFileJointOneStep *getStepAtPos(int i) const;
731 std::string simpleRepr() const;
736 return MEDFileJoint::New();
739 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
741 return MEDFileJoint::New(fileName,mName,num);
744 std::string __str__() const throw(INTERP_KERNEL::Exception)
746 return self->simpleRepr();
751 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
754 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
755 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
756 MEDFileJoints *deepCopy() const;
757 std::string simpleRepr() const;
758 std::string getMeshName() const;
759 int getNumberOfJoints() const;
760 std::vector<std::string> getJointsNames() const;
761 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
762 void resize(int newSize) throw(INTERP_KERNEL::Exception);
763 void pushJoint(MEDFileJoint *joint);
764 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
765 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
770 return MEDFileJoints::New();
773 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
775 return MEDFileJoints::New(fileName,meshName);
778 std::string __str__() const throw(INTERP_KERNEL::Exception)
780 return self->simpleRepr();
783 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
787 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
792 else if(PyString_Check(obj))
794 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
800 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
803 int __len__() const throw(INTERP_KERNEL::Exception)
805 return self->getNumberOfJoints();
808 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
810 MEDFileJoint *ret=self->getJointAtPos(i);
816 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
818 MEDFileJoint *ret=self->getJointWithName(paramName);
826 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
829 MEDFileEquivalenceBase();
832 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
835 MEDFileEquivalenceData();
837 void setArray(DataArrayInt *data);
840 DataArrayInt *getArray()
842 DataArrayInt *ret(self->getArray());
843 if(ret) ret->incrRef();
849 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
852 MEDFileEquivalenceNode();
855 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
858 MEDFileEquivalenceCell();
861 std::size_t size() const;
862 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
863 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
866 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
868 DataArrayInt *ret(self->getArray(type));
869 if(ret) ret->incrRef();
873 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
875 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
876 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
877 PyObject *res=PyList_New(result.size());
878 for(int i=0;iL!=result.end(); i++, iL++)
879 PyList_SetItem(res,i,PyInt_FromLong(*iL));
885 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
888 MEDFileEquivalencePair();
890 std::string getName() const;
891 void setName(const std::string& name);
892 std::string getDescription() const;
893 void setDescription(const std::string& descr);
894 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
897 MEDFileEquivalenceCell *initCell()
899 MEDFileEquivalenceCell *ret(self->initCell());
900 if(ret) ret->incrRef();
904 MEDFileEquivalenceNode *initNode()
906 MEDFileEquivalenceNode *ret(self->initNode());
907 if(ret) ret->incrRef();
911 MEDFileEquivalenceCell *getCell()
913 MEDFileEquivalenceCell *ret(self->getCell());
914 if(ret) ret->incrRef();
918 MEDFileEquivalenceNode *getNode()
920 MEDFileEquivalenceNode *ret(self->getNode());
921 if(ret) ret->incrRef();
927 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
930 MEDFileEquivalences();
933 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
934 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
935 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
939 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
941 MEDFileEquivalencePair *ret(self->getEquivalence(i));
942 if(ret) ret->incrRef();
945 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
947 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
948 if(ret) ret->incrRef();
952 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
954 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
955 if(ret) ret->incrRef();
961 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
964 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
965 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
966 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
967 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
968 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
969 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
970 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
971 void setName(const std::string& name);
972 std::string getName();
973 std::string getUnivName() const;
974 bool getUnivNameWrStatus() const;
975 void setUnivNameWrStatus(bool newStatus);
976 void setDescription(const std::string& name);
977 std::string getDescription() const;
978 void setOrder(int order);
979 int getOrder() const;
980 void setIteration(int it);
982 void setTimeValue(double time);
983 void setTime(int dt, int it, double time);
984 double getTimeValue() const;
985 void setTimeUnit(const std::string& unit);
986 std::string getTimeUnit() const;
987 void setAxisType(MEDCouplingAxisType at);
988 MEDCouplingAxisType getAxisType() const;
989 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
990 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
991 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
992 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
993 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
994 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
995 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
996 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
997 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
998 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
999 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
1000 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
1001 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
1002 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1004 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
1005 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
1006 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1007 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1008 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1009 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1010 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1011 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1012 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1013 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1014 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1015 void clearFamMap() throw(INTERP_KERNEL::Exception);
1016 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1017 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1018 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1019 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1020 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1021 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1022 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1023 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1024 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1025 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1026 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1027 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1028 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1029 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1030 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1031 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1032 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1033 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1034 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1035 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1036 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1037 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1038 static std::string GetMagicFamilyStr();
1039 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1040 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1041 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1042 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1043 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1044 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1045 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1046 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1047 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1048 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1049 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1050 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1051 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1052 void setFamilyInfo(const std::map<std::string,int>& info);
1053 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1054 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1055 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1056 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1057 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1058 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1059 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1060 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1061 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1062 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1063 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1064 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1065 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1066 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1067 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1068 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1069 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1070 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1071 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1072 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1073 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1075 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1076 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1077 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1078 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1079 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1080 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1081 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1082 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1083 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1084 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1085 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1086 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1087 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1088 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1089 int getNumberOfJoints();
1090 MEDFileJoints *getJoints();
1091 void setJoints( MEDFileJoints* joints );
1092 void initializeEquivalences();
1093 void killEquivalences();
1094 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1095 void killStructureElements() throw(INTERP_KERNEL::Exception);
1098 std::string __str__() const throw(INTERP_KERNEL::Exception)
1100 return self->simpleRepr();
1103 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1105 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1108 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1111 double tmp0=self->getTime(tmp1,tmp2);
1112 PyObject *res = PyList_New(3);
1113 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1114 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1115 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1119 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1122 bool ret0=self->isEqual(other,eps,what);
1123 PyObject *res=PyList_New(2);
1124 PyObject *ret0Py=ret0?Py_True:Py_False;
1126 PyList_SetItem(res,0,ret0Py);
1127 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1131 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1133 std::vector<const DataArrayInt *> grps;
1134 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1135 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1138 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1141 bool ret0=self->areFamsEqual(other,what);
1142 PyObject *res=PyList_New(2);
1143 PyObject *ret0Py=ret0?Py_True:Py_False;
1145 PyList_SetItem(res,0,ret0Py);
1146 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1150 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1153 bool ret0=self->areGrpsEqual(other,what);
1154 PyObject *res=PyList_New(2);
1155 PyObject *ret0Py=ret0?Py_True:Py_False;
1157 PyList_SetItem(res,0,ret0Py);
1158 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1162 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1164 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1165 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1166 PyObject *res=PyList_New(result.size());
1167 for(int i=0;iL!=result.end(); i++, iL++)
1168 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1172 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1174 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1175 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1176 PyObject *res=PyList_New(result.size());
1177 for(int i=0;iL!=result.end(); i++, iL++)
1178 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1182 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1184 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1187 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1190 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1192 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1195 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1198 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1200 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1203 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1206 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1208 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1211 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1214 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1216 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1219 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1222 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1225 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1226 PyObject *ret=PyTuple_New(2);
1227 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1228 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1232 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1234 DataArrayInt *ret3=0;
1235 std::vector<int> ret1,ret2;
1236 bool ret0=self->unPolyze(ret1,ret2,ret3);
1237 PyObject *ret=PyTuple_New(4);
1238 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1240 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1241 for(int j=0;j<(int)ret1.size()/3;j++)
1243 PyObject *retLev2=PyList_New(3);
1244 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1245 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1246 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1247 PyList_SetItem(retLev1_0,j,retLev2);
1249 PyTuple_SetItem(ret,1,retLev1_0);
1251 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1252 for(int j=0;j<(int)ret2.size()/3;j++)
1254 PyObject *retLev2=PyList_New(3);
1255 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1256 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1257 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1258 PyList_SetItem(retLev1_1,j,retLev2);
1260 PyTuple_SetItem(ret,2,retLev1_1);
1262 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1266 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1268 MEDFileEquivalences *ret(self->getEquivalences());
1269 if(ret) ret->incrRef();
1275 class MEDFileUMesh : public MEDFileMesh
1278 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1279 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1280 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1281 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1282 static MEDFileUMesh *New();
1283 static const char *GetSpeStr4ExtMesh();
1285 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1286 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1287 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1288 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1289 void clearNodeAndCellNumbers();
1291 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1292 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1293 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1294 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1295 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1296 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1297 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1298 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1299 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1300 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1302 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1303 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1304 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1305 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1306 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1307 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1308 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1309 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1310 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1311 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1312 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1313 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1314 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1315 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1316 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1319 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1321 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1324 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1326 return MEDFileUMesh::New(fileName,mrs);
1329 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1331 return MEDFileUMesh::New(mem);
1334 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1336 return MEDFileUMesh::New(db);
1341 return MEDFileUMesh::New();
1345 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1347 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1350 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)
1352 std::vector<int> typesCpp1;
1353 convertPyToNewIntArr3(types,typesCpp1);
1354 std::size_t sz(typesCpp1.size());
1355 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1356 for(std::size_t ii=0;ii<sz;ii++)
1357 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1358 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1361 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1362 {// put an empty dict in input to say to __new__ to call __init__...
1363 PyObject *ret(PyTuple_New(1));
1364 PyObject *ret0(PyDict_New());
1365 PyTuple_SetItem(ret,0,ret0);
1369 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1371 std::vector<double> a0;
1372 std::vector<int> a1;
1373 std::vector<std::string> a2;
1374 std::vector< MCAuto<DataArrayInt> > a3;
1375 MCAuto<DataArrayDouble> a4;
1376 self->serialize(a0,a1,a2,a3,a4);
1377 PyObject *ret(PyTuple_New(5));
1378 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1379 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1381 PyObject *ret2(PyList_New(sz));
1382 for(int i=0;i<sz;i++)
1383 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1384 PyTuple_SetItem(ret,2,ret2);
1386 PyObject *ret3(PyList_New(sz));
1387 for(int i=0;i<sz;i++)
1389 DataArrayInt *elt(a3[i]);
1392 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1394 PyTuple_SetItem(ret,3,ret3);
1395 DataArrayDouble *ret4(a4);
1398 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1402 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1404 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1405 if(!PyTuple_Check(inp))
1406 throw INTERP_KERNEL::Exception(MSG);
1407 int sz(PyTuple_Size(inp));
1409 throw INTERP_KERNEL::Exception(MSG);
1410 std::vector<double> a0;
1411 std::vector<int> a1;
1412 std::vector<std::string> a2;
1413 std::vector< MCAuto<DataArrayInt> > a3;
1414 MCAuto<DataArrayDouble> a4;
1416 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1418 fillArrayWithPyListDbl3(a0py,tmp,a0);
1419 convertPyToNewIntArr3(a1py,a1);
1420 fillStringVector(a2py,a2);
1422 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1424 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1425 if(!SWIG_IsOK(status))
1426 throw INTERP_KERNEL::Exception(MSG);
1427 a4=reinterpret_cast<DataArrayDouble *>(argp);
1428 if((DataArrayDouble *)a4)
1431 std::vector< DataArrayInt * > a3Tmp;
1432 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1433 std::size_t sz(a3Tmp.size());
1435 for(std::size_t i=0;i<sz;i++)
1439 a3Tmp[i]->incrRef();
1441 self->unserialize(a0,a1,a2,a3,a4);
1445 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1448 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1449 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1452 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1455 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1458 self->setMeshAtLevel(meshDimRelToMax,m1);
1461 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1464 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1466 self->removeMeshAtLevel(meshDimRelToMax);
1469 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1471 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1473 DataArrayDouble *a,*a2;
1474 DataArrayDoubleTuple *aa,*aa2;
1475 std::vector<double> bb,bb2;
1477 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1478 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1479 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1483 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1485 std::vector<const MEDFileUMesh *> meshesCpp;
1486 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1487 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1491 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1493 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1494 return convertVecPairIntToPy(ret);
1497 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1499 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1500 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1501 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1504 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1506 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1507 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1508 return self->extractPart(extractDefCpp);
1511 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1513 std::vector<const MEDCouplingUMesh *> ms;
1514 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1515 self->setMeshes(ms,renum);
1518 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1520 std::vector<const MEDCouplingUMesh *> ms;
1521 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1522 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1525 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1527 std::vector<const MEDCouplingUMesh *> ms;
1528 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1529 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1532 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1534 DataArrayDouble *ret=self->getCoords();
1540 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1542 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1545 return const_cast<PartDefinition *>(ret);
1548 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1550 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1551 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1552 PyObject *ret=PyTuple_New(3);
1553 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1554 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1555 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1559 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1561 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1567 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1569 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1570 std::size_t sz(tmp.size());
1571 PyObject *ret=PyList_New(sz);
1572 for(std::size_t i=0;i<sz;i++)
1576 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1583 class MEDFileStructuredMesh : public MEDFileMesh
1588 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1590 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1598 class MEDFileCMesh : public MEDFileStructuredMesh
1601 static MEDFileCMesh *New();
1602 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1603 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1604 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1605 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1606 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1611 return MEDFileCMesh::New();
1614 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1616 return MEDFileCMesh::New(fileName,mrs);
1619 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1621 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1624 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1626 return MEDFileCMesh::New(db);
1630 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1632 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1635 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1637 const MEDCouplingCMesh *tmp=self->getMesh();
1640 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1645 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1648 static MEDFileCurveLinearMesh *New();
1649 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1650 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1651 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1652 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1655 MEDFileCurveLinearMesh()
1657 return MEDFileCurveLinearMesh::New();
1660 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1662 return MEDFileCurveLinearMesh::New(fileName,mrs);
1665 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1667 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1670 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1672 return MEDFileCurveLinearMesh::New(db);
1676 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1678 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1681 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1683 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1686 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1691 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1694 static MEDFileMeshMultiTS *New();
1695 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1696 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1697 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1698 std::string getName() const throw(INTERP_KERNEL::Exception);
1699 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1700 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1703 MEDFileMeshMultiTS()
1705 return MEDFileMeshMultiTS::New();
1708 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1710 return MEDFileMeshMultiTS::New(fileName);
1713 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1715 return MEDFileMeshMultiTS::New(fileName,mName);
1718 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1720 MEDFileMesh *ret=self->getOneTimeStep();
1728 class MEDFileMeshesIterator
1733 PyObject *next() throw(INTERP_KERNEL::Exception)
1735 MEDFileMesh *ret=self->nextt();
1739 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1743 PyErr_SetString(PyExc_StopIteration,"No more data.");
1750 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1753 static MEDFileMeshes *New();
1754 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1755 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1756 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1757 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1759 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1760 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1761 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1762 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1763 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1764 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1765 void killStructureElements() throw(INTERP_KERNEL::Exception);
1770 return MEDFileMeshes::New();
1773 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1775 return MEDFileMeshes::New(fileName);
1778 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1780 return MEDFileMeshes::New(db);
1784 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1786 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1789 std::string __str__() const throw(INTERP_KERNEL::Exception)
1791 return self->simpleRepr();
1794 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1796 if(PyInt_Check(obj))
1798 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1803 else if(PyString_Check(obj))
1805 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1811 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1814 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1816 self->setMeshAtPos(obj,mesh);
1820 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1822 return self->iterator();
1825 int __len__() const throw(INTERP_KERNEL::Exception)
1827 return self->getNumberOfMeshes();
1830 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1832 MEDFileMesh *ret=self->getMeshAtPos(i);
1837 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1839 MEDFileMesh *ret=self->getMeshWithName(mname);
1847 class MEDFileFieldLoc : public RefCountObject
1850 std::string getName() const;
1851 int getDimension() const;
1852 int getNumberOfGaussPoints() const;
1853 int getNumberOfPointsInCells() const;
1854 const std::vector<double>& getRefCoords() const;
1855 const std::vector<double>& getGaussCoords() const;
1856 const std::vector<double>& getGaussWeights() const;
1857 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1860 std::string __str__() const throw(INTERP_KERNEL::Exception)
1862 return self->repr();
1867 class MEDFileFieldGlobsReal
1870 void resetContent();
1871 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1872 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1873 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1874 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1875 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1876 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1877 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1878 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1879 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1880 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1881 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1882 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1883 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1884 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1885 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1886 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1887 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1888 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1889 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1890 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1891 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1892 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1893 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1894 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1895 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1896 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1899 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1901 const DataArrayInt *ret=self->getProfile(pflName);
1904 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1907 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1909 const DataArrayInt *ret=self->getProfileFromId(pflId);
1912 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1915 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1917 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1920 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1923 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1925 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1928 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1931 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1933 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1934 return convertVecPairVecStToPy(ret);
1937 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1939 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1940 return convertVecPairVecStToPy(ret);
1943 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1945 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1946 self->changePflsNames(v);
1949 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1951 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1952 self->changePflsRefsNamesGen(v);
1955 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1957 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1958 self->changePflsNamesInStruct(v);
1961 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1963 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1964 self->changeLocsNames(v);
1967 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1969 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1970 self->changeLocsRefsNamesGen(v);
1973 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1975 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1976 self->changeLocsNamesInStruct(v);
1979 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1981 std::ostringstream oss;
1982 self->simpleReprGlobs(oss);
1988 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1991 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1992 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1993 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1994 void loadArrays() throw(INTERP_KERNEL::Exception);
1995 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1996 void unloadArrays() throw(INTERP_KERNEL::Exception);
1997 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1998 int getDimension() const throw(INTERP_KERNEL::Exception);
1999 int getIteration() const throw(INTERP_KERNEL::Exception);
2000 int getOrder() const throw(INTERP_KERNEL::Exception);
2001 std::string getName() throw(INTERP_KERNEL::Exception);
2002 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2003 std::string getMeshName() throw(INTERP_KERNEL::Exception);
2004 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2005 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
2006 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2007 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2008 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2009 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2010 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2011 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2012 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2013 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2014 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2015 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2016 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2019 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2022 double tmp0=self->getTime(tmp1,tmp2);
2023 PyObject *res = PyList_New(3);
2024 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2025 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2026 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2030 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2032 std::pair<int,int> res=self->getDtIt();
2033 PyObject *elt=PyTuple_New(2);
2034 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2035 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2039 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2041 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2044 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2046 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2049 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2051 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2052 return self->changeMeshNames(modifTab);
2055 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2057 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2058 PyObject *ret2=PyList_New(ret.size());
2059 for(int i=0;i<(int)ret.size();i++)
2060 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2064 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2066 std::vector<int> ret1;
2067 int ret0=self->getNonEmptyLevels(mname,ret1);
2068 PyObject *elt=PyTuple_New(2);
2069 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2070 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2074 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2076 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2077 std::vector< std::vector<TypeOfField> > typesF;
2078 std::vector< std::vector<std::string> > pfls;
2079 std::vector< std::vector<std::string> > locs;
2080 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2082 PyObject *ret2=PyList_New(sz);
2083 for(int i=0;i<sz;i++)
2085 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2086 const std::vector<TypeOfField>& typesFI=typesF[i];
2087 const std::vector<std::string>& pflsI=pfls[i];
2088 const std::vector<std::string>& locsI=locs[i];
2089 PyObject *elt=PyTuple_New(2);
2090 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2091 int sz2=ret[i].size();
2092 PyObject *elt2=PyList_New(sz2);
2093 for(int j=0;j<sz2;j++)
2095 PyObject *elt3=PyTuple_New(4);
2096 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2097 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));
2098 PyTuple_SetItem(elt3,1,elt4);
2099 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2100 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2101 PyList_SetItem(elt2,j,elt3);
2103 PyTuple_SetItem(elt,1,elt2);
2104 PyList_SetItem(ret2,i,elt);
2109 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2111 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2112 std::size_t sz=ret.size();
2113 PyObject *retPy=PyList_New(sz);
2114 for(std::size_t i=0;i<sz;i++)
2115 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2119 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2121 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2122 std::size_t sz=ret.size();
2123 PyObject *retPy=PyList_New(sz);
2124 for(std::size_t i=0;i<sz;i++)
2125 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2129 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2131 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2132 std::size_t sz=ret.size();
2133 PyObject *retPy=PyList_New(sz);
2134 for(std::size_t i=0;i<sz;i++)
2135 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2139 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2141 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2142 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2143 return self->extractPart(extractDefCpp,mm);
2148 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2151 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2152 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2153 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2154 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2155 static MEDFileField1TS *New();
2156 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2157 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2158 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2159 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2160 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2161 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2162 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2164 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2165 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2166 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2167 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2170 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2172 return MEDFileField1TS::New(fileName,loadAll);
2175 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2177 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2180 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2182 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2185 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2187 return MEDFileField1TS::New(db);
2192 return MEDFileField1TS::New();
2196 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2198 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2201 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2203 const DataArrayDouble *arr=0;
2205 arr=field->getArray();
2206 self->copyTinyInfoFrom(field,arr);
2209 std::string __str__() const throw(INTERP_KERNEL::Exception)
2211 return self->simpleRepr();
2214 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2216 DataArrayInt *ret1=0;
2217 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2218 PyObject *ret=PyTuple_New(2);
2219 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2220 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2224 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2226 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2227 std::vector< std::vector<TypeOfField> > typesF;
2228 std::vector< std::vector<std::string> > pfls;
2229 std::vector< std::vector<std::string> > locs;
2230 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2232 PyObject *ret2=PyList_New(sz);
2233 for(int i=0;i<sz;i++)
2235 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2236 const std::vector<TypeOfField>& typesFI=typesF[i];
2237 const std::vector<std::string>& pflsI=pfls[i];
2238 const std::vector<std::string>& locsI=locs[i];
2239 PyObject *elt=PyTuple_New(2);
2240 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2241 int sz2=ret[i].size();
2242 PyObject *elt2=PyList_New(sz2);
2243 for(int j=0;j<sz2;j++)
2245 PyObject *elt3=PyTuple_New(4);
2246 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2247 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2248 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2249 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2250 PyList_SetItem(elt2,j,elt3);
2252 PyTuple_SetItem(elt,1,elt2);
2253 PyList_SetItem(ret2,i,elt);
2258 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2260 DataArrayDouble *ret=self->getUndergroundDataArray();
2266 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2268 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2269 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2272 PyObject *ret=PyTuple_New(2);
2273 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2274 std::size_t sz=elt1Cpp.size();
2275 PyObject *elt=PyList_New(sz);
2276 for(std::size_t i=0;i<sz;i++)
2278 PyObject *elt1=PyTuple_New(2);
2279 PyObject *elt2=PyTuple_New(2);
2280 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2281 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2282 PyObject *elt3=PyTuple_New(2);
2283 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2284 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2285 PyTuple_SetItem(elt1,0,elt2);
2286 PyTuple_SetItem(elt1,1,elt3);
2287 PyList_SetItem(elt,i,elt1);
2289 PyTuple_SetItem(ret,1,elt);
2295 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2298 static MEDFileIntField1TS *New();
2299 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2300 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2301 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2302 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2303 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2305 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2306 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2307 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2308 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2309 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2310 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2311 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2312 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2315 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2317 return MEDFileIntField1TS::New();
2320 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2322 return MEDFileIntField1TS::New(fileName,loadAll);
2325 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2327 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2330 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2332 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2335 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2337 return MEDFileIntField1TS::New(db);
2341 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2343 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2346 std::string __str__() const throw(INTERP_KERNEL::Exception)
2348 return self->simpleRepr();
2351 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2353 DataArrayInt *ret1=0;
2354 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2355 PyObject *ret=PyTuple_New(2);
2356 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2361 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2363 DataArrayInt *ret=self->getUndergroundDataArray();
2371 class MEDFileAnyTypeFieldMultiTSIterator
2376 PyObject *next() throw(INTERP_KERNEL::Exception)
2378 MEDFileAnyTypeField1TS *ret=self->nextt();
2380 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2383 PyErr_SetString(PyExc_StopIteration,"No more data.");
2390 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2393 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2394 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2395 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2396 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2397 std::string getName() const throw(INTERP_KERNEL::Exception);
2398 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2399 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2400 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2401 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2402 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2403 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2404 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2405 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2406 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2407 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2408 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2409 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2410 void loadArrays() throw(INTERP_KERNEL::Exception);
2411 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2412 void unloadArrays() throw(INTERP_KERNEL::Exception);
2413 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2415 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2416 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2417 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2418 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2419 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2420 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2423 int __len__() const throw(INTERP_KERNEL::Exception)
2425 return self->getNumberOfTS();
2428 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2430 if(elt0 && PyInt_Check(elt0))
2432 int pos=PyInt_AS_LONG(elt0);
2435 else if(elt0 && PyTuple_Check(elt0))
2437 if(PyTuple_Size(elt0)==2)
2439 PyObject *o0=PyTuple_GetItem(elt0,0);
2440 PyObject *o1=PyTuple_GetItem(elt0,1);
2441 if(PyInt_Check(o0) && PyInt_Check(o1))
2443 int iter=PyInt_AS_LONG(o0);
2444 int order=PyInt_AS_LONG(o1);
2445 return self->getPosOfTimeStep(iter,order);
2448 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 !");
2451 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 !");
2453 else if(elt0 && PyFloat_Check(elt0))
2455 double val=PyFloat_AS_DOUBLE(elt0);
2456 return self->getPosGivenTime(val);
2459 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2462 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2464 std::vector< std::pair<int,int> > res(self->getIterations());
2465 return convertVecPairIntToPy(res);
2468 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2470 std::vector<double> ret1;
2471 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2472 std::size_t sz=ret.size();
2473 PyObject *ret2=PyList_New(sz);
2474 for(std::size_t i=0;i<sz;i++)
2476 PyObject *elt=PyTuple_New(3);
2477 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2478 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2479 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2480 PyList_SetItem(ret2,i,elt);
2485 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2487 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2488 PyObject *ret2=PyList_New(ret.size());
2489 for(int i=0;i<(int)ret.size();i++)
2491 const std::vector<TypeOfField>& rett=ret[i];
2492 PyObject *ret3=PyList_New(rett.size());
2493 for(int j=0;j<(int)rett.size();j++)
2494 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2495 PyList_SetItem(ret2,i,ret3);
2500 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2502 std::vector<int> ret1;
2503 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2504 PyObject *elt=PyTuple_New(2);
2505 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2506 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2510 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2512 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2513 std::vector< std::vector<TypeOfField> > typesF;
2514 std::vector< std::vector<std::string> > pfls;
2515 std::vector< std::vector<std::string> > locs;
2516 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2518 PyObject *ret2=PyList_New(sz);
2519 for(int i=0;i<sz;i++)
2521 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2522 const std::vector<TypeOfField>& typesFI=typesF[i];
2523 const std::vector<std::string>& pflsI=pfls[i];
2524 const std::vector<std::string>& locsI=locs[i];
2525 PyObject *elt=PyTuple_New(2);
2526 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2527 int sz2=ret[i].size();
2528 PyObject *elt2=PyList_New(sz2);
2529 for(int j=0;j<sz2;j++)
2531 PyObject *elt3=PyTuple_New(4);
2532 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2533 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));
2534 PyTuple_SetItem(elt3,1,elt4);
2535 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2536 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2537 PyList_SetItem(elt2,j,elt3);
2539 PyTuple_SetItem(elt,1,elt2);
2540 PyList_SetItem(ret2,i,elt);
2545 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2547 if(PyList_Check(elts))
2549 int sz=PyList_Size(elts);
2550 std::vector<int> ret(sz);
2551 for(int i=0;i<sz;i++)
2553 PyObject *elt=PyList_GetItem(elts,i);
2554 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2560 std::vector<int> ret(1);
2561 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2566 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2568 if(PySlice_Check(elts))
2570 Py_ssize_t strt=2,stp=2,step=2;
2571 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2572 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2573 self->eraseTimeStepIds2(strt,stp,step);
2577 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2578 if(!idsToRemove.empty())
2579 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2583 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2587 std::vector<int> pos2;
2588 DataArrayInt *pos3=0;
2589 DataArrayIntTuple *pos4=0;
2590 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2595 self->eraseTimeStepIds(&pos1,&pos1+1);
2602 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2607 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2611 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2615 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2617 return self->iterator();
2620 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2622 if(elt0 && PyList_Check(elt0))
2624 int sz=PyList_Size(elt0);
2625 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2626 int *pt=da->getPointer();
2627 for(int i=0;i<sz;i++,pt++)
2629 PyObject *elt1=PyList_GetItem(elt0,i);
2630 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2632 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2634 else if(elt0 && PySlice_Check(elt0))
2636 Py_ssize_t strt=2,stp=2,step=2;
2637 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2638 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2639 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2642 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2645 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2647 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2648 return self->changeMeshNames(modifTab);
2651 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2653 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2654 std::size_t sz=ret.size();
2655 PyObject *retPy=PyList_New(sz);
2656 for(std::size_t i=0;i<sz;i++)
2657 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2661 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2663 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2664 std::size_t sz=ret.size();
2665 PyObject *retPy=PyList_New(sz);
2666 for(std::size_t i=0;i<sz;i++)
2667 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2671 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2673 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2674 std::size_t sz=ret.size();
2675 PyObject *retPy=PyList_New(sz);
2676 for(std::size_t i=0;i<sz;i++)
2677 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2681 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2684 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2685 if(SWIG_IsOK(status))
2687 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2691 std::vector<MEDFileAnyTypeField1TS *> tmp;
2692 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2693 self->pushBackTimeSteps(tmp);
2697 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2699 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2700 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2701 return self->extractPart(extractDefCpp,mm);
2704 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2706 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2707 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2708 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2709 std::size_t sz=ret.size();
2710 PyObject *retPy=PyList_New(sz);
2711 for(std::size_t i=0;i<sz;i++)
2713 std::size_t sz2=ret[i].size();
2714 PyObject *ret1Py=PyList_New(sz2);
2715 for(std::size_t j=0;j<sz2;j++)
2717 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2720 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2722 PyList_SetItem(retPy,i,ret1Py);
2727 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2729 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2730 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2731 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2732 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2733 if(ret2.size()!=ret.size())
2735 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2736 throw INTERP_KERNEL::Exception(oss.str().c_str());
2738 std::size_t sz=ret.size();
2739 PyObject *retPy=PyList_New(sz);
2740 for(std::size_t i=0;i<sz;i++)
2742 std::size_t sz2=ret[i].size();
2743 PyObject *ret0Py=PyTuple_New(2);
2744 PyObject *ret1Py=PyList_New(sz2);
2745 for(std::size_t j=0;j<sz2;j++)
2747 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2750 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2752 PyTuple_SetItem(ret0Py,0,ret1Py);
2753 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2754 PyList_SetItem(retPy,i,ret0Py);
2761 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2764 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2765 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2766 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2767 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2769 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2770 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2771 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2772 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2773 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2774 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2776 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2777 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2778 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2781 MEDFileFieldMultiTS()
2783 return MEDFileFieldMultiTS::New();
2786 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2788 return MEDFileFieldMultiTS::New(fileName,loadAll);
2791 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2793 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2796 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2798 return MEDFileFieldMultiTS::New(db);
2802 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2804 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2807 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2809 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2810 std::size_t sz(tmp.size());
2811 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2812 for(std::size_t i=0;i<sz;i++)
2814 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2815 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2817 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2820 std::string __str__() const throw(INTERP_KERNEL::Exception)
2822 return self->simpleRepr();
2825 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2827 DataArrayInt *ret1=0;
2828 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2829 PyObject *ret=PyTuple_New(2);
2830 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2831 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2835 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2837 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2838 std::vector< std::vector<TypeOfField> > typesF;
2839 std::vector< std::vector<std::string> > pfls;
2840 std::vector< std::vector<std::string> > locs;
2841 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2843 PyObject *ret2=PyList_New(sz);
2844 for(int i=0;i<sz;i++)
2846 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2847 const std::vector<TypeOfField>& typesFI=typesF[i];
2848 const std::vector<std::string>& pflsI=pfls[i];
2849 const std::vector<std::string>& locsI=locs[i];
2850 PyObject *elt=PyTuple_New(2);
2851 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2852 int sz2=ret[i].size();
2853 PyObject *elt2=PyList_New(sz2);
2854 for(int j=0;j<sz2;j++)
2856 PyObject *elt3=PyTuple_New(4);
2857 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2858 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2859 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2860 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2861 PyList_SetItem(elt2,j,elt3);
2863 PyTuple_SetItem(elt,1,elt2);
2864 PyList_SetItem(ret2,i,elt);
2868 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2870 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2876 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2878 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2879 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2882 PyObject *ret=PyTuple_New(2);
2883 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2884 std::size_t sz=elt1Cpp.size();
2885 PyObject *elt=PyList_New(sz);
2886 for(std::size_t i=0;i<sz;i++)
2888 PyObject *elt1=PyTuple_New(2);
2889 PyObject *elt2=PyTuple_New(2);
2890 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2891 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2892 PyObject *elt3=PyTuple_New(2);
2893 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2894 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2895 PyTuple_SetItem(elt1,0,elt2);
2896 PyTuple_SetItem(elt1,1,elt3);
2897 PyList_SetItem(elt,i,elt1);
2899 PyTuple_SetItem(ret,1,elt);
2905 class MEDFileFieldsIterator
2910 PyObject *next() throw(INTERP_KERNEL::Exception)
2912 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2914 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2917 PyErr_SetString(PyExc_StopIteration,"No more data.");
2924 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2927 static MEDFileIntFieldMultiTS *New();
2928 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2929 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2930 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2932 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2933 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2934 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2935 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2936 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2937 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2938 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2939 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2940 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2943 MEDFileIntFieldMultiTS()
2945 return MEDFileIntFieldMultiTS::New();
2948 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2950 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2953 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2955 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2958 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2960 return MEDFileIntFieldMultiTS::New(db);
2964 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2966 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
2969 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2971 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2972 std::size_t sz(tmp.size());
2973 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2974 for(std::size_t i=0;i<sz;i++)
2976 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2977 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2979 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2982 std::string __str__() const throw(INTERP_KERNEL::Exception)
2984 return self->simpleRepr();
2987 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2989 DataArrayInt *ret1=0;
2990 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2991 PyObject *ret=PyTuple_New(2);
2992 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2993 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2997 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2999 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3007 class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
3010 static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3013 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
3016 static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms) throw(INTERP_KERNEL::Exception);
3018 MEDFileStructureElements();
3021 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3024 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3025 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3026 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3027 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3028 static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3029 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3030 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3031 void loadArrays() throw(INTERP_KERNEL::Exception);
3032 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3033 void unloadArrays() throw(INTERP_KERNEL::Exception);
3034 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3035 int getNumberOfFields() const;
3036 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3037 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3039 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3040 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3041 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3042 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3043 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3044 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3045 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3046 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3047 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3048 void killStructureElements() throw(INTERP_KERNEL::Exception);
3049 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3050 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3051 void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses) throw(INTERP_KERNEL::Exception);
3052 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3053 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3058 return MEDFileFields::New();
3061 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3063 return MEDFileFields::New(fileName,loadAll);
3066 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3068 return MEDFileFields::New(db);
3072 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3074 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3077 std::string __str__() const throw(INTERP_KERNEL::Exception)
3079 return self->simpleRepr();
3082 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3084 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3088 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3090 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3094 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3096 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3097 std::size_t sz(tmp.size());
3098 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3099 for(std::size_t i=0;i<sz;i++)
3101 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3102 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3104 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3107 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3109 std::vector< std::pair<std::string,std::string> > ps;
3110 self->getMeshSENames(ps);
3111 return convertVectPairStToPy(ps);
3114 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3117 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3118 PyObject *ret=PyTuple_New(2);
3119 PyObject *ret_0=PyList_New(ret0.size());
3121 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3123 PyObject *elt=PyTuple_New(2);
3124 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3125 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3126 PyList_SetItem(ret_0,rk,elt);
3128 PyTuple_SetItem(ret,0,ret_0);
3129 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3130 PyTuple_SetItem(ret,1,ret_1);
3134 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3136 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3137 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3140 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3142 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3143 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3146 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3148 if(obj && PyList_Check(obj))
3150 int sz=PyList_Size(obj);
3151 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3152 int *pt=da->getPointer();
3153 for(int i=0;i<sz;i++,pt++)
3155 PyObject *elt1=PyList_GetItem(obj,i);
3156 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3158 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3161 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3164 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3166 self->setFieldAtPos(obj,field);
3170 int __len__() const throw(INTERP_KERNEL::Exception)
3172 return self->getNumberOfFields();
3175 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3177 return self->iterator();
3180 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3182 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3183 return self->changeMeshNames(modifTab);
3186 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3188 if(elt0 && PyInt_Check(elt0))
3190 return PyInt_AS_LONG(elt0);
3192 else if(elt0 && PyString_Check(elt0))
3193 return self->getPosFromFieldName(PyString_AsString(elt0));
3195 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3198 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3200 if(PyList_Check(elts))
3202 int sz=PyList_Size(elts);
3203 std::vector<int> ret(sz);
3204 for(int i=0;i<sz;i++)
3206 PyObject *elt=PyList_GetItem(elts,i);
3207 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3213 std::vector<int> ret(1);
3214 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3219 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3221 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3222 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3223 self->pushFields(tmp);
3226 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3228 if(elts && PySlice_Check(elts))
3230 Py_ssize_t strt=2,stp=2,step=2;
3231 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3232 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3233 self->destroyFieldsAtPos2(strt,stp,step);
3237 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3238 if(!idsToRemove.empty())
3239 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3243 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3245 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3246 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3247 return self->extractPart(extractDefCpp,mm);
3252 class MEDFileParameter1TS : public RefCountObject
3255 void setIteration(int it);
3256 int getIteration() const;
3257 void setOrder(int order);
3258 int getOrder() const;
3259 void setTimeValue(double time);
3260 void setTime(int dt, int it, double time);
3261 double getTime(int& dt, int& it);
3262 double getTimeValue() const;
3265 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3268 void setValue(double val) throw(INTERP_KERNEL::Exception);
3269 double getValue() const throw(INTERP_KERNEL::Exception);
3270 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3273 std::string __str__() const throw(INTERP_KERNEL::Exception)
3275 return self->simpleRepr();
3280 class MEDFileParameterTinyInfo : public MEDFileWritable
3283 void setDescription(const std::string& name);
3284 std::string getDescription() const;
3285 void setTimeUnit(const std::string& unit);
3286 std::string getTimeUnit() const;
3289 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3292 static MEDFileParameterDouble1TS *New();
3293 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3294 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3295 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3296 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3297 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3298 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3299 std::string getName() const throw(INTERP_KERNEL::Exception);
3300 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3303 MEDFileParameterDouble1TS()
3305 return MEDFileParameterDouble1TS::New();
3308 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3310 return MEDFileParameterDouble1TS::New(fileName);
3313 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3315 return MEDFileParameterDouble1TS::New(fileName,paramName);
3318 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3320 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3323 std::string __str__() const throw(INTERP_KERNEL::Exception)
3325 return self->simpleRepr();
3328 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3331 bool ret0=self->isEqual(other,eps,what);
3332 PyObject *res=PyList_New(2);
3333 PyObject *ret0Py=ret0?Py_True:Py_False;
3335 PyList_SetItem(res,0,ret0Py);
3336 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3342 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3345 static MEDFileParameterMultiTS *New();
3346 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3347 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3348 std::string getName() const;
3349 void setName(const std::string& name);
3350 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3351 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3352 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3353 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3354 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3355 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3356 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3357 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3360 MEDFileParameterMultiTS()
3362 return MEDFileParameterMultiTS::New();
3365 MEDFileParameterMultiTS(const std::string& fileName)
3367 return MEDFileParameterMultiTS::New(fileName);
3370 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3372 return MEDFileParameterMultiTS::New(fileName,paramName);
3375 std::string __str__() const throw(INTERP_KERNEL::Exception)
3377 return self->simpleRepr();
3380 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3383 bool ret0=self->isEqual(other,eps,what);
3384 PyObject *res=PyList_New(2);
3385 PyObject *ret0Py=ret0?Py_True:Py_False;
3387 PyList_SetItem(res,0,ret0Py);
3388 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3392 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3396 std::vector<int> pos2;
3397 DataArrayInt *pos3=0;
3398 DataArrayIntTuple *pos4=0;
3399 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3404 self->eraseTimeStepIds(&pos1,&pos1+1);
3411 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3416 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3420 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3424 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3426 if(elt0 && PyInt_Check(elt0))
3428 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3431 else if(elt0 && PyTuple_Check(elt0))
3433 if(PyTuple_Size(elt0)==2)
3435 PyObject *o0=PyTuple_GetItem(elt0,0);
3436 PyObject *o1=PyTuple_GetItem(elt0,1);
3437 if(PyInt_Check(o0) && PyInt_Check(o1))
3439 int iter=PyInt_AS_LONG(o0);
3440 int order=PyInt_AS_LONG(o1);
3441 return self->getPosOfTimeStep(iter,order);
3444 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 !");
3447 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 !");
3449 else if(elt0 && PyFloat_Check(elt0))
3451 double val=PyFloat_AS_DOUBLE(elt0);
3452 return self->getPosGivenTime(val);
3455 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3458 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3460 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3466 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3468 if(PyList_Check(elts))
3470 int sz=PyList_Size(elts);
3471 std::vector<int> ret(sz);
3472 for(int i=0;i<sz;i++)
3474 PyObject *elt=PyList_GetItem(elts,i);
3475 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3481 std::vector<int> ret(1);
3482 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3487 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3489 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3490 if(!idsToRemove.empty())
3491 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3494 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3496 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3502 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3504 std::vector< std::pair<int,int> > res=self->getIterations();
3505 PyObject *ret=PyList_New(res.size());
3507 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3509 PyObject *elt=PyTuple_New(2);
3510 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3511 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3512 PyList_SetItem(ret,rk,elt);
3517 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3519 std::vector<double> res2;
3520 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3521 PyObject *ret=PyList_New(res.size());
3523 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3525 PyObject *elt=PyTuple_New(3);
3526 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3527 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3528 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3529 PyList_SetItem(ret,rk,elt);
3536 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3539 static MEDFileParameters *New();
3540 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3541 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3542 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3543 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3544 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3545 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3546 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3547 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3548 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3549 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3550 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3555 return MEDFileParameters::New();
3558 MEDFileParameters(const std::string& fileName)
3560 return MEDFileParameters::New(fileName);
3563 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3565 return MEDFileParameters::New(db);
3569 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3571 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3574 std::string __str__() const throw(INTERP_KERNEL::Exception)
3576 return self->simpleRepr();
3579 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3581 if(PyInt_Check(obj))
3583 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3588 else if(PyString_Check(obj))
3590 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3596 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3599 int __len__() const throw(INTERP_KERNEL::Exception)
3601 return self->getNumberOfParams();
3604 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3606 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3612 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3614 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3620 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3623 bool ret0=self->isEqual(other,eps,what);
3624 PyObject *res=PyList_New(2);
3625 PyObject *ret0Py=ret0?Py_True:Py_False;
3627 PyList_SetItem(res,0,ret0Py);
3628 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3634 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3637 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3638 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3639 static MEDFileData *New();
3640 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3641 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3642 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3643 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3644 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3645 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3646 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3648 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3649 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3650 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3651 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3652 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3656 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3658 return MEDFileData::New(fileName);
3661 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3663 return MEDFileData::New(db);
3668 return MEDFileData::New();
3671 std::string __str__() const throw(INTERP_KERNEL::Exception)
3673 return self->simpleRepr();
3676 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3678 MEDFileMeshes *ret=self->getMeshes();
3684 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3686 MEDFileParameters *ret=self->getParams();
3692 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3694 MEDFileFields *ret=self->getFields();
3700 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3702 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3703 return self->changeMeshNames(modifTab);
3706 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3708 std::vector<const MEDFileData *> mfdsCpp;
3709 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3710 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3715 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3717 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3722 class SauvReader : public RefCountObject
3725 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3726 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3729 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3731 return SauvReader::New(fileName);
3736 class SauvWriter : public RefCountObject
3739 static SauvWriter * New();
3740 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3741 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3742 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3743 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3746 SauvWriter() throw(INTERP_KERNEL::Exception)
3748 return SauvWriter::New();
3755 class MEDFileMeshStruct;
3757 class MEDFileField1TSStructItem
3760 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3763 class MEDFileMeshStruct : public RefCountObject
3766 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3768 ~MEDFileMeshStruct();
3771 class MEDMeshMultiLev : public RefCountObject
3774 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3775 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3776 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3782 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3784 DataArrayInt *famIds(0);
3785 bool isWithoutCopy(false);
3786 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3787 PyObject *ret=PyTuple_New(2);
3788 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3790 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3791 PyTuple_SetItem(ret,1,ret1Py);
3795 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3797 DataArrayInt *numIds(0);
3798 bool isWithoutCopy(false);
3799 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3800 PyObject *ret=PyTuple_New(2);
3801 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3803 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3804 PyTuple_SetItem(ret,1,ret1Py);
3808 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3810 DataArrayInt *famIds(0);
3811 bool isWithoutCopy(false);
3812 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3813 PyObject *ret=PyTuple_New(2);
3814 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3816 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3817 PyTuple_SetItem(ret,1,ret1Py);
3821 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3823 DataArrayInt *numIds(0);
3824 bool isWithoutCopy(false);
3825 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3826 PyObject *ret=PyTuple_New(2);
3827 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3829 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3830 PyTuple_SetItem(ret,1,ret1Py);
3834 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3836 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3837 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3838 PyObject *res(PyList_New(result.size()));
3839 for(int i=0;iL!=result.end(); i++, iL++)
3840 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3846 class MEDUMeshMultiLev : public MEDMeshMultiLev
3849 ~MEDUMeshMultiLev();
3853 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3855 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3856 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3857 PyObject *ret0Py=ncc?Py_True:Py_False;
3859 PyObject *ret=PyTuple_New(7);
3860 PyTuple_SetItem(ret,0,ret0Py);
3861 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3862 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3863 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3864 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3865 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3866 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3872 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3875 ~MEDStructuredMeshMultiLev();
3878 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3881 ~MEDCMeshMultiLev();
3885 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3888 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3889 std::size_t sz(objs.size());
3890 PyObject *ret(PyTuple_New(2));
3891 PyObject *ret0=PyList_New(sz);
3892 for(std::size_t i=0;i<sz;i++)
3893 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3894 PyTuple_SetItem(ret,0,ret0);
3895 PyObject *ret1Py(isInternal?Py_True:Py_False);
3897 PyTuple_SetItem(ret,1,ret1Py);
3903 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3906 ~MEDCurveLinearMeshMultiLev();
3910 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3912 DataArrayDouble *ret0(0);
3913 std::vector<int> ret1;
3915 self->buildVTUArrays(ret0,ret1,ret2);
3916 std::size_t sz(ret1.size());
3917 PyObject *ret=PyTuple_New(3);
3918 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3919 PyObject *ret1Py=PyList_New(sz);
3920 for(std::size_t i=0;i<sz;i++)
3921 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3922 PyTuple_SetItem(ret,1,ret1Py);
3923 PyObject *ret2Py(ret2?Py_True:Py_False);
3925 PyTuple_SetItem(ret,2,ret2Py);
3931 class MEDFileFastCellSupportComparator : public RefCountObject
3934 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3935 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3936 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3937 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3939 ~MEDFileFastCellSupportComparator();
3943 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3945 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3946 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3947 PyObject *res(PyList_New(result.size()));
3948 for(int i=0;iL!=result.end(); i++, iL++)
3949 PyList_SetItem(res,i,PyInt_FromLong(*iL));