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);
1209 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1210 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1211 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1212 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1213 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1214 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1215 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1216 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1217 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1218 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1220 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1221 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1222 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1223 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1224 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1225 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1226 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1227 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1228 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1229 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1230 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1231 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1232 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1235 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1237 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1240 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1242 return MEDFileUMesh::New(fileName,mrs);
1247 return MEDFileUMesh::New();
1251 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1253 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1256 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)
1258 std::vector<int> typesCpp1;
1259 convertPyToNewIntArr3(types,typesCpp1);
1260 std::size_t sz(typesCpp1.size());
1261 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1262 for(std::size_t ii=0;ii<sz;ii++)
1263 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1264 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1267 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1268 {// put an empty dict in input to say to __new__ to call __init__...
1269 PyObject *ret(PyTuple_New(1));
1270 PyObject *ret0(PyDict_New());
1271 PyTuple_SetItem(ret,0,ret0);
1275 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1277 std::vector<double> a0;
1278 std::vector<int> a1;
1279 std::vector<std::string> a2;
1280 std::vector< MCAuto<DataArrayInt> > a3;
1281 MCAuto<DataArrayDouble> a4;
1282 self->serialize(a0,a1,a2,a3,a4);
1283 PyObject *ret(PyTuple_New(5));
1284 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1285 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1287 PyObject *ret2(PyList_New(sz));
1288 for(int i=0;i<sz;i++)
1289 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1290 PyTuple_SetItem(ret,2,ret2);
1292 PyObject *ret3(PyList_New(sz));
1293 for(int i=0;i<sz;i++)
1295 DataArrayInt *elt(a3[i]);
1298 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1300 PyTuple_SetItem(ret,3,ret3);
1301 DataArrayDouble *ret4(a4);
1304 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1308 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1310 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1311 if(!PyTuple_Check(inp))
1312 throw INTERP_KERNEL::Exception(MSG);
1313 int sz(PyTuple_Size(inp));
1315 throw INTERP_KERNEL::Exception(MSG);
1316 std::vector<double> a0;
1317 std::vector<int> a1;
1318 std::vector<std::string> a2;
1319 std::vector< MCAuto<DataArrayInt> > a3;
1320 MCAuto<DataArrayDouble> a4;
1322 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1324 fillArrayWithPyListDbl3(a0py,tmp,a0);
1325 convertPyToNewIntArr3(a1py,a1);
1326 fillStringVector(a2py,a2);
1328 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1330 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1331 if(!SWIG_IsOK(status))
1332 throw INTERP_KERNEL::Exception(MSG);
1333 a4=reinterpret_cast<DataArrayDouble *>(argp);
1334 if((DataArrayDouble *)a4)
1337 std::vector< DataArrayInt * > a3Tmp;
1338 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1339 std::size_t sz(a3Tmp.size());
1341 for(std::size_t i=0;i<sz;i++)
1345 a3Tmp[i]->incrRef();
1347 self->unserialize(a0,a1,a2,a3,a4);
1351 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1354 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1355 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1358 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1361 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1364 self->setMeshAtLevel(meshDimRelToMax,m1);
1367 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1370 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1372 self->removeMeshAtLevel(meshDimRelToMax);
1375 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1377 std::vector<const MEDCouplingUMesh *> ms;
1378 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1379 self->setMeshes(ms,renum);
1382 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1384 std::vector<const MEDCouplingUMesh *> ms;
1385 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1386 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1389 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1391 std::vector<const MEDCouplingUMesh *> ms;
1392 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1393 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1396 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1398 DataArrayDouble *ret=self->getCoords();
1404 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1406 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1409 return const_cast<PartDefinition *>(ret);
1412 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1414 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1415 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1416 PyObject *ret=PyTuple_New(3);
1417 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1418 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1419 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1423 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1425 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1431 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1433 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1434 std::size_t sz(tmp.size());
1435 PyObject *ret=PyList_New(sz);
1436 for(std::size_t i=0;i<sz;i++)
1440 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1447 class MEDFileStructuredMesh : public MEDFileMesh
1452 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1454 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1462 class MEDFileCMesh : public MEDFileStructuredMesh
1465 static MEDFileCMesh *New();
1466 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1467 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1468 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1469 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1474 return MEDFileCMesh::New();
1477 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1479 return MEDFileCMesh::New(fileName,mrs);
1482 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1484 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1487 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1489 const MEDCouplingCMesh *tmp=self->getMesh();
1492 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1497 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1500 static MEDFileCurveLinearMesh *New();
1501 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1502 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1503 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1506 MEDFileCurveLinearMesh()
1508 return MEDFileCurveLinearMesh::New();
1511 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1513 return MEDFileCurveLinearMesh::New(fileName,mrs);
1516 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1518 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1521 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1523 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1526 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1531 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1534 static MEDFileMeshMultiTS *New();
1535 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1536 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1537 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1538 std::string getName() const throw(INTERP_KERNEL::Exception);
1539 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1540 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1541 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1544 MEDFileMeshMultiTS()
1546 return MEDFileMeshMultiTS::New();
1549 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1551 return MEDFileMeshMultiTS::New(fileName);
1554 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1556 return MEDFileMeshMultiTS::New(fileName,mName);
1559 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1561 MEDFileMesh *ret=self->getOneTimeStep();
1569 class MEDFileMeshesIterator
1574 PyObject *next() throw(INTERP_KERNEL::Exception)
1576 MEDFileMesh *ret=self->nextt();
1580 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1584 PyErr_SetString(PyExc_StopIteration,"No more data.");
1591 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1594 static MEDFileMeshes *New();
1595 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1596 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1597 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1598 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1599 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1601 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1602 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1603 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1604 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1605 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1610 return MEDFileMeshes::New();
1613 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1615 return MEDFileMeshes::New(fileName);
1618 std::string __str__() const throw(INTERP_KERNEL::Exception)
1620 return self->simpleRepr();
1623 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1625 if(PyInt_Check(obj))
1627 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1632 else if(PyString_Check(obj))
1634 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1640 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1643 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1645 self->setMeshAtPos(obj,mesh);
1649 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1651 return self->iterator();
1654 int __len__() const throw(INTERP_KERNEL::Exception)
1656 return self->getNumberOfMeshes();
1659 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1661 MEDFileMesh *ret=self->getMeshAtPos(i);
1666 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1668 MEDFileMesh *ret=self->getMeshWithName(mname);
1676 class MEDFileFieldLoc : public RefCountObject
1679 std::string getName() const;
1680 int getDimension() const;
1681 int getNumberOfGaussPoints() const;
1682 int getNumberOfPointsInCells() const;
1683 const std::vector<double>& getRefCoords() const;
1684 const std::vector<double>& getGaussCoords() const;
1685 const std::vector<double>& getGaussWeights() const;
1686 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1689 std::string __str__() const throw(INTERP_KERNEL::Exception)
1691 return self->repr();
1696 class MEDFileFieldGlobsReal
1699 void resetContent();
1700 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1701 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1702 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1703 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1704 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1705 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1706 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1707 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1708 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1709 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1710 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1711 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1712 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1713 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1714 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1715 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1716 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1717 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1718 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1719 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1720 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1721 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1722 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1723 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1724 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1725 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1728 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1730 const DataArrayInt *ret=self->getProfile(pflName);
1733 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1736 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1738 const DataArrayInt *ret=self->getProfileFromId(pflId);
1741 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1744 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1746 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1749 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1752 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1754 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1757 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1760 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1762 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1763 return convertVecPairVecStToPy(ret);
1766 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1768 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1769 return convertVecPairVecStToPy(ret);
1772 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1774 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1775 self->changePflsNames(v);
1778 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1780 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1781 self->changePflsRefsNamesGen(v);
1784 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1786 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1787 self->changePflsNamesInStruct(v);
1790 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1792 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1793 self->changeLocsNames(v);
1796 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1798 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1799 self->changeLocsRefsNamesGen(v);
1802 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1804 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1805 self->changeLocsNamesInStruct(v);
1808 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1810 std::ostringstream oss;
1811 self->simpleReprGlobs(oss);
1817 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1820 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1821 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1822 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1823 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1824 void loadArrays() throw(INTERP_KERNEL::Exception);
1825 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1826 void unloadArrays() throw(INTERP_KERNEL::Exception);
1827 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1828 int getDimension() const throw(INTERP_KERNEL::Exception);
1829 int getIteration() const throw(INTERP_KERNEL::Exception);
1830 int getOrder() const throw(INTERP_KERNEL::Exception);
1831 std::string getName() throw(INTERP_KERNEL::Exception);
1832 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1833 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1834 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1835 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1836 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1837 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1838 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1839 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1840 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1841 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1842 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1843 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1844 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1845 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1846 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1849 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1852 double tmp0=self->getTime(tmp1,tmp2);
1853 PyObject *res = PyList_New(3);
1854 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1855 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1856 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1860 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1862 std::pair<int,int> res=self->getDtIt();
1863 PyObject *elt=PyTuple_New(2);
1864 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1865 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1869 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1871 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1874 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1876 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1879 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1881 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1882 return self->changeMeshNames(modifTab);
1885 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1887 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1888 PyObject *ret2=PyList_New(ret.size());
1889 for(int i=0;i<(int)ret.size();i++)
1890 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1894 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1896 std::vector<int> ret1;
1897 int ret0=self->getNonEmptyLevels(mname,ret1);
1898 PyObject *elt=PyTuple_New(2);
1899 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1900 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1904 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1906 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1907 std::vector< std::vector<TypeOfField> > typesF;
1908 std::vector< std::vector<std::string> > pfls;
1909 std::vector< std::vector<std::string> > locs;
1910 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1912 PyObject *ret2=PyList_New(sz);
1913 for(int i=0;i<sz;i++)
1915 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1916 const std::vector<TypeOfField>& typesFI=typesF[i];
1917 const std::vector<std::string>& pflsI=pfls[i];
1918 const std::vector<std::string>& locsI=locs[i];
1919 PyObject *elt=PyTuple_New(2);
1920 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1921 int sz2=ret[i].size();
1922 PyObject *elt2=PyList_New(sz2);
1923 for(int j=0;j<sz2;j++)
1925 PyObject *elt3=PyTuple_New(4);
1926 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1927 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));
1928 PyTuple_SetItem(elt3,1,elt4);
1929 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1930 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1931 PyList_SetItem(elt2,j,elt3);
1933 PyTuple_SetItem(elt,1,elt2);
1934 PyList_SetItem(ret2,i,elt);
1939 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1941 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1942 std::size_t sz=ret.size();
1943 PyObject *retPy=PyList_New(sz);
1944 for(std::size_t i=0;i<sz;i++)
1945 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1949 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1951 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1952 std::size_t sz=ret.size();
1953 PyObject *retPy=PyList_New(sz);
1954 for(std::size_t i=0;i<sz;i++)
1955 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1959 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1961 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1962 std::size_t sz=ret.size();
1963 PyObject *retPy=PyList_New(sz);
1964 for(std::size_t i=0;i<sz;i++)
1965 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1971 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1974 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1975 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1976 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1977 static MEDFileField1TS *New();
1978 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1979 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1980 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1981 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1982 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1983 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1985 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1986 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1987 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1988 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1991 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1993 return MEDFileField1TS::New(fileName,loadAll);
1996 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1998 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2001 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2003 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2008 return MEDFileField1TS::New();
2011 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2013 const DataArrayDouble *arr=0;
2015 arr=field->getArray();
2016 self->copyTinyInfoFrom(field,arr);
2019 std::string __str__() const throw(INTERP_KERNEL::Exception)
2021 return self->simpleRepr();
2024 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2026 DataArrayInt *ret1=0;
2027 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2028 PyObject *ret=PyTuple_New(2);
2029 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2030 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2034 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2036 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2037 std::vector< std::vector<TypeOfField> > typesF;
2038 std::vector< std::vector<std::string> > pfls;
2039 std::vector< std::vector<std::string> > locs;
2040 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2042 PyObject *ret2=PyList_New(sz);
2043 for(int i=0;i<sz;i++)
2045 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2046 const std::vector<TypeOfField>& typesFI=typesF[i];
2047 const std::vector<std::string>& pflsI=pfls[i];
2048 const std::vector<std::string>& locsI=locs[i];
2049 PyObject *elt=PyTuple_New(2);
2050 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2051 int sz2=ret[i].size();
2052 PyObject *elt2=PyList_New(sz2);
2053 for(int j=0;j<sz2;j++)
2055 PyObject *elt3=PyTuple_New(4);
2056 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2057 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2058 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2059 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2060 PyList_SetItem(elt2,j,elt3);
2062 PyTuple_SetItem(elt,1,elt2);
2063 PyList_SetItem(ret2,i,elt);
2068 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2070 DataArrayDouble *ret=self->getUndergroundDataArray();
2076 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2078 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2079 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2082 PyObject *ret=PyTuple_New(2);
2083 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2084 std::size_t sz=elt1Cpp.size();
2085 PyObject *elt=PyList_New(sz);
2086 for(std::size_t i=0;i<sz;i++)
2088 PyObject *elt1=PyTuple_New(2);
2089 PyObject *elt2=PyTuple_New(2);
2090 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2091 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2092 PyObject *elt3=PyTuple_New(2);
2093 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2094 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2095 PyTuple_SetItem(elt1,0,elt2);
2096 PyTuple_SetItem(elt1,1,elt3);
2097 PyList_SetItem(elt,i,elt1);
2099 PyTuple_SetItem(ret,1,elt);
2105 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2108 static MEDFileIntField1TS *New();
2109 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2110 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2111 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2112 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2114 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2115 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2118 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2120 return MEDFileIntField1TS::New();
2123 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2125 return MEDFileIntField1TS::New(fileName,loadAll);
2128 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2130 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2133 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2135 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2138 std::string __str__() const throw(INTERP_KERNEL::Exception)
2140 return self->simpleRepr();
2143 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2145 DataArrayInt *ret1=0;
2146 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2147 PyObject *ret=PyTuple_New(2);
2148 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2153 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2155 DataArrayInt *ret1=0;
2156 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2157 PyObject *ret=PyTuple_New(2);
2158 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2159 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2163 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2165 DataArrayInt *ret1=0;
2166 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2167 PyObject *ret=PyTuple_New(2);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2169 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2175 DataArrayInt *ret1=0;
2176 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2177 PyObject *ret=PyTuple_New(2);
2178 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2179 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2185 DataArrayInt *ret1=0;
2186 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2187 PyObject *ret=PyTuple_New(2);
2188 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2189 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2195 DataArrayInt *ret1=0;
2196 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2197 PyObject *ret=PyTuple_New(2);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2203 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2205 DataArrayInt *ret=self->getUndergroundDataArray();
2213 class MEDFileAnyTypeFieldMultiTSIterator
2218 PyObject *next() throw(INTERP_KERNEL::Exception)
2220 MEDFileAnyTypeField1TS *ret=self->nextt();
2222 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2225 PyErr_SetString(PyExc_StopIteration,"No more data.");
2232 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2235 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2236 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2237 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2238 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2239 std::string getName() const throw(INTERP_KERNEL::Exception);
2240 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2241 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2242 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2243 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2244 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2245 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2246 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2247 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2248 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2249 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2250 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2251 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2252 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2253 void loadArrays() throw(INTERP_KERNEL::Exception);
2254 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2255 void unloadArrays() throw(INTERP_KERNEL::Exception);
2256 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2258 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2259 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2260 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2261 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2262 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2265 int __len__() const throw(INTERP_KERNEL::Exception)
2267 return self->getNumberOfTS();
2270 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2272 if(elt0 && PyInt_Check(elt0))
2274 int pos=PyInt_AS_LONG(elt0);
2277 else if(elt0 && PyTuple_Check(elt0))
2279 if(PyTuple_Size(elt0)==2)
2281 PyObject *o0=PyTuple_GetItem(elt0,0);
2282 PyObject *o1=PyTuple_GetItem(elt0,1);
2283 if(PyInt_Check(o0) && PyInt_Check(o1))
2285 int iter=PyInt_AS_LONG(o0);
2286 int order=PyInt_AS_LONG(o1);
2287 return self->getPosOfTimeStep(iter,order);
2290 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 !");
2293 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 !");
2295 else if(elt0 && PyFloat_Check(elt0))
2297 double val=PyFloat_AS_DOUBLE(elt0);
2298 return self->getPosGivenTime(val);
2301 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2304 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2306 std::vector< std::pair<int,int> > res=self->getIterations();
2307 PyObject *ret=PyList_New(res.size());
2309 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2311 PyObject *elt=PyTuple_New(2);
2312 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2313 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2314 PyList_SetItem(ret,rk,elt);
2319 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2321 std::vector<double> ret1;
2322 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2323 std::size_t sz=ret.size();
2324 PyObject *ret2=PyList_New(sz);
2325 for(std::size_t i=0;i<sz;i++)
2327 PyObject *elt=PyTuple_New(3);
2328 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2329 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2330 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2331 PyList_SetItem(ret2,i,elt);
2336 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2338 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2339 PyObject *ret2=PyList_New(ret.size());
2340 for(int i=0;i<(int)ret.size();i++)
2342 const std::vector<TypeOfField>& rett=ret[i];
2343 PyObject *ret3=PyList_New(rett.size());
2344 for(int j=0;j<(int)rett.size();j++)
2345 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2346 PyList_SetItem(ret2,i,ret3);
2351 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2353 std::vector<int> ret1;
2354 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2355 PyObject *elt=PyTuple_New(2);
2356 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2357 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2361 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2363 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2364 std::vector< std::vector<TypeOfField> > typesF;
2365 std::vector< std::vector<std::string> > pfls;
2366 std::vector< std::vector<std::string> > locs;
2367 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2369 PyObject *ret2=PyList_New(sz);
2370 for(int i=0;i<sz;i++)
2372 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2373 const std::vector<TypeOfField>& typesFI=typesF[i];
2374 const std::vector<std::string>& pflsI=pfls[i];
2375 const std::vector<std::string>& locsI=locs[i];
2376 PyObject *elt=PyTuple_New(2);
2377 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2378 int sz2=ret[i].size();
2379 PyObject *elt2=PyList_New(sz2);
2380 for(int j=0;j<sz2;j++)
2382 PyObject *elt3=PyTuple_New(4);
2383 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2384 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));
2385 PyTuple_SetItem(elt3,1,elt4);
2386 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2387 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2388 PyList_SetItem(elt2,j,elt3);
2390 PyTuple_SetItem(elt,1,elt2);
2391 PyList_SetItem(ret2,i,elt);
2396 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2398 if(PyList_Check(elts))
2400 int sz=PyList_Size(elts);
2401 std::vector<int> ret(sz);
2402 for(int i=0;i<sz;i++)
2404 PyObject *elt=PyList_GetItem(elts,i);
2405 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2411 std::vector<int> ret(1);
2412 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2417 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2419 if(PySlice_Check(elts))
2421 Py_ssize_t strt=2,stp=2,step=2;
2422 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2423 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2424 self->eraseTimeStepIds2(strt,stp,step);
2428 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2429 if(!idsToRemove.empty())
2430 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2434 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2438 std::vector<int> pos2;
2439 DataArrayInt *pos3=0;
2440 DataArrayIntTuple *pos4=0;
2441 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2446 self->eraseTimeStepIds(&pos1,&pos1+1);
2453 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2458 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2462 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2466 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2468 return self->iterator();
2471 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2473 if(elt0 && PyList_Check(elt0))
2475 int sz=PyList_Size(elt0);
2476 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2477 int *pt=da->getPointer();
2478 for(int i=0;i<sz;i++,pt++)
2480 PyObject *elt1=PyList_GetItem(elt0,i);
2481 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2483 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2485 else if(elt0 && PySlice_Check(elt0))
2487 Py_ssize_t strt=2,stp=2,step=2;
2488 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2489 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2490 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2493 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2496 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2498 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2499 return self->changeMeshNames(modifTab);
2502 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2504 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2505 std::size_t sz=ret.size();
2506 PyObject *retPy=PyList_New(sz);
2507 for(std::size_t i=0;i<sz;i++)
2508 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2512 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2514 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2515 std::size_t sz=ret.size();
2516 PyObject *retPy=PyList_New(sz);
2517 for(std::size_t i=0;i<sz;i++)
2518 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2522 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2524 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2525 std::size_t sz=ret.size();
2526 PyObject *retPy=PyList_New(sz);
2527 for(std::size_t i=0;i<sz;i++)
2528 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2532 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2535 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2536 if(SWIG_IsOK(status))
2538 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2542 std::vector<MEDFileAnyTypeField1TS *> tmp;
2543 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2544 self->pushBackTimeSteps(tmp);
2548 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2550 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2551 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2552 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2553 std::size_t sz=ret.size();
2554 PyObject *retPy=PyList_New(sz);
2555 for(std::size_t i=0;i<sz;i++)
2557 std::size_t sz2=ret[i].size();
2558 PyObject *ret1Py=PyList_New(sz2);
2559 for(std::size_t j=0;j<sz2;j++)
2561 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2564 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2566 PyList_SetItem(retPy,i,ret1Py);
2571 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2573 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2574 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2575 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2576 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2577 if(ret2.size()!=ret.size())
2579 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2580 throw INTERP_KERNEL::Exception(oss.str().c_str());
2582 std::size_t sz=ret.size();
2583 PyObject *retPy=PyList_New(sz);
2584 for(std::size_t i=0;i<sz;i++)
2586 std::size_t sz2=ret[i].size();
2587 PyObject *ret0Py=PyTuple_New(2);
2588 PyObject *ret1Py=PyList_New(sz2);
2589 for(std::size_t j=0;j<sz2;j++)
2591 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2594 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2596 PyTuple_SetItem(ret0Py,0,ret1Py);
2597 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2598 PyList_SetItem(retPy,i,ret0Py);
2605 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2608 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2609 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2610 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2612 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2613 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2614 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2615 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2616 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2618 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2619 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2620 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2623 MEDFileFieldMultiTS()
2625 return MEDFileFieldMultiTS::New();
2628 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2630 return MEDFileFieldMultiTS::New(fileName,loadAll);
2633 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2635 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2638 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2640 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2641 std::size_t sz(tmp.size());
2642 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2643 for(std::size_t i=0;i<sz;i++)
2645 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2646 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2648 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2651 std::string __str__() const throw(INTERP_KERNEL::Exception)
2653 return self->simpleRepr();
2656 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2658 DataArrayInt *ret1=0;
2659 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2660 PyObject *ret=PyTuple_New(2);
2661 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2662 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2666 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2668 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2669 std::vector< std::vector<TypeOfField> > typesF;
2670 std::vector< std::vector<std::string> > pfls;
2671 std::vector< std::vector<std::string> > locs;
2672 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2674 PyObject *ret2=PyList_New(sz);
2675 for(int i=0;i<sz;i++)
2677 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2678 const std::vector<TypeOfField>& typesFI=typesF[i];
2679 const std::vector<std::string>& pflsI=pfls[i];
2680 const std::vector<std::string>& locsI=locs[i];
2681 PyObject *elt=PyTuple_New(2);
2682 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2683 int sz2=ret[i].size();
2684 PyObject *elt2=PyList_New(sz2);
2685 for(int j=0;j<sz2;j++)
2687 PyObject *elt3=PyTuple_New(4);
2688 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2689 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2690 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2691 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2692 PyList_SetItem(elt2,j,elt3);
2694 PyTuple_SetItem(elt,1,elt2);
2695 PyList_SetItem(ret2,i,elt);
2699 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2701 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2707 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2709 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2710 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2713 PyObject *ret=PyTuple_New(2);
2714 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2715 std::size_t sz=elt1Cpp.size();
2716 PyObject *elt=PyList_New(sz);
2717 for(std::size_t i=0;i<sz;i++)
2719 PyObject *elt1=PyTuple_New(2);
2720 PyObject *elt2=PyTuple_New(2);
2721 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2722 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2723 PyObject *elt3=PyTuple_New(2);
2724 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2725 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2726 PyTuple_SetItem(elt1,0,elt2);
2727 PyTuple_SetItem(elt1,1,elt3);
2728 PyList_SetItem(elt,i,elt1);
2730 PyTuple_SetItem(ret,1,elt);
2736 class MEDFileFieldsIterator
2741 PyObject *next() throw(INTERP_KERNEL::Exception)
2743 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2745 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2748 PyErr_SetString(PyExc_StopIteration,"No more data.");
2755 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2758 static MEDFileIntFieldMultiTS *New();
2759 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2760 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2762 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2763 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2764 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2767 MEDFileIntFieldMultiTS()
2769 return MEDFileIntFieldMultiTS::New();
2772 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2774 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2777 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2779 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2782 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2784 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2785 std::size_t sz(tmp.size());
2786 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2787 for(std::size_t i=0;i<sz;i++)
2789 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2790 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2792 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2795 std::string __str__() const throw(INTERP_KERNEL::Exception)
2797 return self->simpleRepr();
2800 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2802 DataArrayInt *ret1=0;
2803 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2804 PyObject *ret=PyTuple_New(2);
2805 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2806 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2810 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2812 DataArrayInt *ret1=0;
2813 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2814 PyObject *ret=PyTuple_New(2);
2815 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2820 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2822 DataArrayInt *ret1=0;
2823 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2824 PyObject *ret=PyTuple_New(2);
2825 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2826 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2830 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2832 DataArrayInt *ret1=0;
2833 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2834 PyObject *ret=PyTuple_New(2);
2835 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2836 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2840 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2842 DataArrayInt *ret1=0;
2843 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2844 PyObject *ret=PyTuple_New(2);
2845 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2846 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2850 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2852 DataArrayInt *ret1=0;
2853 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2854 PyObject *ret=PyTuple_New(2);
2855 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2856 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2860 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2862 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2870 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2873 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2874 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2875 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2876 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2877 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2878 void loadArrays() throw(INTERP_KERNEL::Exception);
2879 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2880 void unloadArrays() throw(INTERP_KERNEL::Exception);
2881 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2882 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2883 int getNumberOfFields() const;
2884 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2885 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2887 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2888 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2889 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2890 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2891 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2892 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2893 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2894 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2895 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2900 return MEDFileFields::New();
2903 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2905 return MEDFileFields::New(fileName,loadAll);
2908 std::string __str__() const throw(INTERP_KERNEL::Exception)
2910 return self->simpleRepr();
2913 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2915 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2916 std::size_t sz(tmp.size());
2917 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2918 for(std::size_t i=0;i<sz;i++)
2920 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2921 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2923 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2926 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2929 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2930 PyObject *ret=PyTuple_New(2);
2931 PyObject *ret_0=PyList_New(ret0.size());
2933 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2935 PyObject *elt=PyTuple_New(2);
2936 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2937 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2938 PyList_SetItem(ret_0,rk,elt);
2940 PyTuple_SetItem(ret,0,ret_0);
2941 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2942 PyTuple_SetItem(ret,1,ret_1);
2946 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2948 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2949 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2952 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2954 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2955 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2958 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2960 if(obj && PyList_Check(obj))
2962 int sz=PyList_Size(obj);
2963 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2964 int *pt=da->getPointer();
2965 for(int i=0;i<sz;i++,pt++)
2967 PyObject *elt1=PyList_GetItem(obj,i);
2968 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2970 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2973 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2976 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2978 self->setFieldAtPos(obj,field);
2982 int __len__() const throw(INTERP_KERNEL::Exception)
2984 return self->getNumberOfFields();
2987 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2989 return self->iterator();
2992 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2994 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2995 return self->changeMeshNames(modifTab);
2998 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3000 if(elt0 && PyInt_Check(elt0))
3002 return PyInt_AS_LONG(elt0);
3004 else if(elt0 && PyString_Check(elt0))
3005 return self->getPosFromFieldName(PyString_AsString(elt0));
3007 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3010 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3012 if(PyList_Check(elts))
3014 int sz=PyList_Size(elts);
3015 std::vector<int> ret(sz);
3016 for(int i=0;i<sz;i++)
3018 PyObject *elt=PyList_GetItem(elts,i);
3019 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3025 std::vector<int> ret(1);
3026 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3031 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3033 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3034 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3035 self->pushFields(tmp);
3038 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3040 if(elts && PySlice_Check(elts))
3042 Py_ssize_t strt=2,stp=2,step=2;
3043 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3044 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3045 self->destroyFieldsAtPos2(strt,stp,step);
3049 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3050 if(!idsToRemove.empty())
3051 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3057 class MEDFileParameter1TS : public RefCountObject
3060 void setIteration(int it);
3061 int getIteration() const;
3062 void setOrder(int order);
3063 int getOrder() const;
3064 void setTimeValue(double time);
3065 void setTime(int dt, int it, double time);
3066 double getTime(int& dt, int& it);
3067 double getTimeValue() const;
3070 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3073 void setValue(double val) throw(INTERP_KERNEL::Exception);
3074 double getValue() const throw(INTERP_KERNEL::Exception);
3075 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3078 std::string __str__() const throw(INTERP_KERNEL::Exception)
3080 return self->simpleRepr();
3085 class MEDFileParameterTinyInfo : public MEDFileWritable
3088 void setDescription(const std::string& name);
3089 std::string getDescription() const;
3090 void setTimeUnit(const std::string& unit);
3091 std::string getTimeUnit() const;
3094 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3097 static MEDFileParameterDouble1TS *New();
3098 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3099 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3100 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3101 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3102 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3103 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3104 std::string getName() const throw(INTERP_KERNEL::Exception);
3105 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3108 MEDFileParameterDouble1TS()
3110 return MEDFileParameterDouble1TS::New();
3113 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3115 return MEDFileParameterDouble1TS::New(fileName);
3118 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3120 return MEDFileParameterDouble1TS::New(fileName,paramName);
3123 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3125 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3128 std::string __str__() const throw(INTERP_KERNEL::Exception)
3130 return self->simpleRepr();
3133 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3136 bool ret0=self->isEqual(other,eps,what);
3137 PyObject *res=PyList_New(2);
3138 PyObject *ret0Py=ret0?Py_True:Py_False;
3140 PyList_SetItem(res,0,ret0Py);
3141 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3147 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3150 static MEDFileParameterMultiTS *New();
3151 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3152 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3153 std::string getName() const;
3154 void setName(const std::string& name);
3155 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3156 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3157 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3158 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3159 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3160 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3161 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3162 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3165 MEDFileParameterMultiTS()
3167 return MEDFileParameterMultiTS::New();
3170 MEDFileParameterMultiTS(const std::string& fileName)
3172 return MEDFileParameterMultiTS::New(fileName);
3175 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3177 return MEDFileParameterMultiTS::New(fileName,paramName);
3180 std::string __str__() const throw(INTERP_KERNEL::Exception)
3182 return self->simpleRepr();
3185 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3188 bool ret0=self->isEqual(other,eps,what);
3189 PyObject *res=PyList_New(2);
3190 PyObject *ret0Py=ret0?Py_True:Py_False;
3192 PyList_SetItem(res,0,ret0Py);
3193 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3197 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3201 std::vector<int> pos2;
3202 DataArrayInt *pos3=0;
3203 DataArrayIntTuple *pos4=0;
3204 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3209 self->eraseTimeStepIds(&pos1,&pos1+1);
3216 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3221 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3225 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3229 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3231 if(elt0 && PyInt_Check(elt0))
3233 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3236 else if(elt0 && PyTuple_Check(elt0))
3238 if(PyTuple_Size(elt0)==2)
3240 PyObject *o0=PyTuple_GetItem(elt0,0);
3241 PyObject *o1=PyTuple_GetItem(elt0,1);
3242 if(PyInt_Check(o0) && PyInt_Check(o1))
3244 int iter=PyInt_AS_LONG(o0);
3245 int order=PyInt_AS_LONG(o1);
3246 return self->getPosOfTimeStep(iter,order);
3249 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 !");
3252 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 !");
3254 else if(elt0 && PyFloat_Check(elt0))
3256 double val=PyFloat_AS_DOUBLE(elt0);
3257 return self->getPosGivenTime(val);
3260 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3263 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3265 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3271 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3273 if(PyList_Check(elts))
3275 int sz=PyList_Size(elts);
3276 std::vector<int> ret(sz);
3277 for(int i=0;i<sz;i++)
3279 PyObject *elt=PyList_GetItem(elts,i);
3280 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3286 std::vector<int> ret(1);
3287 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3292 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3294 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3295 if(!idsToRemove.empty())
3296 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3299 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3301 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3307 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3309 std::vector< std::pair<int,int> > res=self->getIterations();
3310 PyObject *ret=PyList_New(res.size());
3312 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3314 PyObject *elt=PyTuple_New(2);
3315 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3316 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3317 PyList_SetItem(ret,rk,elt);
3322 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3324 std::vector<double> res2;
3325 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3326 PyObject *ret=PyList_New(res.size());
3328 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3330 PyObject *elt=PyTuple_New(3);
3331 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3332 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3333 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3334 PyList_SetItem(ret,rk,elt);
3341 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3344 static MEDFileParameters *New();
3345 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3346 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3347 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3348 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3349 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3350 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3351 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3352 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3353 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3354 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3355 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3360 return MEDFileParameters::New();
3363 MEDFileParameters(const std::string& fileName)
3365 return MEDFileParameters::New(fileName);
3368 std::string __str__() const throw(INTERP_KERNEL::Exception)
3370 return self->simpleRepr();
3373 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3375 if(PyInt_Check(obj))
3377 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3382 else if(PyString_Check(obj))
3384 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3390 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3393 int __len__() const throw(INTERP_KERNEL::Exception)
3395 return self->getNumberOfParams();
3398 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3400 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3406 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3408 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3414 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3417 bool ret0=self->isEqual(other,eps,what);
3418 PyObject *res=PyList_New(2);
3419 PyObject *ret0Py=ret0?Py_True:Py_False;
3421 PyList_SetItem(res,0,ret0Py);
3422 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3428 class MEDFileData : public RefCountObject, public MEDFileWritable
3431 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3432 static MEDFileData *New();
3433 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3434 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3435 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3436 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3437 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3438 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3439 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3441 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3442 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3444 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3447 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3449 return MEDFileData::New(fileName);
3454 return MEDFileData::New();
3457 std::string __str__() const throw(INTERP_KERNEL::Exception)
3459 return self->simpleRepr();
3462 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3464 MEDFileMeshes *ret=self->getMeshes();
3470 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3472 MEDFileParameters *ret=self->getParams();
3478 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3480 MEDFileFields *ret=self->getFields();
3486 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3488 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3489 return self->changeMeshNames(modifTab);
3494 class SauvReader : public RefCountObject
3497 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3498 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3501 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3503 return SauvReader::New(fileName);
3508 class SauvWriter : public RefCountObject
3511 static SauvWriter * New();
3512 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3513 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3514 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3515 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3518 SauvWriter() throw(INTERP_KERNEL::Exception)
3520 return SauvWriter::New();
3527 class MEDFileMeshStruct;
3529 class MEDFileField1TSStructItem
3532 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3535 class MEDFileMeshStruct : public RefCountObject
3538 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3540 ~MEDFileMeshStruct();
3543 class MEDMeshMultiLev : public RefCountObject
3546 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3547 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3548 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3554 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3556 DataArrayInt *famIds(0);
3557 bool isWithoutCopy(false);
3558 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3559 PyObject *ret=PyTuple_New(2);
3560 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3562 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3563 PyTuple_SetItem(ret,1,ret1Py);
3567 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3569 DataArrayInt *numIds(0);
3570 bool isWithoutCopy(false);
3571 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3572 PyObject *ret=PyTuple_New(2);
3573 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3575 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3576 PyTuple_SetItem(ret,1,ret1Py);
3580 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3582 DataArrayInt *famIds(0);
3583 bool isWithoutCopy(false);
3584 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3585 PyObject *ret=PyTuple_New(2);
3586 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3588 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3589 PyTuple_SetItem(ret,1,ret1Py);
3593 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3595 DataArrayInt *numIds(0);
3596 bool isWithoutCopy(false);
3597 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3598 PyObject *ret=PyTuple_New(2);
3599 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3601 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3602 PyTuple_SetItem(ret,1,ret1Py);
3606 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3608 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3609 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3610 PyObject *res(PyList_New(result.size()));
3611 for(int i=0;iL!=result.end(); i++, iL++)
3612 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3618 class MEDUMeshMultiLev : public MEDMeshMultiLev
3621 ~MEDUMeshMultiLev();
3625 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3627 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3628 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3629 PyObject *ret0Py=ncc?Py_True:Py_False;
3631 PyObject *ret=PyTuple_New(7);
3632 PyTuple_SetItem(ret,0,ret0Py);
3633 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3634 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3635 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3636 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3637 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3638 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3644 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3647 ~MEDStructuredMeshMultiLev();
3650 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3653 ~MEDCMeshMultiLev();
3657 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3660 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3661 std::size_t sz(objs.size());
3662 PyObject *ret(PyTuple_New(2));
3663 PyObject *ret0=PyList_New(sz);
3664 for(std::size_t i=0;i<sz;i++)
3665 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3666 PyTuple_SetItem(ret,0,ret0);
3667 PyObject *ret1Py(isInternal?Py_True:Py_False);
3669 PyTuple_SetItem(ret,1,ret1Py);
3675 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3678 ~MEDCurveLinearMeshMultiLev();
3682 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3684 DataArrayDouble *ret0(0);
3685 std::vector<int> ret1;
3687 self->buildVTUArrays(ret0,ret1,ret2);
3688 std::size_t sz(ret1.size());
3689 PyObject *ret=PyTuple_New(3);
3690 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3691 PyObject *ret1Py=PyList_New(sz);
3692 for(std::size_t i=0;i<sz;i++)
3693 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3694 PyTuple_SetItem(ret,1,ret1Py);
3695 PyObject *ret2Py(ret2?Py_True:Py_False);
3697 PyTuple_SetItem(ret,2,ret2Py);
3703 class MEDFileFastCellSupportComparator : public RefCountObject
3706 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3707 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3708 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3709 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3711 ~MEDFileFastCellSupportComparator();
3715 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3717 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3718 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3719 PyObject *res(PyList_New(result.size()));
3720 for(int i=0;iL!=result.end(); i++, iL++)
3721 PyList_SetItem(res,i,PyInt_FromLong(*iL));