1 // Copyright (C) 2007-2015 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::buildExtrudedMesh;
124 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
125 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
126 %newobject MEDCoupling::MEDFileCMesh::New;
127 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
128 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
129 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
130 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
131 %newobject MEDCoupling::MEDFileMeshes::New;
132 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
133 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
134 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
135 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
136 %newobject MEDCoupling::MEDFileMeshes::__iter__;
138 %newobject MEDCoupling::MEDFileFields::New;
139 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
140 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
141 %newobject MEDCoupling::MEDFileFields::deepCopy;
142 %newobject MEDCoupling::MEDFileFields::shallowCpy;
143 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
144 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
145 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
146 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
147 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
148 %newobject MEDCoupling::MEDFileFields::__iter__;
150 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
151 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
152 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
153 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
154 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
155 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
157 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
158 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
159 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
160 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
161 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
162 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
163 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
165 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
166 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
167 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
168 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
170 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
171 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
172 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
173 %newobject MEDCoupling::MEDFileField1TS::New;
174 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
175 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
176 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
177 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
178 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
179 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
180 %newobject MEDCoupling::MEDFileIntField1TS::New;
181 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
182 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
184 %newobject MEDCoupling::MEDFileData::New;
185 %newobject MEDCoupling::MEDFileData::deepCopy;
186 %newobject MEDCoupling::MEDFileData::getMeshes;
187 %newobject MEDCoupling::MEDFileData::getFields;
188 %newobject MEDCoupling::MEDFileData::getParams;
190 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
191 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
192 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
193 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
194 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
195 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
196 %newobject MEDCoupling::MEDFileParameters::New;
197 %newobject MEDCoupling::MEDFileParameters::deepCopy;
198 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
199 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
200 %newobject MEDCoupling::MEDFileParameters::__getitem__;
202 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
203 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
204 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
205 %newobject MEDCoupling::MEDFileJointOneStep::New;
206 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
207 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
208 %newobject MEDCoupling::MEDFileJoint::New;
209 %newobject MEDCoupling::MEDFileJoint::deepCopy;
210 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
211 %newobject MEDCoupling::MEDFileJoints::New;
212 %newobject MEDCoupling::MEDFileJoints::deepCopy;
213 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
214 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
215 %newobject MEDCoupling::MEDFileJoints::__getitem__;
216 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
217 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
218 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
219 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
220 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
221 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
222 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
223 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
224 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
226 %newobject MEDCoupling::SauvWriter::New;
227 %newobject MEDCoupling::SauvReader::New;
228 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
230 %newobject MEDCoupling::MEDFileMeshStruct::New;
231 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
232 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
233 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
234 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
235 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
237 %feature("unref") MEDFileMesh "$this->decrRef();"
238 %feature("unref") MEDFileUMesh "$this->decrRef();"
239 %feature("unref") MEDFileCMesh "$this->decrRef();"
240 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
241 %feature("unref") MEDFileMeshes "$this->decrRef();"
242 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
243 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
244 %feature("unref") MEDFileField1TS "$this->decrRef();"
245 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
246 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
247 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
248 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
249 %feature("unref") MEDFileFields "$this->decrRef();"
250 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
251 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
252 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
253 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
254 %feature("unref") MEDFileParameters "$this->decrRef();"
255 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
256 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
257 %feature("unref") MEDFileJoint "$this->decrRef();"
258 %feature("unref") MEDFileJoints "$this->decrRef();"
259 %feature("unref") MEDFileEquivalences "$this->decrRef();"
260 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
261 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
262 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
263 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
264 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
265 %feature("unref") MEDFileData "$this->decrRef();"
266 %feature("unref") SauvReader "$this->decrRef();"
267 %feature("unref") SauvWriter "$this->decrRef();"
268 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
269 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
270 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
271 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
272 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
273 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
275 namespace MEDCoupling
278 std::string MEDFileVersionStr();
279 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
280 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
281 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
282 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
283 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
284 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
285 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
286 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
287 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
288 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
289 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
290 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
291 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
292 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
293 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
294 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
295 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
296 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
297 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
298 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
299 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
300 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
301 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);
302 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);
303 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);
304 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);
305 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);
306 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
307 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
308 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
309 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
310 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
311 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
314 %rename (MEDFileVersion) MEDFileVersionSwig;
315 %rename (GetFieldIterations) GetFieldIterationsSwig;
316 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
317 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
318 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
319 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
320 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
321 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
322 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
323 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
324 %rename (WriteUMeshes) WriteUMeshesSwig;
325 %rename (GetTypesOfField) GetTypesOfFieldSwig;
326 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
327 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
331 PyObject *MEDFileVersionSwig()
333 int major,minor,release;
334 MEDCoupling::MEDFileVersion(major,minor,release);
335 PyObject *ret(PyTuple_New(3));
336 PyTuple_SetItem(ret,0,SWIG_From_int(major));
337 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
338 PyTuple_SetItem(ret,2,SWIG_From_int(release));
342 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
344 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
345 PyObject *ret=PyList_New(res.size());
347 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
349 PyObject *elt=PyTuple_New(2);
350 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
351 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
352 PyList_SetItem(ret,rk,elt);
357 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
359 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
360 PyObject *ret=PyList_New(res.size());
362 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
364 PyObject *elt=PyTuple_New(3);
365 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
366 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
367 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
368 PyList_SetItem(ret,rk,elt);
373 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
375 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
376 PyObject *ret=PyList_New(res.size());
378 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
380 PyObject *elt=PyTuple_New(2);
381 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
382 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
383 PyList_SetItem(ret,rk,elt);
388 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
390 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
391 PyObject *ret=PyList_New(res.size());
393 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
395 PyObject *elt=PyTuple_New(2);
396 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
397 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
398 PyList_SetItem(ret,rk,elt);
403 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
405 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
406 PyObject *ret=PyList_New(res.size());
408 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
410 PyObject *elt=PyTuple_New(2);
411 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
412 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
413 PyList_SetItem(ret,rk,elt);
418 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
420 int meshDim,spaceDim,numberOfNodes;
421 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
422 PyObject *ret=PyTuple_New(4);
423 PyObject *elt0=PyList_New(res.size());
425 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
427 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
429 PyObject *elt1=PyList_New(obj2.size());
430 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
432 PyObject *elt2=PyTuple_New(2);
433 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
434 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
435 PyList_SetItem(elt1,j,elt2);
437 PyList_SetItem(elt0,i,elt1);
439 PyTuple_SetItem(ret,0,elt0);
440 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
441 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
442 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
446 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
447 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
449 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
450 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
451 return convertFieldDoubleVecToPy(res);
454 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
456 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
457 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
458 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
461 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
463 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
464 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
465 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
468 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
470 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
471 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
472 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
475 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
477 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
479 PyObject *ret=PyList_New(size);
480 for(int i=0;i<size;i++)
481 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
485 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
487 std::vector<std::string> grps;
488 converPyListToVecString(li,grps);
489 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
492 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
494 std::vector<std::string> fams;
495 converPyListToVecString(li,fams);
496 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
500 namespace MEDCoupling
502 class MEDFileWritable
505 void copyOptionsFrom(const MEDFileWritable& other) const;
506 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
507 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
508 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
509 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
512 class MEDFileMeshReadSelector
515 MEDFileMeshReadSelector();
516 MEDFileMeshReadSelector(unsigned int code);
517 unsigned int getCode() const;
518 void setCode(unsigned int newCode);
519 bool isCellFamilyFieldReading() const;
520 bool isNodeFamilyFieldReading() const;
521 bool isCellNameFieldReading() const;
522 bool isNodeNameFieldReading() const;
523 bool isCellNumFieldReading() const;
524 bool isNodeNumFieldReading() const;
525 void setCellFamilyFieldReading(bool b);
526 void setNodeFamilyFieldReading(bool b);
527 void setCellNameFieldReading(bool b);
528 void setNodeNameFieldReading(bool b);
529 void setCellNumFieldReading(bool b);
530 void setNodeNumFieldReading(bool b);
533 std::string __str__() const throw(INTERP_KERNEL::Exception)
535 std::ostringstream oss;
540 std::string __repr__() const throw(INTERP_KERNEL::Exception)
542 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
548 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
551 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
552 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
553 throw(INTERP_KERNEL::Exception);
554 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
555 INTERP_KERNEL::NormalizedCellType loc_geo_type,
556 INTERP_KERNEL::NormalizedCellType rem_geo_type)
557 throw(INTERP_KERNEL::Exception);
558 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
559 MEDFileJointCorrespondence *deepCopy() const;
560 MEDFileJointCorrespondence *shallowCpy() const;
561 void setIsNodal(bool isNodal);
562 bool getIsNodal() const;
563 bool isEqual(const MEDFileJointCorrespondence *other) const;
564 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
565 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
566 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
567 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
568 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
569 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
570 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);
571 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
574 MEDFileJointCorrespondence()
576 return MEDFileJointCorrespondence::New();
578 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
580 return MEDFileJointCorrespondence::New(correspondence);
582 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
583 INTERP_KERNEL::NormalizedCellType loc_geo_type,
584 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
586 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
589 std::string __str__() const throw(INTERP_KERNEL::Exception)
591 return self->simpleRepr();
596 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
599 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
600 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
601 MEDFileJointOneStep *deepCopy() const;
602 MEDFileJointOneStep *shallowCpy() const;
603 bool isEqual(const MEDFileJointOneStep *other) const;
604 void setOrder(int order);
605 int getOrder() const;
606 void setIteration(int it);
607 int getIteration() const;
608 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
609 int getNumberOfCorrespondences() const;
610 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
611 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
612 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
615 MEDFileJointOneStep()
617 return MEDFileJointOneStep::New();
620 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
622 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
625 std::string __str__() const throw(INTERP_KERNEL::Exception)
627 return self->simpleRepr();
632 class MEDFileJoint : public RefCountObject, public MEDFileWritable
635 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
636 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
637 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
638 MEDFileJoint *deepCopy() const;
639 MEDFileJoint *shallowCpy() const;
640 bool isEqual(const MEDFileJoint *other) const;
641 void setLocalMeshName(const std::string& name);
642 std::string getLocalMeshName() const;
643 void setRemoteMeshName(const std::string& name);
644 std::string getRemoteMeshName() const;
645 void setDescription(const std::string& name);
646 std::string getDescription() const;
647 void setJointName(const std::string& name);
648 std::string getJointName() const;
649 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
650 void setDomainNumber(const int& number);
651 int getDomainNumber() const;
652 void pushStep(MEDFileJointOneStep* step);
653 int getNumberOfSteps() const;
654 MEDFileJointOneStep *getStepAtPos(int i) const;
655 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
656 std::string simpleRepr() const;
661 return MEDFileJoint::New();
664 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
666 return MEDFileJoint::New(fileName,mName,num);
669 std::string __str__() const throw(INTERP_KERNEL::Exception)
671 return self->simpleRepr();
676 class MEDFileJoints : public RefCountObject, public MEDFileWritable
679 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
680 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
681 MEDFileJoints *deepCopy() const;
682 std::string simpleRepr() const;
683 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
684 std::string getMeshName() const;
685 int getNumberOfJoints() const;
686 std::vector<std::string> getJointsNames() const;
687 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
688 void resize(int newSize) throw(INTERP_KERNEL::Exception);
689 void pushJoint(MEDFileJoint *joint);
690 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
691 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
696 return MEDFileJoints::New();
699 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
701 return MEDFileJoints::New(fileName,meshName);
704 std::string __str__() const throw(INTERP_KERNEL::Exception)
706 return self->simpleRepr();
709 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
713 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
718 else if(PyString_Check(obj))
720 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
726 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
729 int __len__() const throw(INTERP_KERNEL::Exception)
731 return self->getNumberOfJoints();
734 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
736 MEDFileJoint *ret=self->getJointAtPos(i);
742 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
744 MEDFileJoint *ret=self->getJointWithName(paramName);
752 class MEDFileEquivalenceBase : public RefCountObject
755 MEDFileEquivalenceBase();
758 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
761 MEDFileEquivalenceData();
763 void setArray(DataArrayInt *data);
766 DataArrayInt *getArray()
768 DataArrayInt *ret(self->getArray());
769 if(ret) ret->incrRef();
775 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
778 MEDFileEquivalenceNode();
781 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
784 MEDFileEquivalenceCell();
787 std::size_t size() const;
788 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
789 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
792 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
794 DataArrayInt *ret(self->getArray(type));
795 if(ret) ret->incrRef();
799 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
801 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
802 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
803 PyObject *res=PyList_New(result.size());
804 for(int i=0;iL!=result.end(); i++, iL++)
805 PyList_SetItem(res,i,PyInt_FromLong(*iL));
811 class MEDFileEquivalencePair : public RefCountObject
814 MEDFileEquivalencePair();
816 std::string getName() const;
817 void setName(const std::string& name);
818 std::string getDescription() const;
819 void setDescription(const std::string& descr);
820 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
823 MEDFileEquivalenceCell *initCell()
825 MEDFileEquivalenceCell *ret(self->initCell());
826 if(ret) ret->incrRef();
830 MEDFileEquivalenceNode *initNode()
832 MEDFileEquivalenceNode *ret(self->initNode());
833 if(ret) ret->incrRef();
837 MEDFileEquivalenceCell *getCell()
839 MEDFileEquivalenceCell *ret(self->getCell());
840 if(ret) ret->incrRef();
844 MEDFileEquivalenceNode *getNode()
846 MEDFileEquivalenceNode *ret(self->getNode());
847 if(ret) ret->incrRef();
853 class MEDFileEquivalences : public RefCountObject
856 MEDFileEquivalences();
859 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
860 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
861 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
865 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
867 MEDFileEquivalencePair *ret(self->getEquivalence(i));
868 if(ret) ret->incrRef();
871 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
873 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
874 if(ret) ret->incrRef();
878 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
880 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
881 if(ret) ret->incrRef();
887 class MEDFileMesh : public RefCountObject, public MEDFileWritable
890 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
891 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
892 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
893 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
894 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
895 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
896 void setName(const std::string& name);
897 std::string getName();
898 std::string getUnivName() const;
899 bool getUnivNameWrStatus() const;
900 void setUnivNameWrStatus(bool newStatus);
901 void setDescription(const std::string& name);
902 std::string getDescription() const;
903 void setOrder(int order);
904 int getOrder() const;
905 void setIteration(int it);
907 void setTimeValue(double time);
908 void setTime(int dt, int it, double time);
909 double getTimeValue() const;
910 void setTimeUnit(const std::string& unit);
911 std::string getTimeUnit() const;
912 void setAxisType(MEDCouplingAxisType at);
913 MEDCouplingAxisType getAxisType() const;
914 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
915 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
916 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
917 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
918 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
919 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
920 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
921 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
922 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
923 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
924 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
925 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
926 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
927 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
928 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
930 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
931 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
932 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
933 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
934 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
935 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
936 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
937 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
938 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
939 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
940 void clearGrpMap() throw(INTERP_KERNEL::Exception);
941 void clearFamMap() throw(INTERP_KERNEL::Exception);
942 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
943 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
944 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
945 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
946 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
947 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
948 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
949 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
950 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
951 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
952 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
953 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
954 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
955 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
956 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
957 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
958 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
959 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
960 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
961 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
962 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
963 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
964 static std::string GetMagicFamilyStr();
965 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
966 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
967 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
968 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
969 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
970 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
971 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
972 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
973 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
974 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
975 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
976 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
977 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
978 void setFamilyInfo(const std::map<std::string,int>& info);
979 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
980 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
981 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
982 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
983 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
984 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
985 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
986 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
987 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
988 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
989 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
990 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
991 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
992 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
993 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
994 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
995 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
996 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
997 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
998 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
999 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1001 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1002 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1003 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1004 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1005 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1006 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1007 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1008 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1009 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1010 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1011 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1012 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1013 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1014 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1015 int getNumberOfJoints();
1016 MEDFileJoints *getJoints();
1017 void setJoints( MEDFileJoints* joints );
1018 void initializeEquivalences();
1019 void killEquivalences();
1022 std::string __str__() const throw(INTERP_KERNEL::Exception)
1024 return self->simpleRepr();
1027 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1029 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1032 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1035 double tmp0=self->getTime(tmp1,tmp2);
1036 PyObject *res = PyList_New(3);
1037 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1038 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1039 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1043 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1046 bool ret0=self->isEqual(other,eps,what);
1047 PyObject *res=PyList_New(2);
1048 PyObject *ret0Py=ret0?Py_True:Py_False;
1050 PyList_SetItem(res,0,ret0Py);
1051 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1055 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1057 std::vector<const DataArrayInt *> grps;
1058 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1059 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1062 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1065 bool ret0=self->areFamsEqual(other,what);
1066 PyObject *res=PyList_New(2);
1067 PyObject *ret0Py=ret0?Py_True:Py_False;
1069 PyList_SetItem(res,0,ret0Py);
1070 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1074 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1077 bool ret0=self->areGrpsEqual(other,what);
1078 PyObject *res=PyList_New(2);
1079 PyObject *ret0Py=ret0?Py_True:Py_False;
1081 PyList_SetItem(res,0,ret0Py);
1082 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1086 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1088 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1089 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1090 PyObject *res=PyList_New(result.size());
1091 for(int i=0;iL!=result.end(); i++, iL++)
1092 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1096 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1098 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1099 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1100 PyObject *res=PyList_New(result.size());
1101 for(int i=0;iL!=result.end(); i++, iL++)
1102 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1106 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1108 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1111 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1114 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1116 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1119 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1122 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1124 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1127 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1130 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1132 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1135 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1138 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1140 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1143 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1146 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1149 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1150 PyObject *ret=PyTuple_New(2);
1151 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1152 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1156 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1158 DataArrayInt *ret3=0;
1159 std::vector<int> ret1,ret2;
1160 bool ret0=self->unPolyze(ret1,ret2,ret3);
1161 PyObject *ret=PyTuple_New(4);
1162 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1164 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1165 for(int j=0;j<(int)ret1.size()/3;j++)
1167 PyObject *retLev2=PyList_New(3);
1168 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1169 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1170 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1171 PyList_SetItem(retLev1_0,j,retLev2);
1173 PyTuple_SetItem(ret,1,retLev1_0);
1175 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1176 for(int j=0;j<(int)ret2.size()/3;j++)
1178 PyObject *retLev2=PyList_New(3);
1179 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1180 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1181 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1182 PyList_SetItem(retLev1_1,j,retLev2);
1184 PyTuple_SetItem(ret,2,retLev1_1);
1186 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1190 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1192 MEDFileEquivalences *ret(self->getEquivalences());
1193 if(ret) ret->incrRef();
1199 class MEDFileUMesh : public MEDFileMesh
1202 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1203 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1204 static MEDFileUMesh *New();
1206 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1207 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1208 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1209 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1210 void clearNodeAndCellNumbers();
1212 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1213 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1214 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1215 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1216 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1217 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1218 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1219 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1220 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1221 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1223 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1224 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1225 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1226 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1227 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1228 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1229 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1230 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1231 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1232 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1233 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1234 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1235 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1238 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1240 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1243 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1245 return MEDFileUMesh::New(fileName,mrs);
1250 return MEDFileUMesh::New();
1254 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1256 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1259 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)
1261 std::vector<int> typesCpp1;
1262 convertPyToNewIntArr3(types,typesCpp1);
1263 std::size_t sz(typesCpp1.size());
1264 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1265 for(std::size_t ii=0;ii<sz;ii++)
1266 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1267 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1270 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1271 {// put an empty dict in input to say to __new__ to call __init__...
1272 PyObject *ret(PyTuple_New(1));
1273 PyObject *ret0(PyDict_New());
1274 PyTuple_SetItem(ret,0,ret0);
1278 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1280 std::vector<double> a0;
1281 std::vector<int> a1;
1282 std::vector<std::string> a2;
1283 std::vector< MCAuto<DataArrayInt> > a3;
1284 MCAuto<DataArrayDouble> a4;
1285 self->serialize(a0,a1,a2,a3,a4);
1286 PyObject *ret(PyTuple_New(5));
1287 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1288 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1290 PyObject *ret2(PyList_New(sz));
1291 for(int i=0;i<sz;i++)
1292 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1293 PyTuple_SetItem(ret,2,ret2);
1295 PyObject *ret3(PyList_New(sz));
1296 for(int i=0;i<sz;i++)
1298 DataArrayInt *elt(a3[i]);
1301 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1303 PyTuple_SetItem(ret,3,ret3);
1304 DataArrayDouble *ret4(a4);
1307 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1311 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1313 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1314 if(!PyTuple_Check(inp))
1315 throw INTERP_KERNEL::Exception(MSG);
1316 int sz(PyTuple_Size(inp));
1318 throw INTERP_KERNEL::Exception(MSG);
1319 std::vector<double> a0;
1320 std::vector<int> a1;
1321 std::vector<std::string> a2;
1322 std::vector< MCAuto<DataArrayInt> > a3;
1323 MCAuto<DataArrayDouble> a4;
1325 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1327 fillArrayWithPyListDbl3(a0py,tmp,a0);
1328 convertPyToNewIntArr3(a1py,a1);
1329 fillStringVector(a2py,a2);
1331 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1333 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1334 if(!SWIG_IsOK(status))
1335 throw INTERP_KERNEL::Exception(MSG);
1336 a4=reinterpret_cast<DataArrayDouble *>(argp);
1337 if((DataArrayDouble *)a4)
1340 std::vector< DataArrayInt * > a3Tmp;
1341 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1342 std::size_t sz(a3Tmp.size());
1344 for(std::size_t i=0;i<sz;i++)
1348 a3Tmp[i]->incrRef();
1350 self->unserialize(a0,a1,a2,a3,a4);
1354 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1357 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1358 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1361 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1364 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1367 self->setMeshAtLevel(meshDimRelToMax,m1);
1370 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1373 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1375 self->removeMeshAtLevel(meshDimRelToMax);
1378 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1380 std::vector<const MEDCouplingUMesh *> ms;
1381 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1382 self->setMeshes(ms,renum);
1385 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1387 std::vector<const MEDCouplingUMesh *> ms;
1388 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1389 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1392 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1394 std::vector<const MEDCouplingUMesh *> ms;
1395 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1396 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1399 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1401 DataArrayDouble *ret=self->getCoords();
1407 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1409 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1412 return const_cast<PartDefinition *>(ret);
1415 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1417 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1418 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1419 PyObject *ret=PyTuple_New(3);
1420 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1421 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1428 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1434 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1436 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1437 std::size_t sz(tmp.size());
1438 PyObject *ret=PyList_New(sz);
1439 for(std::size_t i=0;i<sz;i++)
1443 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1450 class MEDFileStructuredMesh : public MEDFileMesh
1455 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1457 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1465 class MEDFileCMesh : public MEDFileStructuredMesh
1468 static MEDFileCMesh *New();
1469 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1470 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1471 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1472 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1477 return MEDFileCMesh::New();
1480 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1482 return MEDFileCMesh::New(fileName,mrs);
1485 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1487 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1490 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1492 const MEDCouplingCMesh *tmp=self->getMesh();
1495 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1500 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1503 static MEDFileCurveLinearMesh *New();
1504 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1505 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1506 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1509 MEDFileCurveLinearMesh()
1511 return MEDFileCurveLinearMesh::New();
1514 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1516 return MEDFileCurveLinearMesh::New(fileName,mrs);
1519 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1521 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1524 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1526 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1529 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1534 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1537 static MEDFileMeshMultiTS *New();
1538 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1539 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1540 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1541 std::string getName() const throw(INTERP_KERNEL::Exception);
1542 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1543 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1544 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1547 MEDFileMeshMultiTS()
1549 return MEDFileMeshMultiTS::New();
1552 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1554 return MEDFileMeshMultiTS::New(fileName);
1557 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1559 return MEDFileMeshMultiTS::New(fileName,mName);
1562 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1564 MEDFileMesh *ret=self->getOneTimeStep();
1572 class MEDFileMeshesIterator
1577 PyObject *next() throw(INTERP_KERNEL::Exception)
1579 MEDFileMesh *ret=self->nextt();
1583 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1587 PyErr_SetString(PyExc_StopIteration,"No more data.");
1594 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1597 static MEDFileMeshes *New();
1598 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1599 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1600 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1601 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1602 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1604 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1605 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1606 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1607 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1608 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1613 return MEDFileMeshes::New();
1616 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1618 return MEDFileMeshes::New(fileName);
1621 std::string __str__() const throw(INTERP_KERNEL::Exception)
1623 return self->simpleRepr();
1626 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1628 if(PyInt_Check(obj))
1630 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1635 else if(PyString_Check(obj))
1637 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1643 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1646 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1648 self->setMeshAtPos(obj,mesh);
1652 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1654 return self->iterator();
1657 int __len__() const throw(INTERP_KERNEL::Exception)
1659 return self->getNumberOfMeshes();
1662 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1664 MEDFileMesh *ret=self->getMeshAtPos(i);
1669 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1671 MEDFileMesh *ret=self->getMeshWithName(mname);
1679 class MEDFileFieldLoc : public RefCountObject
1682 std::string getName() const;
1683 int getDimension() const;
1684 int getNumberOfGaussPoints() const;
1685 int getNumberOfPointsInCells() const;
1686 const std::vector<double>& getRefCoords() const;
1687 const std::vector<double>& getGaussCoords() const;
1688 const std::vector<double>& getGaussWeights() const;
1689 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1692 std::string __str__() const throw(INTERP_KERNEL::Exception)
1694 return self->repr();
1699 class MEDFileFieldGlobsReal
1702 void resetContent();
1703 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1704 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1705 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1706 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1707 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1708 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1709 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1710 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1711 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1712 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1713 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1714 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1715 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1716 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1717 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1718 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1719 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1720 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1721 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1722 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1723 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1724 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1725 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1726 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1727 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1728 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1731 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1733 const DataArrayInt *ret=self->getProfile(pflName);
1736 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1739 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1741 const DataArrayInt *ret=self->getProfileFromId(pflId);
1744 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1747 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1749 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1752 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1755 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1757 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1760 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1763 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1765 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1766 return convertVecPairVecStToPy(ret);
1769 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1771 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1772 return convertVecPairVecStToPy(ret);
1775 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1777 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1778 self->changePflsNames(v);
1781 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1783 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1784 self->changePflsRefsNamesGen(v);
1787 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1789 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1790 self->changePflsNamesInStruct(v);
1793 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1795 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1796 self->changeLocsNames(v);
1799 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1801 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1802 self->changeLocsRefsNamesGen(v);
1805 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1807 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1808 self->changeLocsNamesInStruct(v);
1811 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1813 std::ostringstream oss;
1814 self->simpleReprGlobs(oss);
1820 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1823 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1824 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1825 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1826 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1827 void loadArrays() throw(INTERP_KERNEL::Exception);
1828 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1829 void unloadArrays() throw(INTERP_KERNEL::Exception);
1830 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1831 int getDimension() const throw(INTERP_KERNEL::Exception);
1832 int getIteration() const throw(INTERP_KERNEL::Exception);
1833 int getOrder() const throw(INTERP_KERNEL::Exception);
1834 std::string getName() throw(INTERP_KERNEL::Exception);
1835 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1836 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1837 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1838 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1839 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1840 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1841 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1842 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1843 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1844 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1845 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1846 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1847 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1848 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1849 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1852 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1855 double tmp0=self->getTime(tmp1,tmp2);
1856 PyObject *res = PyList_New(3);
1857 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1858 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1859 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1863 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1865 std::pair<int,int> res=self->getDtIt();
1866 PyObject *elt=PyTuple_New(2);
1867 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1868 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1872 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1874 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1877 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1879 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1882 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1884 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1885 return self->changeMeshNames(modifTab);
1888 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1890 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1891 PyObject *ret2=PyList_New(ret.size());
1892 for(int i=0;i<(int)ret.size();i++)
1893 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1897 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1899 std::vector<int> ret1;
1900 int ret0=self->getNonEmptyLevels(mname,ret1);
1901 PyObject *elt=PyTuple_New(2);
1902 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1903 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1907 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1909 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1910 std::vector< std::vector<TypeOfField> > typesF;
1911 std::vector< std::vector<std::string> > pfls;
1912 std::vector< std::vector<std::string> > locs;
1913 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1915 PyObject *ret2=PyList_New(sz);
1916 for(int i=0;i<sz;i++)
1918 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1919 const std::vector<TypeOfField>& typesFI=typesF[i];
1920 const std::vector<std::string>& pflsI=pfls[i];
1921 const std::vector<std::string>& locsI=locs[i];
1922 PyObject *elt=PyTuple_New(2);
1923 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1924 int sz2=ret[i].size();
1925 PyObject *elt2=PyList_New(sz2);
1926 for(int j=0;j<sz2;j++)
1928 PyObject *elt3=PyTuple_New(4);
1929 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1930 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));
1931 PyTuple_SetItem(elt3,1,elt4);
1932 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1933 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1934 PyList_SetItem(elt2,j,elt3);
1936 PyTuple_SetItem(elt,1,elt2);
1937 PyList_SetItem(ret2,i,elt);
1942 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1944 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1945 std::size_t sz=ret.size();
1946 PyObject *retPy=PyList_New(sz);
1947 for(std::size_t i=0;i<sz;i++)
1948 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1952 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1954 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1955 std::size_t sz=ret.size();
1956 PyObject *retPy=PyList_New(sz);
1957 for(std::size_t i=0;i<sz;i++)
1958 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1962 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1964 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1965 std::size_t sz=ret.size();
1966 PyObject *retPy=PyList_New(sz);
1967 for(std::size_t i=0;i<sz;i++)
1968 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1974 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1977 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1978 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1979 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1980 static MEDFileField1TS *New();
1981 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1982 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1983 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1984 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1985 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1986 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1988 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1989 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1990 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1991 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1994 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1996 return MEDFileField1TS::New(fileName,loadAll);
1999 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2001 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2004 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2006 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2011 return MEDFileField1TS::New();
2014 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2016 const DataArrayDouble *arr=0;
2018 arr=field->getArray();
2019 self->copyTinyInfoFrom(field,arr);
2022 std::string __str__() const throw(INTERP_KERNEL::Exception)
2024 return self->simpleRepr();
2027 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2029 DataArrayInt *ret1=0;
2030 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2031 PyObject *ret=PyTuple_New(2);
2032 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2033 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2037 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2039 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2040 std::vector< std::vector<TypeOfField> > typesF;
2041 std::vector< std::vector<std::string> > pfls;
2042 std::vector< std::vector<std::string> > locs;
2043 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2045 PyObject *ret2=PyList_New(sz);
2046 for(int i=0;i<sz;i++)
2048 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2049 const std::vector<TypeOfField>& typesFI=typesF[i];
2050 const std::vector<std::string>& pflsI=pfls[i];
2051 const std::vector<std::string>& locsI=locs[i];
2052 PyObject *elt=PyTuple_New(2);
2053 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2054 int sz2=ret[i].size();
2055 PyObject *elt2=PyList_New(sz2);
2056 for(int j=0;j<sz2;j++)
2058 PyObject *elt3=PyTuple_New(4);
2059 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2060 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2061 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2062 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2063 PyList_SetItem(elt2,j,elt3);
2065 PyTuple_SetItem(elt,1,elt2);
2066 PyList_SetItem(ret2,i,elt);
2071 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2073 DataArrayDouble *ret=self->getUndergroundDataArray();
2079 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2081 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2082 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2085 PyObject *ret=PyTuple_New(2);
2086 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2087 std::size_t sz=elt1Cpp.size();
2088 PyObject *elt=PyList_New(sz);
2089 for(std::size_t i=0;i<sz;i++)
2091 PyObject *elt1=PyTuple_New(2);
2092 PyObject *elt2=PyTuple_New(2);
2093 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2094 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2095 PyObject *elt3=PyTuple_New(2);
2096 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2097 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2098 PyTuple_SetItem(elt1,0,elt2);
2099 PyTuple_SetItem(elt1,1,elt3);
2100 PyList_SetItem(elt,i,elt1);
2102 PyTuple_SetItem(ret,1,elt);
2108 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2111 static MEDFileIntField1TS *New();
2112 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2113 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2114 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2115 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2117 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2118 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2121 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2123 return MEDFileIntField1TS::New();
2126 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2128 return MEDFileIntField1TS::New(fileName,loadAll);
2131 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2133 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2136 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2138 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2141 std::string __str__() const throw(INTERP_KERNEL::Exception)
2143 return self->simpleRepr();
2146 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2148 DataArrayInt *ret1=0;
2149 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2150 PyObject *ret=PyTuple_New(2);
2151 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2152 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2156 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2158 DataArrayInt *ret1=0;
2159 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2160 PyObject *ret=PyTuple_New(2);
2161 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2162 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2168 DataArrayInt *ret1=0;
2169 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2170 PyObject *ret=PyTuple_New(2);
2171 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2172 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2178 DataArrayInt *ret1=0;
2179 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2180 PyObject *ret=PyTuple_New(2);
2181 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2188 DataArrayInt *ret1=0;
2189 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2190 PyObject *ret=PyTuple_New(2);
2191 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2192 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2198 DataArrayInt *ret1=0;
2199 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2200 PyObject *ret=PyTuple_New(2);
2201 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2206 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2208 DataArrayInt *ret=self->getUndergroundDataArray();
2216 class MEDFileAnyTypeFieldMultiTSIterator
2221 PyObject *next() throw(INTERP_KERNEL::Exception)
2223 MEDFileAnyTypeField1TS *ret=self->nextt();
2225 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2228 PyErr_SetString(PyExc_StopIteration,"No more data.");
2235 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2238 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2239 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2240 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2241 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2242 std::string getName() const throw(INTERP_KERNEL::Exception);
2243 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2244 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2245 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2246 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2247 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2248 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2249 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2250 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2251 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2252 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2253 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2254 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2255 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2256 void loadArrays() throw(INTERP_KERNEL::Exception);
2257 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2258 void unloadArrays() throw(INTERP_KERNEL::Exception);
2259 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2261 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2262 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2263 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2264 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2265 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2268 int __len__() const throw(INTERP_KERNEL::Exception)
2270 return self->getNumberOfTS();
2273 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2275 if(elt0 && PyInt_Check(elt0))
2277 int pos=PyInt_AS_LONG(elt0);
2280 else if(elt0 && PyTuple_Check(elt0))
2282 if(PyTuple_Size(elt0)==2)
2284 PyObject *o0=PyTuple_GetItem(elt0,0);
2285 PyObject *o1=PyTuple_GetItem(elt0,1);
2286 if(PyInt_Check(o0) && PyInt_Check(o1))
2288 int iter=PyInt_AS_LONG(o0);
2289 int order=PyInt_AS_LONG(o1);
2290 return self->getPosOfTimeStep(iter,order);
2293 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 !");
2296 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 !");
2298 else if(elt0 && PyFloat_Check(elt0))
2300 double val=PyFloat_AS_DOUBLE(elt0);
2301 return self->getPosGivenTime(val);
2304 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2307 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2309 std::vector< std::pair<int,int> > res=self->getIterations();
2310 PyObject *ret=PyList_New(res.size());
2312 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2314 PyObject *elt=PyTuple_New(2);
2315 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2316 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2317 PyList_SetItem(ret,rk,elt);
2322 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2324 std::vector<double> ret1;
2325 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2326 std::size_t sz=ret.size();
2327 PyObject *ret2=PyList_New(sz);
2328 for(std::size_t i=0;i<sz;i++)
2330 PyObject *elt=PyTuple_New(3);
2331 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2332 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2333 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2334 PyList_SetItem(ret2,i,elt);
2339 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2341 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2342 PyObject *ret2=PyList_New(ret.size());
2343 for(int i=0;i<(int)ret.size();i++)
2345 const std::vector<TypeOfField>& rett=ret[i];
2346 PyObject *ret3=PyList_New(rett.size());
2347 for(int j=0;j<(int)rett.size();j++)
2348 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2349 PyList_SetItem(ret2,i,ret3);
2354 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2356 std::vector<int> ret1;
2357 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2358 PyObject *elt=PyTuple_New(2);
2359 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2360 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2364 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2366 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2367 std::vector< std::vector<TypeOfField> > typesF;
2368 std::vector< std::vector<std::string> > pfls;
2369 std::vector< std::vector<std::string> > locs;
2370 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2372 PyObject *ret2=PyList_New(sz);
2373 for(int i=0;i<sz;i++)
2375 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2376 const std::vector<TypeOfField>& typesFI=typesF[i];
2377 const std::vector<std::string>& pflsI=pfls[i];
2378 const std::vector<std::string>& locsI=locs[i];
2379 PyObject *elt=PyTuple_New(2);
2380 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2381 int sz2=ret[i].size();
2382 PyObject *elt2=PyList_New(sz2);
2383 for(int j=0;j<sz2;j++)
2385 PyObject *elt3=PyTuple_New(4);
2386 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2387 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));
2388 PyTuple_SetItem(elt3,1,elt4);
2389 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2390 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2391 PyList_SetItem(elt2,j,elt3);
2393 PyTuple_SetItem(elt,1,elt2);
2394 PyList_SetItem(ret2,i,elt);
2399 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2401 if(PyList_Check(elts))
2403 int sz=PyList_Size(elts);
2404 std::vector<int> ret(sz);
2405 for(int i=0;i<sz;i++)
2407 PyObject *elt=PyList_GetItem(elts,i);
2408 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2414 std::vector<int> ret(1);
2415 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2420 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2422 if(PySlice_Check(elts))
2424 Py_ssize_t strt=2,stp=2,step=2;
2425 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2426 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2427 self->eraseTimeStepIds2(strt,stp,step);
2431 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2432 if(!idsToRemove.empty())
2433 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2437 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2441 std::vector<int> pos2;
2442 DataArrayInt *pos3=0;
2443 DataArrayIntTuple *pos4=0;
2444 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2449 self->eraseTimeStepIds(&pos1,&pos1+1);
2456 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2461 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2465 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2469 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2471 return self->iterator();
2474 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2476 if(elt0 && PyList_Check(elt0))
2478 int sz=PyList_Size(elt0);
2479 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2480 int *pt=da->getPointer();
2481 for(int i=0;i<sz;i++,pt++)
2483 PyObject *elt1=PyList_GetItem(elt0,i);
2484 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2486 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2488 else if(elt0 && PySlice_Check(elt0))
2490 Py_ssize_t strt=2,stp=2,step=2;
2491 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2492 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2493 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2496 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2499 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2501 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2502 return self->changeMeshNames(modifTab);
2505 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2507 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2508 std::size_t sz=ret.size();
2509 PyObject *retPy=PyList_New(sz);
2510 for(std::size_t i=0;i<sz;i++)
2511 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2515 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2517 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2518 std::size_t sz=ret.size();
2519 PyObject *retPy=PyList_New(sz);
2520 for(std::size_t i=0;i<sz;i++)
2521 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2525 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2527 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2528 std::size_t sz=ret.size();
2529 PyObject *retPy=PyList_New(sz);
2530 for(std::size_t i=0;i<sz;i++)
2531 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2535 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2538 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2539 if(SWIG_IsOK(status))
2541 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2545 std::vector<MEDFileAnyTypeField1TS *> tmp;
2546 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2547 self->pushBackTimeSteps(tmp);
2551 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2553 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2554 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2555 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2556 std::size_t sz=ret.size();
2557 PyObject *retPy=PyList_New(sz);
2558 for(std::size_t i=0;i<sz;i++)
2560 std::size_t sz2=ret[i].size();
2561 PyObject *ret1Py=PyList_New(sz2);
2562 for(std::size_t j=0;j<sz2;j++)
2564 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2567 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2569 PyList_SetItem(retPy,i,ret1Py);
2574 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2576 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2577 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2578 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2579 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2580 if(ret2.size()!=ret.size())
2582 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2583 throw INTERP_KERNEL::Exception(oss.str().c_str());
2585 std::size_t sz=ret.size();
2586 PyObject *retPy=PyList_New(sz);
2587 for(std::size_t i=0;i<sz;i++)
2589 std::size_t sz2=ret[i].size();
2590 PyObject *ret0Py=PyTuple_New(2);
2591 PyObject *ret1Py=PyList_New(sz2);
2592 for(std::size_t j=0;j<sz2;j++)
2594 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2597 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2599 PyTuple_SetItem(ret0Py,0,ret1Py);
2600 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2601 PyList_SetItem(retPy,i,ret0Py);
2608 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2611 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2612 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2613 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2615 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2616 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2617 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2618 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2619 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2621 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2622 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2623 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2626 MEDFileFieldMultiTS()
2628 return MEDFileFieldMultiTS::New();
2631 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2633 return MEDFileFieldMultiTS::New(fileName,loadAll);
2636 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2638 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2641 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2643 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2644 std::size_t sz(tmp.size());
2645 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2646 for(std::size_t i=0;i<sz;i++)
2648 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2649 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2651 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2654 std::string __str__() const throw(INTERP_KERNEL::Exception)
2656 return self->simpleRepr();
2659 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2661 DataArrayInt *ret1=0;
2662 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2663 PyObject *ret=PyTuple_New(2);
2664 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2665 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2669 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2671 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2672 std::vector< std::vector<TypeOfField> > typesF;
2673 std::vector< std::vector<std::string> > pfls;
2674 std::vector< std::vector<std::string> > locs;
2675 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2677 PyObject *ret2=PyList_New(sz);
2678 for(int i=0;i<sz;i++)
2680 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2681 const std::vector<TypeOfField>& typesFI=typesF[i];
2682 const std::vector<std::string>& pflsI=pfls[i];
2683 const std::vector<std::string>& locsI=locs[i];
2684 PyObject *elt=PyTuple_New(2);
2685 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2686 int sz2=ret[i].size();
2687 PyObject *elt2=PyList_New(sz2);
2688 for(int j=0;j<sz2;j++)
2690 PyObject *elt3=PyTuple_New(4);
2691 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2692 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2693 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2694 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2695 PyList_SetItem(elt2,j,elt3);
2697 PyTuple_SetItem(elt,1,elt2);
2698 PyList_SetItem(ret2,i,elt);
2702 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2704 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2710 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2712 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2713 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2716 PyObject *ret=PyTuple_New(2);
2717 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2718 std::size_t sz=elt1Cpp.size();
2719 PyObject *elt=PyList_New(sz);
2720 for(std::size_t i=0;i<sz;i++)
2722 PyObject *elt1=PyTuple_New(2);
2723 PyObject *elt2=PyTuple_New(2);
2724 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2725 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2726 PyObject *elt3=PyTuple_New(2);
2727 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2728 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2729 PyTuple_SetItem(elt1,0,elt2);
2730 PyTuple_SetItem(elt1,1,elt3);
2731 PyList_SetItem(elt,i,elt1);
2733 PyTuple_SetItem(ret,1,elt);
2739 class MEDFileFieldsIterator
2744 PyObject *next() throw(INTERP_KERNEL::Exception)
2746 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2748 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2751 PyErr_SetString(PyExc_StopIteration,"No more data.");
2758 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2761 static MEDFileIntFieldMultiTS *New();
2762 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2763 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2765 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2766 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2767 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2770 MEDFileIntFieldMultiTS()
2772 return MEDFileIntFieldMultiTS::New();
2775 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2777 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2780 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2782 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2785 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2787 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2788 std::size_t sz(tmp.size());
2789 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2790 for(std::size_t i=0;i<sz;i++)
2792 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2793 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2795 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2798 std::string __str__() const throw(INTERP_KERNEL::Exception)
2800 return self->simpleRepr();
2803 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2805 DataArrayInt *ret1=0;
2806 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2807 PyObject *ret=PyTuple_New(2);
2808 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2809 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2813 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2815 DataArrayInt *ret1=0;
2816 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2817 PyObject *ret=PyTuple_New(2);
2818 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2819 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2823 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2825 DataArrayInt *ret1=0;
2826 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2827 PyObject *ret=PyTuple_New(2);
2828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2833 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2835 DataArrayInt *ret1=0;
2836 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2837 PyObject *ret=PyTuple_New(2);
2838 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2843 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2845 DataArrayInt *ret1=0;
2846 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2847 PyObject *ret=PyTuple_New(2);
2848 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2849 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2855 DataArrayInt *ret1=0;
2856 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2857 PyObject *ret=PyTuple_New(2);
2858 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2859 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2865 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2873 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2876 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2877 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2878 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2879 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2880 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2881 void loadArrays() throw(INTERP_KERNEL::Exception);
2882 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2883 void unloadArrays() throw(INTERP_KERNEL::Exception);
2884 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2885 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2886 int getNumberOfFields() const;
2887 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2888 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2890 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2891 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2892 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2893 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2894 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2895 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2896 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2897 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2898 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2903 return MEDFileFields::New();
2906 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2908 return MEDFileFields::New(fileName,loadAll);
2911 std::string __str__() const throw(INTERP_KERNEL::Exception)
2913 return self->simpleRepr();
2916 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2918 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2919 std::size_t sz(tmp.size());
2920 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2921 for(std::size_t i=0;i<sz;i++)
2923 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2924 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2926 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2929 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2932 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2933 PyObject *ret=PyTuple_New(2);
2934 PyObject *ret_0=PyList_New(ret0.size());
2936 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2938 PyObject *elt=PyTuple_New(2);
2939 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2940 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2941 PyList_SetItem(ret_0,rk,elt);
2943 PyTuple_SetItem(ret,0,ret_0);
2944 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2945 PyTuple_SetItem(ret,1,ret_1);
2949 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2951 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2952 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2955 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2957 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2958 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2961 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2963 if(obj && PyList_Check(obj))
2965 int sz=PyList_Size(obj);
2966 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2967 int *pt=da->getPointer();
2968 for(int i=0;i<sz;i++,pt++)
2970 PyObject *elt1=PyList_GetItem(obj,i);
2971 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2973 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2976 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2979 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2981 self->setFieldAtPos(obj,field);
2985 int __len__() const throw(INTERP_KERNEL::Exception)
2987 return self->getNumberOfFields();
2990 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2992 return self->iterator();
2995 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2997 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2998 return self->changeMeshNames(modifTab);
3001 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3003 if(elt0 && PyInt_Check(elt0))
3005 return PyInt_AS_LONG(elt0);
3007 else if(elt0 && PyString_Check(elt0))
3008 return self->getPosFromFieldName(PyString_AsString(elt0));
3010 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3013 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3015 if(PyList_Check(elts))
3017 int sz=PyList_Size(elts);
3018 std::vector<int> ret(sz);
3019 for(int i=0;i<sz;i++)
3021 PyObject *elt=PyList_GetItem(elts,i);
3022 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3028 std::vector<int> ret(1);
3029 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3034 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3036 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3037 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3038 self->pushFields(tmp);
3041 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3043 if(elts && PySlice_Check(elts))
3045 Py_ssize_t strt=2,stp=2,step=2;
3046 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3047 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3048 self->destroyFieldsAtPos2(strt,stp,step);
3052 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3053 if(!idsToRemove.empty())
3054 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3060 class MEDFileParameter1TS : public RefCountObject
3063 void setIteration(int it);
3064 int getIteration() const;
3065 void setOrder(int order);
3066 int getOrder() const;
3067 void setTimeValue(double time);
3068 void setTime(int dt, int it, double time);
3069 double getTime(int& dt, int& it);
3070 double getTimeValue() const;
3073 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3076 void setValue(double val) throw(INTERP_KERNEL::Exception);
3077 double getValue() const throw(INTERP_KERNEL::Exception);
3078 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3081 std::string __str__() const throw(INTERP_KERNEL::Exception)
3083 return self->simpleRepr();
3088 class MEDFileParameterTinyInfo : public MEDFileWritable
3091 void setDescription(const std::string& name);
3092 std::string getDescription() const;
3093 void setTimeUnit(const std::string& unit);
3094 std::string getTimeUnit() const;
3097 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3100 static MEDFileParameterDouble1TS *New();
3101 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3102 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3103 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3104 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3105 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3106 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3107 std::string getName() const throw(INTERP_KERNEL::Exception);
3108 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3111 MEDFileParameterDouble1TS()
3113 return MEDFileParameterDouble1TS::New();
3116 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3118 return MEDFileParameterDouble1TS::New(fileName);
3121 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3123 return MEDFileParameterDouble1TS::New(fileName,paramName);
3126 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3128 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3131 std::string __str__() const throw(INTERP_KERNEL::Exception)
3133 return self->simpleRepr();
3136 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3139 bool ret0=self->isEqual(other,eps,what);
3140 PyObject *res=PyList_New(2);
3141 PyObject *ret0Py=ret0?Py_True:Py_False;
3143 PyList_SetItem(res,0,ret0Py);
3144 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3150 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3153 static MEDFileParameterMultiTS *New();
3154 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3155 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3156 std::string getName() const;
3157 void setName(const std::string& name);
3158 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3159 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3160 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3161 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3162 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3163 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3164 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3165 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3168 MEDFileParameterMultiTS()
3170 return MEDFileParameterMultiTS::New();
3173 MEDFileParameterMultiTS(const std::string& fileName)
3175 return MEDFileParameterMultiTS::New(fileName);
3178 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3180 return MEDFileParameterMultiTS::New(fileName,paramName);
3183 std::string __str__() const throw(INTERP_KERNEL::Exception)
3185 return self->simpleRepr();
3188 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3191 bool ret0=self->isEqual(other,eps,what);
3192 PyObject *res=PyList_New(2);
3193 PyObject *ret0Py=ret0?Py_True:Py_False;
3195 PyList_SetItem(res,0,ret0Py);
3196 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3200 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3204 std::vector<int> pos2;
3205 DataArrayInt *pos3=0;
3206 DataArrayIntTuple *pos4=0;
3207 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3212 self->eraseTimeStepIds(&pos1,&pos1+1);
3219 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3224 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3228 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3232 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3234 if(elt0 && PyInt_Check(elt0))
3236 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3239 else if(elt0 && PyTuple_Check(elt0))
3241 if(PyTuple_Size(elt0)==2)
3243 PyObject *o0=PyTuple_GetItem(elt0,0);
3244 PyObject *o1=PyTuple_GetItem(elt0,1);
3245 if(PyInt_Check(o0) && PyInt_Check(o1))
3247 int iter=PyInt_AS_LONG(o0);
3248 int order=PyInt_AS_LONG(o1);
3249 return self->getPosOfTimeStep(iter,order);
3252 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 !");
3255 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 !");
3257 else if(elt0 && PyFloat_Check(elt0))
3259 double val=PyFloat_AS_DOUBLE(elt0);
3260 return self->getPosGivenTime(val);
3263 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3266 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3268 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3274 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3276 if(PyList_Check(elts))
3278 int sz=PyList_Size(elts);
3279 std::vector<int> ret(sz);
3280 for(int i=0;i<sz;i++)
3282 PyObject *elt=PyList_GetItem(elts,i);
3283 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3289 std::vector<int> ret(1);
3290 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3295 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3297 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3298 if(!idsToRemove.empty())
3299 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3302 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3304 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3310 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3312 std::vector< std::pair<int,int> > res=self->getIterations();
3313 PyObject *ret=PyList_New(res.size());
3315 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3317 PyObject *elt=PyTuple_New(2);
3318 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3319 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3320 PyList_SetItem(ret,rk,elt);
3325 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3327 std::vector<double> res2;
3328 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3329 PyObject *ret=PyList_New(res.size());
3331 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3333 PyObject *elt=PyTuple_New(3);
3334 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3335 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3336 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3337 PyList_SetItem(ret,rk,elt);
3344 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3347 static MEDFileParameters *New();
3348 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3349 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3350 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3351 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3352 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3353 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3354 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3355 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3356 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3357 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3358 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3363 return MEDFileParameters::New();
3366 MEDFileParameters(const std::string& fileName)
3368 return MEDFileParameters::New(fileName);
3371 std::string __str__() const throw(INTERP_KERNEL::Exception)
3373 return self->simpleRepr();
3376 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3378 if(PyInt_Check(obj))
3380 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3385 else if(PyString_Check(obj))
3387 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3393 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3396 int __len__() const throw(INTERP_KERNEL::Exception)
3398 return self->getNumberOfParams();
3401 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3403 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3409 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3411 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3417 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3420 bool ret0=self->isEqual(other,eps,what);
3421 PyObject *res=PyList_New(2);
3422 PyObject *ret0Py=ret0?Py_True:Py_False;
3424 PyList_SetItem(res,0,ret0Py);
3425 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3431 class MEDFileData : public RefCountObject, public MEDFileWritable
3434 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3435 static MEDFileData *New();
3436 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3437 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3438 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3439 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3440 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3441 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3442 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3444 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3445 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3447 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3450 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3452 return MEDFileData::New(fileName);
3457 return MEDFileData::New();
3460 std::string __str__() const throw(INTERP_KERNEL::Exception)
3462 return self->simpleRepr();
3465 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3467 MEDFileMeshes *ret=self->getMeshes();
3473 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3475 MEDFileParameters *ret=self->getParams();
3481 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3483 MEDFileFields *ret=self->getFields();
3489 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3491 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3492 return self->changeMeshNames(modifTab);
3497 class SauvReader : public RefCountObject
3500 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3501 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3504 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3506 return SauvReader::New(fileName);
3511 class SauvWriter : public RefCountObject
3514 static SauvWriter * New();
3515 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3516 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3517 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3518 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3521 SauvWriter() throw(INTERP_KERNEL::Exception)
3523 return SauvWriter::New();
3530 class MEDFileMeshStruct;
3532 class MEDFileField1TSStructItem
3535 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3538 class MEDFileMeshStruct : public RefCountObject
3541 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3543 ~MEDFileMeshStruct();
3546 class MEDMeshMultiLev : public RefCountObject
3549 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3550 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3551 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3557 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3559 DataArrayInt *famIds(0);
3560 bool isWithoutCopy(false);
3561 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3562 PyObject *ret=PyTuple_New(2);
3563 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3565 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3566 PyTuple_SetItem(ret,1,ret1Py);
3570 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3572 DataArrayInt *numIds(0);
3573 bool isWithoutCopy(false);
3574 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3575 PyObject *ret=PyTuple_New(2);
3576 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3578 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3579 PyTuple_SetItem(ret,1,ret1Py);
3583 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3585 DataArrayInt *famIds(0);
3586 bool isWithoutCopy(false);
3587 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3588 PyObject *ret=PyTuple_New(2);
3589 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3592 PyTuple_SetItem(ret,1,ret1Py);
3596 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3598 DataArrayInt *numIds(0);
3599 bool isWithoutCopy(false);
3600 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3601 PyObject *ret=PyTuple_New(2);
3602 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3604 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3605 PyTuple_SetItem(ret,1,ret1Py);
3609 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3611 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3612 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3613 PyObject *res(PyList_New(result.size()));
3614 for(int i=0;iL!=result.end(); i++, iL++)
3615 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3621 class MEDUMeshMultiLev : public MEDMeshMultiLev
3624 ~MEDUMeshMultiLev();
3628 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3630 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3631 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3632 PyObject *ret0Py=ncc?Py_True:Py_False;
3634 PyObject *ret=PyTuple_New(7);
3635 PyTuple_SetItem(ret,0,ret0Py);
3636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3637 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3638 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3639 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3640 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3641 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3647 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3650 ~MEDStructuredMeshMultiLev();
3653 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3656 ~MEDCMeshMultiLev();
3660 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3663 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3664 std::size_t sz(objs.size());
3665 PyObject *ret(PyTuple_New(2));
3666 PyObject *ret0=PyList_New(sz);
3667 for(std::size_t i=0;i<sz;i++)
3668 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3669 PyTuple_SetItem(ret,0,ret0);
3670 PyObject *ret1Py(isInternal?Py_True:Py_False);
3672 PyTuple_SetItem(ret,1,ret1Py);
3678 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3681 ~MEDCurveLinearMeshMultiLev();
3685 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3687 DataArrayDouble *ret0(0);
3688 std::vector<int> ret1;
3690 self->buildVTUArrays(ret0,ret1,ret2);
3691 std::size_t sz(ret1.size());
3692 PyObject *ret=PyTuple_New(3);
3693 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3694 PyObject *ret1Py=PyList_New(sz);
3695 for(std::size_t i=0;i<sz;i++)
3696 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3697 PyTuple_SetItem(ret,1,ret1Py);
3698 PyObject *ret2Py(ret2?Py_True:Py_False);
3700 PyTuple_SetItem(ret,2,ret2Py);
3706 class MEDFileFastCellSupportComparator : public RefCountObject
3709 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3710 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3711 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3712 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3714 ~MEDFileFastCellSupportComparator();
3718 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3720 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3721 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3722 PyObject *res(PyList_New(result.size()));
3723 for(int i=0;iL!=result.end(); i++, iL++)
3724 PyList_SetItem(res,i,PyInt_FromLong(*iL));