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::MEDFileFields::New;
144 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
145 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
146 %newobject MEDCoupling::MEDFileFields::deepCopy;
147 %newobject MEDCoupling::MEDFileFields::shallowCpy;
148 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
149 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
150 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
151 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
152 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
153 %newobject MEDCoupling::MEDFileFields::__iter__;
154 %newobject MEDCoupling::MEDFileFields::extractPart;
156 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
183 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
185 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
187 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
188 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
189 %newobject MEDCoupling::MEDFileField1TS::New;
190 %newobject MEDCoupling::MEDFileField1TS::field;
191 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
193 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
194 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
195 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
196 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
198 %newobject MEDCoupling::MEDFileIntField1TS::New;
199 %newobject MEDCoupling::MEDFileIntField1TS::field;
200 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
202 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
203 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
204 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
205 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
207 %newobject MEDCoupling::MEDFileData::New;
208 %newobject MEDCoupling::MEDFileData::deepCopy;
209 %newobject MEDCoupling::MEDFileData::getMeshes;
210 %newobject MEDCoupling::MEDFileData::getFields;
211 %newobject MEDCoupling::MEDFileData::getParams;
212 %newobject MEDCoupling::MEDFileData::Aggregate;
214 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
215 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
216 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
218 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
219 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
220 %newobject MEDCoupling::MEDFileParameters::New;
221 %newobject MEDCoupling::MEDFileParameters::deepCopy;
222 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
223 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
224 %newobject MEDCoupling::MEDFileParameters::__getitem__;
226 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
227 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
228 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
229 %newobject MEDCoupling::MEDFileJointOneStep::New;
230 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
231 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
232 %newobject MEDCoupling::MEDFileJoint::New;
233 %newobject MEDCoupling::MEDFileJoint::deepCopy;
234 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
235 %newobject MEDCoupling::MEDFileJoints::New;
236 %newobject MEDCoupling::MEDFileJoints::deepCopy;
237 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
238 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
239 %newobject MEDCoupling::MEDFileJoints::__getitem__;
240 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
241 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
242 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
243 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
244 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
245 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
246 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
247 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
248 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
250 %newobject MEDCoupling::SauvWriter::New;
251 %newobject MEDCoupling::SauvReader::New;
252 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
254 %newobject MEDCoupling::MEDFileMeshStruct::New;
255 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
256 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
257 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
258 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
259 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
261 %feature("unref") MEDFileMesh "$this->decrRef();"
262 %feature("unref") MEDFileUMesh "$this->decrRef();"
263 %feature("unref") MEDFileCMesh "$this->decrRef();"
264 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
265 %feature("unref") MEDFileMeshes "$this->decrRef();"
266 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
267 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
268 %feature("unref") MEDFileField1TS "$this->decrRef();"
269 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
270 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
273 %feature("unref") MEDFileFields "$this->decrRef();"
274 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
275 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
276 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
277 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
278 %feature("unref") MEDFileParameters "$this->decrRef();"
279 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
280 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
281 %feature("unref") MEDFileJoint "$this->decrRef();"
282 %feature("unref") MEDFileJoints "$this->decrRef();"
283 %feature("unref") MEDFileEquivalences "$this->decrRef();"
284 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
285 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
287 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
288 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
289 %feature("unref") MEDFileData "$this->decrRef();"
290 %feature("unref") SauvReader "$this->decrRef();"
291 %feature("unref") SauvWriter "$this->decrRef();"
292 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
293 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
294 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
296 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
297 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
299 namespace MEDCoupling
302 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
303 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
304 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
305 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
306 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
307 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
318 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
319 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
320 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
321 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
324 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
325 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
326 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);
327 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);
328 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);
329 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);
330 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);
331 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
332 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
335 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
336 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
339 %rename (MEDFileVersion) MEDFileVersionSwig;
340 %rename (GetFieldIterations) GetFieldIterationsSwig;
341 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
342 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
343 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
344 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
345 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
346 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
347 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
348 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
349 %rename (WriteUMeshes) WriteUMeshesSwig;
350 %rename (GetTypesOfField) GetTypesOfFieldSwig;
351 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
352 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
356 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
358 int major,minor,release;
359 MEDCoupling::MEDFileVersion(major,minor,release);
360 PyObject *ret(PyTuple_New(3));
361 PyTuple_SetItem(ret,0,SWIG_From_int(major));
362 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
363 PyTuple_SetItem(ret,2,SWIG_From_int(release));
367 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
369 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
370 PyObject *ret=PyList_New(res.size());
372 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
374 PyObject *elt=PyTuple_New(2);
375 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
376 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
377 PyList_SetItem(ret,rk,elt);
382 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
384 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
385 PyObject *ret=PyList_New(res.size());
387 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
389 PyObject *elt=PyTuple_New(3);
390 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
391 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
392 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
393 PyList_SetItem(ret,rk,elt);
398 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
400 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
401 PyObject *ret=PyList_New(res.size());
403 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
405 PyObject *elt=PyTuple_New(2);
406 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
407 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
408 PyList_SetItem(ret,rk,elt);
413 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
415 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
416 PyObject *ret=PyList_New(res.size());
418 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
420 PyObject *elt=PyTuple_New(2);
421 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
422 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
423 PyList_SetItem(ret,rk,elt);
428 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
430 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
431 PyObject *ret=PyList_New(res.size());
433 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
435 PyObject *elt=PyTuple_New(2);
436 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
437 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
438 PyList_SetItem(ret,rk,elt);
443 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
445 int meshDim,spaceDim,numberOfNodes;
446 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
447 PyObject *ret=PyTuple_New(4);
448 PyObject *elt0=PyList_New(res.size());
450 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
452 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
454 PyObject *elt1=PyList_New(obj2.size());
455 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
457 PyObject *elt2=PyTuple_New(2);
458 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
459 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
460 PyList_SetItem(elt1,j,elt2);
462 PyList_SetItem(elt0,i,elt1);
464 PyTuple_SetItem(ret,0,elt0);
465 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
466 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
467 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
471 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
472 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
474 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
475 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
476 return convertFieldDoubleVecToPy(res);
479 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
481 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
482 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
483 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
486 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
488 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
489 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
490 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
493 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
495 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
496 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
497 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
500 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
502 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
504 PyObject *ret=PyList_New(size);
505 for(int i=0;i<size;i++)
506 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
510 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
512 std::vector<std::string> grps;
513 converPyListToVecString(li,grps);
514 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
517 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
519 std::vector<std::string> fams;
520 converPyListToVecString(li,fams);
521 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
525 namespace MEDCoupling
527 class MEDFileWritable
530 void copyOptionsFrom(const MEDFileWritable& other) const;
531 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
532 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
533 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
534 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
537 class MEDFileWritableStandAlone : public MEDFileWritable
540 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
541 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
544 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
546 MCAuto<DataArrayByte> ret(self->serialize());
550 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
552 PyObject *ret(PyList_New(0));
556 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
560 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
563 PyObject *ret(PyTuple_New(1));
564 PyObject *ret0(PyDict_New());
565 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
566 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
567 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
568 PyObject *tmp1(PyInt_FromLong(0));
569 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
570 PyTuple_SetItem(ret,0,ret0);
574 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
580 class MEDFileMeshReadSelector
583 MEDFileMeshReadSelector();
584 MEDFileMeshReadSelector(unsigned int code);
585 unsigned int getCode() const;
586 void setCode(unsigned int newCode);
587 bool isCellFamilyFieldReading() const;
588 bool isNodeFamilyFieldReading() const;
589 bool isCellNameFieldReading() const;
590 bool isNodeNameFieldReading() const;
591 bool isCellNumFieldReading() const;
592 bool isNodeNumFieldReading() const;
593 void setCellFamilyFieldReading(bool b);
594 void setNodeFamilyFieldReading(bool b);
595 void setCellNameFieldReading(bool b);
596 void setNodeNameFieldReading(bool b);
597 void setCellNumFieldReading(bool b);
598 void setNodeNumFieldReading(bool b);
601 std::string __str__() const throw(INTERP_KERNEL::Exception)
603 std::ostringstream oss;
608 std::string __repr__() const throw(INTERP_KERNEL::Exception)
610 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
616 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
619 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
620 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
621 throw(INTERP_KERNEL::Exception);
622 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
623 INTERP_KERNEL::NormalizedCellType loc_geo_type,
624 INTERP_KERNEL::NormalizedCellType rem_geo_type)
625 throw(INTERP_KERNEL::Exception);
626 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
627 MEDFileJointCorrespondence *deepCopy() const;
628 MEDFileJointCorrespondence *shallowCpy() const;
629 void setIsNodal(bool isNodal);
630 bool getIsNodal() const;
631 bool isEqual(const MEDFileJointCorrespondence *other) const;
632 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
633 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
634 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
635 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
636 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
637 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
638 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);
639 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
642 MEDFileJointCorrespondence()
644 return MEDFileJointCorrespondence::New();
646 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
648 return MEDFileJointCorrespondence::New(correspondence);
650 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
651 INTERP_KERNEL::NormalizedCellType loc_geo_type,
652 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
654 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
657 std::string __str__() const throw(INTERP_KERNEL::Exception)
659 return self->simpleRepr();
664 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
667 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
668 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
669 MEDFileJointOneStep *deepCopy() const;
670 MEDFileJointOneStep *shallowCpy() const;
671 bool isEqual(const MEDFileJointOneStep *other) const;
672 void setOrder(int order);
673 int getOrder() const;
674 void setIteration(int it);
675 int getIteration() const;
676 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
677 int getNumberOfCorrespondences() const;
678 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
679 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
680 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
683 MEDFileJointOneStep()
685 return MEDFileJointOneStep::New();
688 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
690 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
693 std::string __str__() const throw(INTERP_KERNEL::Exception)
695 return self->simpleRepr();
700 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
703 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
704 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
705 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
706 MEDFileJoint *deepCopy() const;
707 MEDFileJoint *shallowCpy() const;
708 bool isEqual(const MEDFileJoint *other) const;
709 void setLocalMeshName(const std::string& name);
710 std::string getLocalMeshName() const;
711 void setRemoteMeshName(const std::string& name);
712 std::string getRemoteMeshName() const;
713 void setDescription(const std::string& name);
714 std::string getDescription() const;
715 void setJointName(const std::string& name);
716 std::string getJointName() const;
717 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
718 void setDomainNumber(const int& number);
719 int getDomainNumber() const;
720 void pushStep(MEDFileJointOneStep* step);
721 int getNumberOfSteps() const;
722 MEDFileJointOneStep *getStepAtPos(int i) const;
723 std::string simpleRepr() const;
728 return MEDFileJoint::New();
731 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
733 return MEDFileJoint::New(fileName,mName,num);
736 std::string __str__() const throw(INTERP_KERNEL::Exception)
738 return self->simpleRepr();
743 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
746 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
747 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
748 MEDFileJoints *deepCopy() const;
749 std::string simpleRepr() const;
750 std::string getMeshName() const;
751 int getNumberOfJoints() const;
752 std::vector<std::string> getJointsNames() const;
753 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
754 void resize(int newSize) throw(INTERP_KERNEL::Exception);
755 void pushJoint(MEDFileJoint *joint);
756 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
757 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
762 return MEDFileJoints::New();
765 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
767 return MEDFileJoints::New(fileName,meshName);
770 std::string __str__() const throw(INTERP_KERNEL::Exception)
772 return self->simpleRepr();
775 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
779 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
784 else if(PyString_Check(obj))
786 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
792 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
795 int __len__() const throw(INTERP_KERNEL::Exception)
797 return self->getNumberOfJoints();
800 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
802 MEDFileJoint *ret=self->getJointAtPos(i);
808 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
810 MEDFileJoint *ret=self->getJointWithName(paramName);
818 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
821 MEDFileEquivalenceBase();
824 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
827 MEDFileEquivalenceData();
829 void setArray(DataArrayInt *data);
832 DataArrayInt *getArray()
834 DataArrayInt *ret(self->getArray());
835 if(ret) ret->incrRef();
841 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
844 MEDFileEquivalenceNode();
847 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
850 MEDFileEquivalenceCell();
853 std::size_t size() const;
854 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
855 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
858 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
860 DataArrayInt *ret(self->getArray(type));
861 if(ret) ret->incrRef();
865 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
867 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
868 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
869 PyObject *res=PyList_New(result.size());
870 for(int i=0;iL!=result.end(); i++, iL++)
871 PyList_SetItem(res,i,PyInt_FromLong(*iL));
877 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
880 MEDFileEquivalencePair();
882 std::string getName() const;
883 void setName(const std::string& name);
884 std::string getDescription() const;
885 void setDescription(const std::string& descr);
886 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
889 MEDFileEquivalenceCell *initCell()
891 MEDFileEquivalenceCell *ret(self->initCell());
892 if(ret) ret->incrRef();
896 MEDFileEquivalenceNode *initNode()
898 MEDFileEquivalenceNode *ret(self->initNode());
899 if(ret) ret->incrRef();
903 MEDFileEquivalenceCell *getCell()
905 MEDFileEquivalenceCell *ret(self->getCell());
906 if(ret) ret->incrRef();
910 MEDFileEquivalenceNode *getNode()
912 MEDFileEquivalenceNode *ret(self->getNode());
913 if(ret) ret->incrRef();
919 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
922 MEDFileEquivalences();
925 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
926 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
927 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
931 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
933 MEDFileEquivalencePair *ret(self->getEquivalence(i));
934 if(ret) ret->incrRef();
937 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
939 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
940 if(ret) ret->incrRef();
944 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
946 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
947 if(ret) ret->incrRef();
953 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
956 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
957 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
958 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
959 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
960 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
961 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
962 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
963 void setName(const std::string& name);
964 std::string getName();
965 std::string getUnivName() const;
966 bool getUnivNameWrStatus() const;
967 void setUnivNameWrStatus(bool newStatus);
968 void setDescription(const std::string& name);
969 std::string getDescription() const;
970 void setOrder(int order);
971 int getOrder() const;
972 void setIteration(int it);
974 void setTimeValue(double time);
975 void setTime(int dt, int it, double time);
976 double getTimeValue() const;
977 void setTimeUnit(const std::string& unit);
978 std::string getTimeUnit() const;
979 void setAxisType(MEDCouplingAxisType at);
980 MEDCouplingAxisType getAxisType() const;
981 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
982 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
983 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
984 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
985 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
986 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
987 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
988 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
989 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
990 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
991 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
992 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
993 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
994 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
996 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
997 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
998 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
999 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1000 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1001 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1002 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1003 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1004 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1005 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1006 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1007 void clearFamMap() throw(INTERP_KERNEL::Exception);
1008 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1009 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1010 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1011 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1012 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1013 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1014 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1015 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1016 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1017 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1018 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1019 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1020 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1021 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1022 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1023 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1024 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1025 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1026 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1027 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1028 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1029 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1030 static std::string GetMagicFamilyStr();
1031 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1032 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1033 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1034 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1035 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1036 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1037 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1038 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1039 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1040 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1041 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1042 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1043 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1044 void setFamilyInfo(const std::map<std::string,int>& info);
1045 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1046 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1047 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1048 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1049 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1050 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1051 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1052 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1053 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1054 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1055 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1056 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1057 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1058 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1059 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1060 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1061 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1062 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1063 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1064 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1065 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1067 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1068 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1069 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1070 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1071 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1072 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1073 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1074 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1075 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1076 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1077 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1078 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1079 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1080 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1081 int getNumberOfJoints();
1082 MEDFileJoints *getJoints();
1083 void setJoints( MEDFileJoints* joints );
1084 void initializeEquivalences();
1085 void killEquivalences();
1086 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1087 void killStructureElements() throw(INTERP_KERNEL::Exception);
1090 std::string __str__() const throw(INTERP_KERNEL::Exception)
1092 return self->simpleRepr();
1095 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1097 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1100 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1103 double tmp0=self->getTime(tmp1,tmp2);
1104 PyObject *res = PyList_New(3);
1105 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1106 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1107 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1111 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1114 bool ret0=self->isEqual(other,eps,what);
1115 PyObject *res=PyList_New(2);
1116 PyObject *ret0Py=ret0?Py_True:Py_False;
1118 PyList_SetItem(res,0,ret0Py);
1119 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1123 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1125 std::vector<const DataArrayInt *> grps;
1126 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1127 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1130 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1133 bool ret0=self->areFamsEqual(other,what);
1134 PyObject *res=PyList_New(2);
1135 PyObject *ret0Py=ret0?Py_True:Py_False;
1137 PyList_SetItem(res,0,ret0Py);
1138 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1142 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1145 bool ret0=self->areGrpsEqual(other,what);
1146 PyObject *res=PyList_New(2);
1147 PyObject *ret0Py=ret0?Py_True:Py_False;
1149 PyList_SetItem(res,0,ret0Py);
1150 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1154 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1156 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1157 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1158 PyObject *res=PyList_New(result.size());
1159 for(int i=0;iL!=result.end(); i++, iL++)
1160 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1164 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1166 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1167 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1168 PyObject *res=PyList_New(result.size());
1169 for(int i=0;iL!=result.end(); i++, iL++)
1170 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1174 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1176 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1179 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1182 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1184 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1187 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1190 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1192 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1195 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1198 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1200 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1203 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1206 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1208 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1211 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1214 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1217 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1218 PyObject *ret=PyTuple_New(2);
1219 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1220 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1224 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1226 DataArrayInt *ret3=0;
1227 std::vector<int> ret1,ret2;
1228 bool ret0=self->unPolyze(ret1,ret2,ret3);
1229 PyObject *ret=PyTuple_New(4);
1230 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1232 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1233 for(int j=0;j<(int)ret1.size()/3;j++)
1235 PyObject *retLev2=PyList_New(3);
1236 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1237 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1238 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1239 PyList_SetItem(retLev1_0,j,retLev2);
1241 PyTuple_SetItem(ret,1,retLev1_0);
1243 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1244 for(int j=0;j<(int)ret2.size()/3;j++)
1246 PyObject *retLev2=PyList_New(3);
1247 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1248 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1249 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1250 PyList_SetItem(retLev1_1,j,retLev2);
1252 PyTuple_SetItem(ret,2,retLev1_1);
1254 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1258 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1260 MEDFileEquivalences *ret(self->getEquivalences());
1261 if(ret) ret->incrRef();
1267 class MEDFileUMesh : public MEDFileMesh
1270 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1271 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1272 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1273 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1274 static MEDFileUMesh *New();
1275 static const char *GetSpeStr4ExtMesh();
1277 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1278 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1279 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1280 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1281 void clearNodeAndCellNumbers();
1283 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1284 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1285 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1286 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1287 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1288 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1289 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1290 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1291 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1292 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1294 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1295 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1296 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1297 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1298 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1299 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1300 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1301 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1302 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1303 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1304 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1305 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1306 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1307 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1308 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1311 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1313 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1316 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1318 return MEDFileUMesh::New(fileName,mrs);
1321 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1323 return MEDFileUMesh::New(mem);
1326 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1328 return MEDFileUMesh::New(db);
1333 return MEDFileUMesh::New();
1337 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1339 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1342 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)
1344 std::vector<int> typesCpp1;
1345 convertPyToNewIntArr3(types,typesCpp1);
1346 std::size_t sz(typesCpp1.size());
1347 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1348 for(std::size_t ii=0;ii<sz;ii++)
1349 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1350 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1353 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1354 {// put an empty dict in input to say to __new__ to call __init__...
1355 PyObject *ret(PyTuple_New(1));
1356 PyObject *ret0(PyDict_New());
1357 PyTuple_SetItem(ret,0,ret0);
1361 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1363 std::vector<double> a0;
1364 std::vector<int> a1;
1365 std::vector<std::string> a2;
1366 std::vector< MCAuto<DataArrayInt> > a3;
1367 MCAuto<DataArrayDouble> a4;
1368 self->serialize(a0,a1,a2,a3,a4);
1369 PyObject *ret(PyTuple_New(5));
1370 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1371 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1373 PyObject *ret2(PyList_New(sz));
1374 for(int i=0;i<sz;i++)
1375 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1376 PyTuple_SetItem(ret,2,ret2);
1378 PyObject *ret3(PyList_New(sz));
1379 for(int i=0;i<sz;i++)
1381 DataArrayInt *elt(a3[i]);
1384 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1386 PyTuple_SetItem(ret,3,ret3);
1387 DataArrayDouble *ret4(a4);
1390 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1394 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1396 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1397 if(!PyTuple_Check(inp))
1398 throw INTERP_KERNEL::Exception(MSG);
1399 int sz(PyTuple_Size(inp));
1401 throw INTERP_KERNEL::Exception(MSG);
1402 std::vector<double> a0;
1403 std::vector<int> a1;
1404 std::vector<std::string> a2;
1405 std::vector< MCAuto<DataArrayInt> > a3;
1406 MCAuto<DataArrayDouble> a4;
1408 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1410 fillArrayWithPyListDbl3(a0py,tmp,a0);
1411 convertPyToNewIntArr3(a1py,a1);
1412 fillStringVector(a2py,a2);
1414 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1416 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1417 if(!SWIG_IsOK(status))
1418 throw INTERP_KERNEL::Exception(MSG);
1419 a4=reinterpret_cast<DataArrayDouble *>(argp);
1420 if((DataArrayDouble *)a4)
1423 std::vector< DataArrayInt * > a3Tmp;
1424 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1425 std::size_t sz(a3Tmp.size());
1427 for(std::size_t i=0;i<sz;i++)
1431 a3Tmp[i]->incrRef();
1433 self->unserialize(a0,a1,a2,a3,a4);
1437 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1440 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1441 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1444 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1447 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1450 self->setMeshAtLevel(meshDimRelToMax,m1);
1453 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1456 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1458 self->removeMeshAtLevel(meshDimRelToMax);
1461 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1463 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1465 DataArrayDouble *a,*a2;
1466 DataArrayDoubleTuple *aa,*aa2;
1467 std::vector<double> bb,bb2;
1469 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1470 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1471 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1475 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1477 std::vector<const MEDFileUMesh *> meshesCpp;
1478 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1479 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1483 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1485 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1486 return convertVecPairIntToPy(ret);
1489 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1491 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1492 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1493 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1496 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1498 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1499 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1500 return self->extractPart(extractDefCpp);
1503 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1505 std::vector<const MEDCouplingUMesh *> ms;
1506 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1507 self->setMeshes(ms,renum);
1510 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1512 std::vector<const MEDCouplingUMesh *> ms;
1513 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1514 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1517 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1519 std::vector<const MEDCouplingUMesh *> ms;
1520 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1521 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1524 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1526 DataArrayDouble *ret=self->getCoords();
1532 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1534 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1537 return const_cast<PartDefinition *>(ret);
1540 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1542 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1543 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1544 PyObject *ret=PyTuple_New(3);
1545 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1546 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1547 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1551 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1553 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1559 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1561 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1562 std::size_t sz(tmp.size());
1563 PyObject *ret=PyList_New(sz);
1564 for(std::size_t i=0;i<sz;i++)
1568 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1575 class MEDFileStructuredMesh : public MEDFileMesh
1580 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1582 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1590 class MEDFileCMesh : public MEDFileStructuredMesh
1593 static MEDFileCMesh *New();
1594 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1595 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1596 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1597 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1598 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1603 return MEDFileCMesh::New();
1606 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1608 return MEDFileCMesh::New(fileName,mrs);
1611 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1613 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1616 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1618 return MEDFileCMesh::New(db);
1622 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1624 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1627 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1629 const MEDCouplingCMesh *tmp=self->getMesh();
1632 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1637 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1640 static MEDFileCurveLinearMesh *New();
1641 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1642 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1643 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1644 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1647 MEDFileCurveLinearMesh()
1649 return MEDFileCurveLinearMesh::New();
1652 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1654 return MEDFileCurveLinearMesh::New(fileName,mrs);
1657 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1659 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1662 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1664 return MEDFileCurveLinearMesh::New(db);
1668 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1670 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1673 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1675 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1678 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1683 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1686 static MEDFileMeshMultiTS *New();
1687 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1688 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1689 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1690 std::string getName() const throw(INTERP_KERNEL::Exception);
1691 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1692 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1695 MEDFileMeshMultiTS()
1697 return MEDFileMeshMultiTS::New();
1700 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1702 return MEDFileMeshMultiTS::New(fileName);
1705 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1707 return MEDFileMeshMultiTS::New(fileName,mName);
1710 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1712 MEDFileMesh *ret=self->getOneTimeStep();
1720 class MEDFileMeshesIterator
1725 PyObject *next() throw(INTERP_KERNEL::Exception)
1727 MEDFileMesh *ret=self->nextt();
1731 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1735 PyErr_SetString(PyExc_StopIteration,"No more data.");
1742 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1745 static MEDFileMeshes *New();
1746 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1747 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1748 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1749 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1751 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1752 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1753 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1754 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1755 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1756 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1757 void killStructureElements() throw(INTERP_KERNEL::Exception);
1762 return MEDFileMeshes::New();
1765 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1767 return MEDFileMeshes::New(fileName);
1770 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1772 return MEDFileMeshes::New(db);
1776 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1778 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1781 std::string __str__() const throw(INTERP_KERNEL::Exception)
1783 return self->simpleRepr();
1786 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1788 if(PyInt_Check(obj))
1790 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1795 else if(PyString_Check(obj))
1797 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1803 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1806 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1808 self->setMeshAtPos(obj,mesh);
1812 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1814 return self->iterator();
1817 int __len__() const throw(INTERP_KERNEL::Exception)
1819 return self->getNumberOfMeshes();
1822 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1824 MEDFileMesh *ret=self->getMeshAtPos(i);
1829 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1831 MEDFileMesh *ret=self->getMeshWithName(mname);
1839 class MEDFileFieldLoc : public RefCountObject
1842 std::string getName() const;
1843 int getDimension() const;
1844 int getNumberOfGaussPoints() const;
1845 int getNumberOfPointsInCells() const;
1846 const std::vector<double>& getRefCoords() const;
1847 const std::vector<double>& getGaussCoords() const;
1848 const std::vector<double>& getGaussWeights() const;
1849 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1852 std::string __str__() const throw(INTERP_KERNEL::Exception)
1854 return self->repr();
1859 class MEDFileFieldGlobsReal
1862 void resetContent();
1863 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1864 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1865 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1866 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1867 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1868 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1869 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1870 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1871 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1872 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1873 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1874 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1875 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1876 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1877 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1878 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1879 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1880 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1881 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1882 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1883 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1884 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1885 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1886 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1887 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1888 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1891 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1893 const DataArrayInt *ret=self->getProfile(pflName);
1896 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1899 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1901 const DataArrayInt *ret=self->getProfileFromId(pflId);
1904 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1907 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1909 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1912 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1915 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1917 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1920 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1923 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1925 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1926 return convertVecPairVecStToPy(ret);
1929 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1931 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1932 return convertVecPairVecStToPy(ret);
1935 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1937 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1938 self->changePflsNames(v);
1941 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1943 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1944 self->changePflsRefsNamesGen(v);
1947 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1949 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1950 self->changePflsNamesInStruct(v);
1953 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1955 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1956 self->changeLocsNames(v);
1959 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1961 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1962 self->changeLocsRefsNamesGen(v);
1965 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1967 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1968 self->changeLocsNamesInStruct(v);
1971 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1973 std::ostringstream oss;
1974 self->simpleReprGlobs(oss);
1980 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1983 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1984 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1985 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1986 void loadArrays() throw(INTERP_KERNEL::Exception);
1987 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1988 void unloadArrays() throw(INTERP_KERNEL::Exception);
1989 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1990 int getDimension() const throw(INTERP_KERNEL::Exception);
1991 int getIteration() const throw(INTERP_KERNEL::Exception);
1992 int getOrder() const throw(INTERP_KERNEL::Exception);
1993 std::string getName() throw(INTERP_KERNEL::Exception);
1994 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1995 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1996 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1997 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1998 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1999 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2000 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2001 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2002 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2003 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2004 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2005 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2006 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2007 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2008 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2011 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2014 double tmp0=self->getTime(tmp1,tmp2);
2015 PyObject *res = PyList_New(3);
2016 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2017 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2018 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2022 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2024 std::pair<int,int> res=self->getDtIt();
2025 PyObject *elt=PyTuple_New(2);
2026 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2027 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2031 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2033 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2036 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2038 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2041 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2043 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2044 return self->changeMeshNames(modifTab);
2047 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2049 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2050 PyObject *ret2=PyList_New(ret.size());
2051 for(int i=0;i<(int)ret.size();i++)
2052 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2056 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2058 std::vector<int> ret1;
2059 int ret0=self->getNonEmptyLevels(mname,ret1);
2060 PyObject *elt=PyTuple_New(2);
2061 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2062 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2066 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2068 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2069 std::vector< std::vector<TypeOfField> > typesF;
2070 std::vector< std::vector<std::string> > pfls;
2071 std::vector< std::vector<std::string> > locs;
2072 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2074 PyObject *ret2=PyList_New(sz);
2075 for(int i=0;i<sz;i++)
2077 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2078 const std::vector<TypeOfField>& typesFI=typesF[i];
2079 const std::vector<std::string>& pflsI=pfls[i];
2080 const std::vector<std::string>& locsI=locs[i];
2081 PyObject *elt=PyTuple_New(2);
2082 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2083 int sz2=ret[i].size();
2084 PyObject *elt2=PyList_New(sz2);
2085 for(int j=0;j<sz2;j++)
2087 PyObject *elt3=PyTuple_New(4);
2088 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2089 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));
2090 PyTuple_SetItem(elt3,1,elt4);
2091 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2092 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2093 PyList_SetItem(elt2,j,elt3);
2095 PyTuple_SetItem(elt,1,elt2);
2096 PyList_SetItem(ret2,i,elt);
2101 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2103 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2104 std::size_t sz=ret.size();
2105 PyObject *retPy=PyList_New(sz);
2106 for(std::size_t i=0;i<sz;i++)
2107 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2111 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2113 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2114 std::size_t sz=ret.size();
2115 PyObject *retPy=PyList_New(sz);
2116 for(std::size_t i=0;i<sz;i++)
2117 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2121 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2123 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2124 std::size_t sz=ret.size();
2125 PyObject *retPy=PyList_New(sz);
2126 for(std::size_t i=0;i<sz;i++)
2127 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2131 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2133 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2134 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2135 return self->extractPart(extractDefCpp,mm);
2140 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2143 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2144 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2145 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2146 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2147 static MEDFileField1TS *New();
2148 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2149 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2150 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2151 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2152 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2153 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2154 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2156 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2157 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2158 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2159 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2162 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2164 return MEDFileField1TS::New(fileName,loadAll);
2167 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2169 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2172 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2174 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2177 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2179 return MEDFileField1TS::New(db);
2184 return MEDFileField1TS::New();
2188 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2190 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2193 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2195 const DataArrayDouble *arr=0;
2197 arr=field->getArray();
2198 self->copyTinyInfoFrom(field,arr);
2201 std::string __str__() const throw(INTERP_KERNEL::Exception)
2203 return self->simpleRepr();
2206 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2208 DataArrayInt *ret1=0;
2209 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2210 PyObject *ret=PyTuple_New(2);
2211 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2212 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2218 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2219 std::vector< std::vector<TypeOfField> > typesF;
2220 std::vector< std::vector<std::string> > pfls;
2221 std::vector< std::vector<std::string> > locs;
2222 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2224 PyObject *ret2=PyList_New(sz);
2225 for(int i=0;i<sz;i++)
2227 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2228 const std::vector<TypeOfField>& typesFI=typesF[i];
2229 const std::vector<std::string>& pflsI=pfls[i];
2230 const std::vector<std::string>& locsI=locs[i];
2231 PyObject *elt=PyTuple_New(2);
2232 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2233 int sz2=ret[i].size();
2234 PyObject *elt2=PyList_New(sz2);
2235 for(int j=0;j<sz2;j++)
2237 PyObject *elt3=PyTuple_New(4);
2238 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2239 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2241 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2242 PyList_SetItem(elt2,j,elt3);
2244 PyTuple_SetItem(elt,1,elt2);
2245 PyList_SetItem(ret2,i,elt);
2250 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2252 DataArrayDouble *ret=self->getUndergroundDataArray();
2258 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2260 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2261 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2264 PyObject *ret=PyTuple_New(2);
2265 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2266 std::size_t sz=elt1Cpp.size();
2267 PyObject *elt=PyList_New(sz);
2268 for(std::size_t i=0;i<sz;i++)
2270 PyObject *elt1=PyTuple_New(2);
2271 PyObject *elt2=PyTuple_New(2);
2272 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2273 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2274 PyObject *elt3=PyTuple_New(2);
2275 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2276 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2277 PyTuple_SetItem(elt1,0,elt2);
2278 PyTuple_SetItem(elt1,1,elt3);
2279 PyList_SetItem(elt,i,elt1);
2281 PyTuple_SetItem(ret,1,elt);
2287 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2290 static MEDFileIntField1TS *New();
2291 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2292 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2293 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2294 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2295 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2297 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2298 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2299 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2300 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2301 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2302 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2303 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2304 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2307 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2309 return MEDFileIntField1TS::New();
2312 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2314 return MEDFileIntField1TS::New(fileName,loadAll);
2317 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2319 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2322 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2324 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2327 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2329 return MEDFileIntField1TS::New(db);
2333 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2335 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2338 std::string __str__() const throw(INTERP_KERNEL::Exception)
2340 return self->simpleRepr();
2343 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2345 DataArrayInt *ret1=0;
2346 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2347 PyObject *ret=PyTuple_New(2);
2348 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2349 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2353 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2355 DataArrayInt *ret=self->getUndergroundDataArray();
2363 class MEDFileAnyTypeFieldMultiTSIterator
2368 PyObject *next() throw(INTERP_KERNEL::Exception)
2370 MEDFileAnyTypeField1TS *ret=self->nextt();
2372 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2375 PyErr_SetString(PyExc_StopIteration,"No more data.");
2382 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2385 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2386 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2387 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2388 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2389 std::string getName() const throw(INTERP_KERNEL::Exception);
2390 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2391 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2392 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2393 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2394 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2395 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2396 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2397 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2398 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2399 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2400 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2401 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2402 void loadArrays() throw(INTERP_KERNEL::Exception);
2403 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2404 void unloadArrays() throw(INTERP_KERNEL::Exception);
2405 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2407 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2408 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2409 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2410 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2411 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2412 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2415 int __len__() const throw(INTERP_KERNEL::Exception)
2417 return self->getNumberOfTS();
2420 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2422 if(elt0 && PyInt_Check(elt0))
2424 int pos=PyInt_AS_LONG(elt0);
2427 else if(elt0 && PyTuple_Check(elt0))
2429 if(PyTuple_Size(elt0)==2)
2431 PyObject *o0=PyTuple_GetItem(elt0,0);
2432 PyObject *o1=PyTuple_GetItem(elt0,1);
2433 if(PyInt_Check(o0) && PyInt_Check(o1))
2435 int iter=PyInt_AS_LONG(o0);
2436 int order=PyInt_AS_LONG(o1);
2437 return self->getPosOfTimeStep(iter,order);
2440 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 !");
2443 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 !");
2445 else if(elt0 && PyFloat_Check(elt0))
2447 double val=PyFloat_AS_DOUBLE(elt0);
2448 return self->getPosGivenTime(val);
2451 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2454 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2456 std::vector< std::pair<int,int> > res(self->getIterations());
2457 return convertVecPairIntToPy(res);
2460 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2462 std::vector<double> ret1;
2463 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2464 std::size_t sz=ret.size();
2465 PyObject *ret2=PyList_New(sz);
2466 for(std::size_t i=0;i<sz;i++)
2468 PyObject *elt=PyTuple_New(3);
2469 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2470 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2471 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2472 PyList_SetItem(ret2,i,elt);
2477 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2479 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2480 PyObject *ret2=PyList_New(ret.size());
2481 for(int i=0;i<(int)ret.size();i++)
2483 const std::vector<TypeOfField>& rett=ret[i];
2484 PyObject *ret3=PyList_New(rett.size());
2485 for(int j=0;j<(int)rett.size();j++)
2486 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2487 PyList_SetItem(ret2,i,ret3);
2492 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2494 std::vector<int> ret1;
2495 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2496 PyObject *elt=PyTuple_New(2);
2497 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2498 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2502 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2504 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2505 std::vector< std::vector<TypeOfField> > typesF;
2506 std::vector< std::vector<std::string> > pfls;
2507 std::vector< std::vector<std::string> > locs;
2508 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2510 PyObject *ret2=PyList_New(sz);
2511 for(int i=0;i<sz;i++)
2513 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2514 const std::vector<TypeOfField>& typesFI=typesF[i];
2515 const std::vector<std::string>& pflsI=pfls[i];
2516 const std::vector<std::string>& locsI=locs[i];
2517 PyObject *elt=PyTuple_New(2);
2518 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2519 int sz2=ret[i].size();
2520 PyObject *elt2=PyList_New(sz2);
2521 for(int j=0;j<sz2;j++)
2523 PyObject *elt3=PyTuple_New(4);
2524 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2525 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));
2526 PyTuple_SetItem(elt3,1,elt4);
2527 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2528 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2529 PyList_SetItem(elt2,j,elt3);
2531 PyTuple_SetItem(elt,1,elt2);
2532 PyList_SetItem(ret2,i,elt);
2537 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2539 if(PyList_Check(elts))
2541 int sz=PyList_Size(elts);
2542 std::vector<int> ret(sz);
2543 for(int i=0;i<sz;i++)
2545 PyObject *elt=PyList_GetItem(elts,i);
2546 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2552 std::vector<int> ret(1);
2553 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2558 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2560 if(PySlice_Check(elts))
2562 Py_ssize_t strt=2,stp=2,step=2;
2563 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2564 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2565 self->eraseTimeStepIds2(strt,stp,step);
2569 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2570 if(!idsToRemove.empty())
2571 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2575 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2579 std::vector<int> pos2;
2580 DataArrayInt *pos3=0;
2581 DataArrayIntTuple *pos4=0;
2582 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2587 self->eraseTimeStepIds(&pos1,&pos1+1);
2594 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2599 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2603 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2607 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2609 return self->iterator();
2612 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2614 if(elt0 && PyList_Check(elt0))
2616 int sz=PyList_Size(elt0);
2617 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2618 int *pt=da->getPointer();
2619 for(int i=0;i<sz;i++,pt++)
2621 PyObject *elt1=PyList_GetItem(elt0,i);
2622 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2624 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2626 else if(elt0 && PySlice_Check(elt0))
2628 Py_ssize_t strt=2,stp=2,step=2;
2629 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2630 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2631 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2634 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2637 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2639 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2640 return self->changeMeshNames(modifTab);
2643 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2645 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2646 std::size_t sz=ret.size();
2647 PyObject *retPy=PyList_New(sz);
2648 for(std::size_t i=0;i<sz;i++)
2649 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2653 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2655 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2656 std::size_t sz=ret.size();
2657 PyObject *retPy=PyList_New(sz);
2658 for(std::size_t i=0;i<sz;i++)
2659 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2663 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2665 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2666 std::size_t sz=ret.size();
2667 PyObject *retPy=PyList_New(sz);
2668 for(std::size_t i=0;i<sz;i++)
2669 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2673 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2676 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2677 if(SWIG_IsOK(status))
2679 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2683 std::vector<MEDFileAnyTypeField1TS *> tmp;
2684 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2685 self->pushBackTimeSteps(tmp);
2689 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2691 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2692 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2693 return self->extractPart(extractDefCpp,mm);
2696 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2698 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2699 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2700 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2701 std::size_t sz=ret.size();
2702 PyObject *retPy=PyList_New(sz);
2703 for(std::size_t i=0;i<sz;i++)
2705 std::size_t sz2=ret[i].size();
2706 PyObject *ret1Py=PyList_New(sz2);
2707 for(std::size_t j=0;j<sz2;j++)
2709 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2712 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2714 PyList_SetItem(retPy,i,ret1Py);
2719 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2721 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2722 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2723 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2724 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2725 if(ret2.size()!=ret.size())
2727 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2728 throw INTERP_KERNEL::Exception(oss.str().c_str());
2730 std::size_t sz=ret.size();
2731 PyObject *retPy=PyList_New(sz);
2732 for(std::size_t i=0;i<sz;i++)
2734 std::size_t sz2=ret[i].size();
2735 PyObject *ret0Py=PyTuple_New(2);
2736 PyObject *ret1Py=PyList_New(sz2);
2737 for(std::size_t j=0;j<sz2;j++)
2739 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2742 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2744 PyTuple_SetItem(ret0Py,0,ret1Py);
2745 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2746 PyList_SetItem(retPy,i,ret0Py);
2753 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2756 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2757 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2758 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2759 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2761 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2762 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2763 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2764 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2765 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2766 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2768 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2769 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2770 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2773 MEDFileFieldMultiTS()
2775 return MEDFileFieldMultiTS::New();
2778 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2780 return MEDFileFieldMultiTS::New(fileName,loadAll);
2783 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2785 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2788 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2790 return MEDFileFieldMultiTS::New(db);
2794 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2796 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2799 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2801 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2802 std::size_t sz(tmp.size());
2803 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2804 for(std::size_t i=0;i<sz;i++)
2806 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2807 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2809 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2812 std::string __str__() const throw(INTERP_KERNEL::Exception)
2814 return self->simpleRepr();
2817 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2819 DataArrayInt *ret1=0;
2820 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2821 PyObject *ret=PyTuple_New(2);
2822 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2823 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2827 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2829 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2830 std::vector< std::vector<TypeOfField> > typesF;
2831 std::vector< std::vector<std::string> > pfls;
2832 std::vector< std::vector<std::string> > locs;
2833 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2835 PyObject *ret2=PyList_New(sz);
2836 for(int i=0;i<sz;i++)
2838 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2839 const std::vector<TypeOfField>& typesFI=typesF[i];
2840 const std::vector<std::string>& pflsI=pfls[i];
2841 const std::vector<std::string>& locsI=locs[i];
2842 PyObject *elt=PyTuple_New(2);
2843 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2844 int sz2=ret[i].size();
2845 PyObject *elt2=PyList_New(sz2);
2846 for(int j=0;j<sz2;j++)
2848 PyObject *elt3=PyTuple_New(4);
2849 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2850 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2851 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2852 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2853 PyList_SetItem(elt2,j,elt3);
2855 PyTuple_SetItem(elt,1,elt2);
2856 PyList_SetItem(ret2,i,elt);
2860 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2862 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2868 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2870 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2871 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2874 PyObject *ret=PyTuple_New(2);
2875 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2876 std::size_t sz=elt1Cpp.size();
2877 PyObject *elt=PyList_New(sz);
2878 for(std::size_t i=0;i<sz;i++)
2880 PyObject *elt1=PyTuple_New(2);
2881 PyObject *elt2=PyTuple_New(2);
2882 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2883 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2884 PyObject *elt3=PyTuple_New(2);
2885 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2886 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2887 PyTuple_SetItem(elt1,0,elt2);
2888 PyTuple_SetItem(elt1,1,elt3);
2889 PyList_SetItem(elt,i,elt1);
2891 PyTuple_SetItem(ret,1,elt);
2897 class MEDFileFieldsIterator
2902 PyObject *next() throw(INTERP_KERNEL::Exception)
2904 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2906 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2909 PyErr_SetString(PyExc_StopIteration,"No more data.");
2916 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2919 static MEDFileIntFieldMultiTS *New();
2920 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2921 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2922 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2924 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2925 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2926 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2927 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2928 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2929 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2930 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2931 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2932 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2935 MEDFileIntFieldMultiTS()
2937 return MEDFileIntFieldMultiTS::New();
2940 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2942 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2945 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2947 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2950 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2952 return MEDFileIntFieldMultiTS::New(db);
2956 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2958 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
2961 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2963 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2964 std::size_t sz(tmp.size());
2965 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2966 for(std::size_t i=0;i<sz;i++)
2968 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2969 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2971 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2974 std::string __str__() const throw(INTERP_KERNEL::Exception)
2976 return self->simpleRepr();
2979 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2981 DataArrayInt *ret1=0;
2982 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2983 PyObject *ret=PyTuple_New(2);
2984 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2985 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2989 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2991 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2999 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3002 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3003 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3004 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3005 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3006 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3007 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3008 void loadArrays() throw(INTERP_KERNEL::Exception);
3009 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3010 void unloadArrays() throw(INTERP_KERNEL::Exception);
3011 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3012 int getNumberOfFields() const;
3013 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3014 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3016 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3017 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3018 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3019 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3020 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3021 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3022 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3023 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3024 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3029 return MEDFileFields::New();
3032 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3034 return MEDFileFields::New(fileName,loadAll);
3037 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3039 return MEDFileFields::New(db);
3043 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3045 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3048 std::string __str__() const throw(INTERP_KERNEL::Exception)
3050 return self->simpleRepr();
3053 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3055 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3056 std::size_t sz(tmp.size());
3057 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3058 for(std::size_t i=0;i<sz;i++)
3060 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3061 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3063 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3066 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3069 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3070 PyObject *ret=PyTuple_New(2);
3071 PyObject *ret_0=PyList_New(ret0.size());
3073 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3075 PyObject *elt=PyTuple_New(2);
3076 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3077 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3078 PyList_SetItem(ret_0,rk,elt);
3080 PyTuple_SetItem(ret,0,ret_0);
3081 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3082 PyTuple_SetItem(ret,1,ret_1);
3086 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3088 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3089 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3092 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3094 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3095 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3098 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3100 if(obj && PyList_Check(obj))
3102 int sz=PyList_Size(obj);
3103 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3104 int *pt=da->getPointer();
3105 for(int i=0;i<sz;i++,pt++)
3107 PyObject *elt1=PyList_GetItem(obj,i);
3108 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3110 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3113 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3116 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3118 self->setFieldAtPos(obj,field);
3122 int __len__() const throw(INTERP_KERNEL::Exception)
3124 return self->getNumberOfFields();
3127 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3129 return self->iterator();
3132 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3134 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3135 return self->changeMeshNames(modifTab);
3138 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3140 if(elt0 && PyInt_Check(elt0))
3142 return PyInt_AS_LONG(elt0);
3144 else if(elt0 && PyString_Check(elt0))
3145 return self->getPosFromFieldName(PyString_AsString(elt0));
3147 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3150 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3152 if(PyList_Check(elts))
3154 int sz=PyList_Size(elts);
3155 std::vector<int> ret(sz);
3156 for(int i=0;i<sz;i++)
3158 PyObject *elt=PyList_GetItem(elts,i);
3159 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3165 std::vector<int> ret(1);
3166 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3171 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3173 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3174 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3175 self->pushFields(tmp);
3178 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3180 if(elts && PySlice_Check(elts))
3182 Py_ssize_t strt=2,stp=2,step=2;
3183 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3184 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3185 self->destroyFieldsAtPos2(strt,stp,step);
3189 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3190 if(!idsToRemove.empty())
3191 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3195 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3197 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3198 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3199 return self->extractPart(extractDefCpp,mm);
3204 class MEDFileParameter1TS : public RefCountObject
3207 void setIteration(int it);
3208 int getIteration() const;
3209 void setOrder(int order);
3210 int getOrder() const;
3211 void setTimeValue(double time);
3212 void setTime(int dt, int it, double time);
3213 double getTime(int& dt, int& it);
3214 double getTimeValue() const;
3217 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3220 void setValue(double val) throw(INTERP_KERNEL::Exception);
3221 double getValue() const throw(INTERP_KERNEL::Exception);
3222 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3225 std::string __str__() const throw(INTERP_KERNEL::Exception)
3227 return self->simpleRepr();
3232 class MEDFileParameterTinyInfo : public MEDFileWritable
3235 void setDescription(const std::string& name);
3236 std::string getDescription() const;
3237 void setTimeUnit(const std::string& unit);
3238 std::string getTimeUnit() const;
3241 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3244 static MEDFileParameterDouble1TS *New();
3245 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3246 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3247 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3248 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3249 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3250 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3251 std::string getName() const throw(INTERP_KERNEL::Exception);
3252 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3255 MEDFileParameterDouble1TS()
3257 return MEDFileParameterDouble1TS::New();
3260 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3262 return MEDFileParameterDouble1TS::New(fileName);
3265 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3267 return MEDFileParameterDouble1TS::New(fileName,paramName);
3270 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3272 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3275 std::string __str__() const throw(INTERP_KERNEL::Exception)
3277 return self->simpleRepr();
3280 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3283 bool ret0=self->isEqual(other,eps,what);
3284 PyObject *res=PyList_New(2);
3285 PyObject *ret0Py=ret0?Py_True:Py_False;
3287 PyList_SetItem(res,0,ret0Py);
3288 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3294 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3297 static MEDFileParameterMultiTS *New();
3298 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3299 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3300 std::string getName() const;
3301 void setName(const std::string& name);
3302 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3303 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3304 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3305 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3306 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3307 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3308 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3309 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3312 MEDFileParameterMultiTS()
3314 return MEDFileParameterMultiTS::New();
3317 MEDFileParameterMultiTS(const std::string& fileName)
3319 return MEDFileParameterMultiTS::New(fileName);
3322 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3324 return MEDFileParameterMultiTS::New(fileName,paramName);
3327 std::string __str__() const throw(INTERP_KERNEL::Exception)
3329 return self->simpleRepr();
3332 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3335 bool ret0=self->isEqual(other,eps,what);
3336 PyObject *res=PyList_New(2);
3337 PyObject *ret0Py=ret0?Py_True:Py_False;
3339 PyList_SetItem(res,0,ret0Py);
3340 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3344 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3348 std::vector<int> pos2;
3349 DataArrayInt *pos3=0;
3350 DataArrayIntTuple *pos4=0;
3351 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3356 self->eraseTimeStepIds(&pos1,&pos1+1);
3363 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3368 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3372 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3376 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3378 if(elt0 && PyInt_Check(elt0))
3380 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3383 else if(elt0 && PyTuple_Check(elt0))
3385 if(PyTuple_Size(elt0)==2)
3387 PyObject *o0=PyTuple_GetItem(elt0,0);
3388 PyObject *o1=PyTuple_GetItem(elt0,1);
3389 if(PyInt_Check(o0) && PyInt_Check(o1))
3391 int iter=PyInt_AS_LONG(o0);
3392 int order=PyInt_AS_LONG(o1);
3393 return self->getPosOfTimeStep(iter,order);
3396 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 !");
3399 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 !");
3401 else if(elt0 && PyFloat_Check(elt0))
3403 double val=PyFloat_AS_DOUBLE(elt0);
3404 return self->getPosGivenTime(val);
3407 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3410 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3412 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3418 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3420 if(PyList_Check(elts))
3422 int sz=PyList_Size(elts);
3423 std::vector<int> ret(sz);
3424 for(int i=0;i<sz;i++)
3426 PyObject *elt=PyList_GetItem(elts,i);
3427 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3433 std::vector<int> ret(1);
3434 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3439 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3441 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3442 if(!idsToRemove.empty())
3443 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3446 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3448 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3454 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3456 std::vector< std::pair<int,int> > res=self->getIterations();
3457 PyObject *ret=PyList_New(res.size());
3459 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3461 PyObject *elt=PyTuple_New(2);
3462 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3463 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3464 PyList_SetItem(ret,rk,elt);
3469 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3471 std::vector<double> res2;
3472 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3473 PyObject *ret=PyList_New(res.size());
3475 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3477 PyObject *elt=PyTuple_New(3);
3478 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3479 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3480 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3481 PyList_SetItem(ret,rk,elt);
3488 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3491 static MEDFileParameters *New();
3492 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3493 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3494 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3495 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3496 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3497 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3498 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3499 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3500 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3501 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3502 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3507 return MEDFileParameters::New();
3510 MEDFileParameters(const std::string& fileName)
3512 return MEDFileParameters::New(fileName);
3515 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3517 return MEDFileParameters::New(db);
3521 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3523 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3526 std::string __str__() const throw(INTERP_KERNEL::Exception)
3528 return self->simpleRepr();
3531 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3533 if(PyInt_Check(obj))
3535 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3540 else if(PyString_Check(obj))
3542 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3548 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3551 int __len__() const throw(INTERP_KERNEL::Exception)
3553 return self->getNumberOfParams();
3556 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3558 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3564 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3566 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3572 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3575 bool ret0=self->isEqual(other,eps,what);
3576 PyObject *res=PyList_New(2);
3577 PyObject *ret0Py=ret0?Py_True:Py_False;
3579 PyList_SetItem(res,0,ret0Py);
3580 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3586 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3589 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3590 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3591 static MEDFileData *New();
3592 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3593 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3594 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3595 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3596 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3597 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3598 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3600 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3601 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3602 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3603 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3607 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3609 return MEDFileData::New(fileName);
3612 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3614 return MEDFileData::New(db);
3619 return MEDFileData::New();
3622 std::string __str__() const throw(INTERP_KERNEL::Exception)
3624 return self->simpleRepr();
3627 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3629 MEDFileMeshes *ret=self->getMeshes();
3635 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3637 MEDFileParameters *ret=self->getParams();
3643 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3645 MEDFileFields *ret=self->getFields();
3651 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3653 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3654 return self->changeMeshNames(modifTab);
3657 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3659 std::vector<const MEDFileData *> mfdsCpp;
3660 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3661 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3666 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3668 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3673 class SauvReader : public RefCountObject
3676 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3677 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3680 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3682 return SauvReader::New(fileName);
3687 class SauvWriter : public RefCountObject
3690 static SauvWriter * New();
3691 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3692 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3693 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3694 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3697 SauvWriter() throw(INTERP_KERNEL::Exception)
3699 return SauvWriter::New();
3706 class MEDFileMeshStruct;
3708 class MEDFileField1TSStructItem
3711 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3714 class MEDFileMeshStruct : public RefCountObject
3717 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3719 ~MEDFileMeshStruct();
3722 class MEDMeshMultiLev : public RefCountObject
3725 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3726 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3727 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3733 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3735 DataArrayInt *famIds(0);
3736 bool isWithoutCopy(false);
3737 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3738 PyObject *ret=PyTuple_New(2);
3739 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3741 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3742 PyTuple_SetItem(ret,1,ret1Py);
3746 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3748 DataArrayInt *numIds(0);
3749 bool isWithoutCopy(false);
3750 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3751 PyObject *ret=PyTuple_New(2);
3752 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3754 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3755 PyTuple_SetItem(ret,1,ret1Py);
3759 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3761 DataArrayInt *famIds(0);
3762 bool isWithoutCopy(false);
3763 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3764 PyObject *ret=PyTuple_New(2);
3765 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3767 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3768 PyTuple_SetItem(ret,1,ret1Py);
3772 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3774 DataArrayInt *numIds(0);
3775 bool isWithoutCopy(false);
3776 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3777 PyObject *ret=PyTuple_New(2);
3778 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3780 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3781 PyTuple_SetItem(ret,1,ret1Py);
3785 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3787 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3788 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3789 PyObject *res(PyList_New(result.size()));
3790 for(int i=0;iL!=result.end(); i++, iL++)
3791 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3797 class MEDUMeshMultiLev : public MEDMeshMultiLev
3800 ~MEDUMeshMultiLev();
3804 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3806 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3807 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3808 PyObject *ret0Py=ncc?Py_True:Py_False;
3810 PyObject *ret=PyTuple_New(7);
3811 PyTuple_SetItem(ret,0,ret0Py);
3812 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3813 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3814 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3815 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3816 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3817 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3823 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3826 ~MEDStructuredMeshMultiLev();
3829 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3832 ~MEDCMeshMultiLev();
3836 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3839 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3840 std::size_t sz(objs.size());
3841 PyObject *ret(PyTuple_New(2));
3842 PyObject *ret0=PyList_New(sz);
3843 for(std::size_t i=0;i<sz;i++)
3844 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3845 PyTuple_SetItem(ret,0,ret0);
3846 PyObject *ret1Py(isInternal?Py_True:Py_False);
3848 PyTuple_SetItem(ret,1,ret1Py);
3854 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3857 ~MEDCurveLinearMeshMultiLev();
3861 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3863 DataArrayDouble *ret0(0);
3864 std::vector<int> ret1;
3866 self->buildVTUArrays(ret0,ret1,ret2);
3867 std::size_t sz(ret1.size());
3868 PyObject *ret=PyTuple_New(3);
3869 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3870 PyObject *ret1Py=PyList_New(sz);
3871 for(std::size_t i=0;i<sz;i++)
3872 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3873 PyTuple_SetItem(ret,1,ret1Py);
3874 PyObject *ret2Py(ret2?Py_True:Py_False);
3876 PyTuple_SetItem(ret,2,ret2Py);
3882 class MEDFileFastCellSupportComparator : public RefCountObject
3885 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3886 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3887 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3888 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3890 ~MEDFileFastCellSupportComparator();
3894 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3896 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3897 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3898 PyObject *res(PyList_New(result.size()));
3899 for(int i=0;iL!=result.end(); i++, iL++)
3900 PyList_SetItem(res,i,PyInt_FromLong(*iL));