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 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
101 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
102 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
103 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
104 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
105 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
111 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
112 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
113 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
114 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
115 %newobject ParaMEDMEM::MEDFileUMesh::__getitem__;
116 %newobject ParaMEDMEM::MEDFileCMesh::New;
117 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
118 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
119 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
120 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
121 %newobject ParaMEDMEM::MEDFileMeshes::New;
122 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
123 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
124 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
125 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
126 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
128 %newobject ParaMEDMEM::MEDFileFields::New;
129 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
130 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
131 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
132 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
133 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
134 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
135 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
136 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
137 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
138 %newobject ParaMEDMEM::MEDFileFields::__iter__;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
143 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
144 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
145 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
146 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
152 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
153 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
154 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
155 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
156 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
158 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
159 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
160 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
161 %newobject ParaMEDMEM::MEDFileField1TS::New;
162 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
163 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
164 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
165 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
166 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
167 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
168 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
169 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
170 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
172 %newobject ParaMEDMEM::MEDFileData::New;
173 %newobject ParaMEDMEM::MEDFileData::deepCpy;
174 %newobject ParaMEDMEM::MEDFileData::getMeshes;
175 %newobject ParaMEDMEM::MEDFileData::getFields;
176 %newobject ParaMEDMEM::MEDFileData::getParams;
178 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
179 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
180 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
181 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
182 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
183 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
184 %newobject ParaMEDMEM::MEDFileParameters::New;
185 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
186 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
187 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
188 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
190 %newobject ParaMEDMEM::SauvWriter::New;
191 %newobject ParaMEDMEM::SauvReader::New;
192 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
194 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
195 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
196 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
197 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
198 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
200 %feature("unref") MEDFileMesh "$this->decrRef();"
201 %feature("unref") MEDFileUMesh "$this->decrRef();"
202 %feature("unref") MEDFileCMesh "$this->decrRef();"
203 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
204 %feature("unref") MEDFileMeshes "$this->decrRef();"
205 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
206 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
207 %feature("unref") MEDFileField1TS "$this->decrRef();"
208 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
209 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
210 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
211 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
212 %feature("unref") MEDFileFields "$this->decrRef();"
213 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
214 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
215 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
216 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
217 %feature("unref") MEDFileParameters "$this->decrRef();"
218 %feature("unref") MEDFileData "$this->decrRef();"
219 %feature("unref") SauvReader "$this->decrRef();"
220 %feature("unref") SauvWriter "$this->decrRef();"
221 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
222 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
223 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
224 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
225 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
226 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
231 static bool HasXDR();
232 static std::string MEDFileVersionStr();
233 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
234 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
235 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
236 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
245 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
246 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
247 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
248 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
249 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
252 static PyObject *MEDFileVersion()
254 int major,minor,release;
255 MEDLoader::MEDFileVersion(major,minor,release);
256 PyObject *ret(PyTuple_New(3));
257 PyTuple_SetItem(ret,0,SWIG_From_int(major));
258 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
259 PyTuple_SetItem(ret,2,SWIG_From_int(release));
263 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
265 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
266 PyObject *ret=PyList_New(res.size());
268 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
270 PyObject *elt=PyTuple_New(2);
271 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
272 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
273 PyList_SetItem(ret,rk,elt);
278 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
280 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
281 PyObject *ret=PyList_New(res.size());
283 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
285 PyObject *elt=PyTuple_New(3);
286 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
287 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
288 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
289 PyList_SetItem(ret,rk,elt);
294 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
296 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
297 PyObject *ret=PyList_New(res.size());
299 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
301 PyObject *elt=PyTuple_New(2);
302 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
303 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
304 PyList_SetItem(ret,rk,elt);
308 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
310 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
311 PyObject *ret=PyList_New(res.size());
313 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
315 PyObject *elt=PyTuple_New(2);
316 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
317 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
318 PyList_SetItem(ret,rk,elt);
322 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
324 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
325 PyObject *ret=PyList_New(res.size());
327 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
329 PyObject *elt=PyTuple_New(2);
330 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
331 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
332 PyList_SetItem(ret,rk,elt);
336 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
338 int meshDim,spaceDim,numberOfNodes;
339 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
340 PyObject *ret=PyTuple_New(4);
341 PyObject *elt0=PyList_New(res.size());
343 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
345 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
347 PyObject *elt1=PyList_New(obj2.size());
348 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
350 PyObject *elt2=PyTuple_New(2);
351 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
352 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
353 PyList_SetItem(elt1,j,elt2);
355 PyList_SetItem(elt0,i,elt1);
357 PyTuple_SetItem(ret,0,elt0);
358 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
359 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
360 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
363 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
364 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
366 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
367 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
368 return convertFieldDoubleVecToPy(res);
370 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
372 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
373 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
374 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
376 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
378 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
379 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
380 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
382 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
384 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
385 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
386 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
388 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
390 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
392 PyObject *ret=PyList_New(size);
393 for(int i=0;i<size;i++)
394 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
397 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
399 std::vector<std::string> grps;
400 converPyListToVecString(li,grps);
401 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
403 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
405 std::vector<std::string> fams;
406 converPyListToVecString(li,fams);
407 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
410 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
411 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
412 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
413 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
414 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
415 static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
416 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
417 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
418 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
419 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
420 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
421 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
422 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
423 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
424 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
425 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
430 class MEDFileWritable
433 void copyOptionsFrom(const MEDFileWritable& other) const;
434 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
435 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
436 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
437 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
440 class MEDFileMeshReadSelector
443 MEDFileMeshReadSelector();
444 MEDFileMeshReadSelector(unsigned int code);
445 unsigned int getCode() const;
446 void setCode(unsigned int newCode);
447 bool isCellFamilyFieldReading() const;
448 bool isNodeFamilyFieldReading() const;
449 bool isCellNameFieldReading() const;
450 bool isNodeNameFieldReading() const;
451 bool isCellNumFieldReading() const;
452 bool isNodeNumFieldReading() const;
453 void setCellFamilyFieldReading(bool b);
454 void setNodeFamilyFieldReading(bool b);
455 void setCellNameFieldReading(bool b);
456 void setNodeNameFieldReading(bool b);
457 void setCellNumFieldReading(bool b);
458 void setNodeNumFieldReading(bool b);
461 std::string __str__() const throw(INTERP_KERNEL::Exception)
463 std::ostringstream oss;
468 std::string __repr__() const throw(INTERP_KERNEL::Exception)
470 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
476 class MEDFileMesh : public RefCountObject, public MEDFileWritable
479 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
480 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
481 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
482 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
483 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
484 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
485 void setName(const std::string& name);
486 std::string getName();
487 std::string getUnivName() const;
488 bool getUnivNameWrStatus() const;
489 void setUnivNameWrStatus(bool newStatus);
490 void setDescription(const std::string& name);
491 std::string getDescription() const;
492 void setOrder(int order);
493 int getOrder() const;
494 void setIteration(int it);
496 void setTimeValue(double time);
497 void setTime(int dt, int it, double time);
498 double getTimeValue() const;
499 void setTimeUnit(const std::string& unit);
500 std::string getTimeUnit() const;
501 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
502 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
503 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
504 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
505 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
506 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
507 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
508 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
509 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
510 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
511 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
512 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
514 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
515 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
516 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
517 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
518 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
519 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
520 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
521 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
522 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
523 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
524 void clearGrpMap() throw(INTERP_KERNEL::Exception);
525 void clearFamMap() throw(INTERP_KERNEL::Exception);
526 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
527 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
528 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
529 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
530 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
531 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
532 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
533 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
534 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
535 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
536 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
537 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
538 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
539 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
540 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
541 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
542 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
543 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
544 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
545 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
546 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
547 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
548 void setFamilyInfo(const std::map<std::string,int>& info);
549 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
550 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
551 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
552 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
553 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
554 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
555 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
556 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
557 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
558 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
559 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
560 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
561 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
562 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
563 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
564 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
565 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
566 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
567 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
568 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
569 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
571 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
572 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
573 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
574 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
585 std::string __str__() const throw(INTERP_KERNEL::Exception)
587 return self->simpleRepr();
590 PyObject *getTime() throw(INTERP_KERNEL::Exception)
593 double tmp0=self->getTime(tmp1,tmp2);
594 PyObject *res = PyList_New(3);
595 PyList_SetItem(res,0,SWIG_From_int(tmp1));
596 PyList_SetItem(res,1,SWIG_From_int(tmp2));
597 PyList_SetItem(res,2,SWIG_From_double(tmp0));
601 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
604 bool ret0=self->isEqual(other,eps,what);
605 PyObject *res=PyList_New(2);
606 PyObject *ret0Py=ret0?Py_True:Py_False;
608 PyList_SetItem(res,0,ret0Py);
609 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
613 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
615 std::vector<const DataArrayInt *> grps;
616 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
617 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
620 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
623 bool ret0=self->areFamsEqual(other,what);
624 PyObject *res=PyList_New(2);
625 PyObject *ret0Py=ret0?Py_True:Py_False;
627 PyList_SetItem(res,0,ret0Py);
628 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
632 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
635 bool ret0=self->areGrpsEqual(other,what);
636 PyObject *res=PyList_New(2);
637 PyObject *ret0Py=ret0?Py_True:Py_False;
639 PyList_SetItem(res,0,ret0Py);
640 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
644 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
646 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
647 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
648 PyObject *res=PyList_New(result.size());
649 for(int i=0;iL!=result.end(); i++, iL++)
650 PyList_SetItem(res,i,PyInt_FromLong(*iL));
654 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
656 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
657 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
658 PyObject *res=PyList_New(result.size());
659 for(int i=0;iL!=result.end(); i++, iL++)
660 PyList_SetItem(res,i,PyInt_FromLong(*iL));
664 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
666 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
669 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
672 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
674 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
677 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
680 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
682 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
685 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
688 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
690 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
693 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
696 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
699 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
700 PyObject *ret=PyTuple_New(2);
701 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
702 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
706 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
708 DataArrayInt *ret3=0;
709 std::vector<int> ret1,ret2;
710 bool ret0=self->unPolyze(ret1,ret2,ret3);
711 PyObject *ret=PyTuple_New(4);
712 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
714 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
715 for(int j=0;j<(int)ret1.size()/3;j++)
717 PyObject *retLev2=PyList_New(3);
718 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
719 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
720 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
721 PyList_SetItem(retLev1_0,j,retLev2);
723 PyTuple_SetItem(ret,1,retLev1_0);
725 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
726 for(int j=0;j<(int)ret2.size()/3;j++)
728 PyObject *retLev2=PyList_New(3);
729 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
730 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
731 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
732 PyList_SetItem(retLev1_1,j,retLev2);
734 PyTuple_SetItem(ret,2,retLev1_1);
736 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
742 class MEDFileUMesh : public MEDFileMesh
745 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
746 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
747 static MEDFileUMesh *New();
749 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
750 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
752 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
753 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
754 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
755 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
756 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
757 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
758 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
759 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
760 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
761 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
762 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
763 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
764 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
765 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
766 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
767 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
768 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
769 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
770 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
771 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
773 int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
774 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
775 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
776 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
777 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
778 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
779 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
780 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
781 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
782 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
783 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
784 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
785 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
786 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
789 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
791 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
794 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
796 return MEDFileUMesh::New(fileName,mrs);
801 return MEDFileUMesh::New();
805 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
807 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
810 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)
812 std::vector<int> typesCpp1;
813 convertPyToNewIntArr3(types,typesCpp1);
814 std::size_t sz(typesCpp1.size());
815 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
816 for(std::size_t ii=0;ii<sz;ii++)
817 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
818 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
821 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
822 {// put an empty dict in input to say to __new__ to call __init__...
823 PyObject *ret(PyTuple_New(1));
824 PyObject *ret0(PyDict_New());
825 PyTuple_SetItem(ret,0,ret0);
829 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
831 std::vector<double> a0;
833 std::vector<std::string> a2;
834 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
835 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
836 self->serialize(a0,a1,a2,a3,a4);
837 PyObject *ret(PyTuple_New(5));
838 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
839 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
841 PyObject *ret2(PyList_New(sz));
842 for(int i=0;i<sz;i++)
843 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
844 PyTuple_SetItem(ret,2,ret2);
846 PyObject *ret3(PyList_New(sz));
847 for(int i=0;i<sz;i++)
849 DataArrayInt *elt(a3[i]);
852 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
854 PyTuple_SetItem(ret,3,ret3);
855 DataArrayDouble *ret4(a4);
858 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
862 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
864 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
865 if(!PyTuple_Check(inp))
866 throw INTERP_KERNEL::Exception(MSG);
867 int sz(PyTuple_Size(inp));
869 throw INTERP_KERNEL::Exception(MSG);
870 std::vector<double> a0;
872 std::vector<std::string> a2;
873 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
874 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
876 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
878 fillArrayWithPyListDbl3(a0py,tmp,a0);
879 convertPyToNewIntArr3(a1py,a1);
880 fillStringVector(a2py,a2);
882 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
884 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
885 if(!SWIG_IsOK(status))
886 throw INTERP_KERNEL::Exception(MSG);
887 a4=reinterpret_cast<DataArrayDouble *>(argp);
888 if((DataArrayDouble *)a4)
891 std::vector< DataArrayInt * > a3Tmp;
892 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
893 std::size_t sz(a3Tmp.size());
895 for(std::size_t i=0;i<sz;i++)
901 self->unserialize(a0,a1,a2,a3,a4);
905 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
907 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
910 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
913 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
914 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
917 self->setMeshAtLevel(meshDimRelToMax,m0,false);
920 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
923 self->setMeshAtLevel(meshDimRelToMax,m1);
926 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
929 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
931 std::vector<const MEDCouplingUMesh *> ms;
932 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
933 self->setMeshes(ms,renum);
936 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
938 std::vector<const MEDCouplingUMesh *> ms;
939 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
940 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
943 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
945 std::vector<const MEDCouplingUMesh *> ms;
946 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
947 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
950 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
952 DataArrayDouble *ret=self->getCoords();
958 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
960 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
963 return const_cast<PartDefinition *>(ret);
966 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
968 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
969 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
970 PyObject *ret=PyTuple_New(3);
971 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
972 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
973 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
977 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
979 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
985 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
987 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
988 std::size_t sz(tmp.size());
989 PyObject *ret=PyList_New(sz);
990 for(std::size_t i=0;i<sz;i++)
994 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1001 class MEDFileStructuredMesh : public MEDFileMesh
1006 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1008 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1016 class MEDFileCMesh : public MEDFileStructuredMesh
1019 static MEDFileCMesh *New();
1020 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1021 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1022 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1023 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1028 return MEDFileCMesh::New();
1031 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1033 return MEDFileCMesh::New(fileName,mrs);
1036 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1038 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1041 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1043 const MEDCouplingCMesh *tmp=self->getMesh();
1046 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1051 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1054 static MEDFileCurveLinearMesh *New();
1055 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1056 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1057 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1060 MEDFileCurveLinearMesh()
1062 return MEDFileCurveLinearMesh::New();
1065 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1067 return MEDFileCurveLinearMesh::New(fileName,mrs);
1070 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1072 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1075 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1077 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1080 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1085 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1088 static MEDFileMeshMultiTS *New();
1089 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1090 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1091 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1092 std::string getName() const throw(INTERP_KERNEL::Exception);
1093 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1094 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1097 MEDFileMeshMultiTS()
1099 return MEDFileMeshMultiTS::New();
1102 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1104 return MEDFileMeshMultiTS::New(fileName);
1107 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1109 return MEDFileMeshMultiTS::New(fileName,mName);
1112 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1114 MEDFileMesh *ret=self->getOneTimeStep();
1122 class MEDFileMeshesIterator
1127 PyObject *next() throw(INTERP_KERNEL::Exception)
1129 MEDFileMesh *ret=self->nextt();
1133 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1137 PyErr_SetString(PyExc_StopIteration,"No more data.");
1144 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1147 static MEDFileMeshes *New();
1148 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1149 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1150 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1151 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1152 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1154 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1155 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1156 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1157 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1162 return MEDFileMeshes::New();
1165 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1167 return MEDFileMeshes::New(fileName);
1170 std::string __str__() const throw(INTERP_KERNEL::Exception)
1172 return self->simpleRepr();
1175 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1177 if(PyInt_Check(obj))
1179 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1184 else if(PyString_Check(obj))
1186 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1192 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1195 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1197 self->setMeshAtPos(obj,mesh);
1201 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1203 return self->iterator();
1206 int __len__() const throw(INTERP_KERNEL::Exception)
1208 return self->getNumberOfMeshes();
1211 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1213 MEDFileMesh *ret=self->getMeshAtPos(i);
1218 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1220 MEDFileMesh *ret=self->getMeshWithName(mname);
1228 class MEDFileFieldLoc : public RefCountObject
1231 std::string getName() const;
1232 int getDimension() const;
1233 int getNumberOfGaussPoints() const;
1234 int getNumberOfPointsInCells() const;
1235 const std::vector<double>& getRefCoords() const;
1236 const std::vector<double>& getGaussCoords() const;
1237 const std::vector<double>& getGaussWeights() const;
1238 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1241 std::string __str__() const throw(INTERP_KERNEL::Exception)
1243 return self->repr();
1248 class MEDFileFieldGlobsReal
1251 void resetContent();
1252 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1253 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1254 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1255 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1256 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1257 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1258 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1259 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1260 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1261 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1262 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1263 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1264 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1265 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1266 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1267 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1268 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1269 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1270 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1271 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1272 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1273 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1274 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1275 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1276 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1277 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1280 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1282 const DataArrayInt *ret=self->getProfile(pflName);
1285 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1288 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1290 const DataArrayInt *ret=self->getProfileFromId(pflId);
1293 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1296 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1298 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1301 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1304 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1306 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1309 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1312 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1314 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1315 return convertVecPairVecStToPy(ret);
1318 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1320 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1321 return convertVecPairVecStToPy(ret);
1324 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1326 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1327 self->changePflsNames(v);
1330 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1332 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1333 self->changePflsRefsNamesGen(v);
1336 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1338 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1339 self->changePflsNamesInStruct(v);
1342 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1344 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1345 self->changeLocsNames(v);
1348 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1350 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1351 self->changeLocsRefsNamesGen(v);
1354 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1356 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1357 self->changeLocsNamesInStruct(v);
1360 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1362 std::ostringstream oss;
1363 self->simpleReprGlobs(oss);
1369 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1372 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1373 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1374 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1375 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1376 void loadArrays() throw(INTERP_KERNEL::Exception);
1377 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1378 void unloadArrays() throw(INTERP_KERNEL::Exception);
1379 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1380 int getDimension() const throw(INTERP_KERNEL::Exception);
1381 int getIteration() const throw(INTERP_KERNEL::Exception);
1382 int getOrder() const throw(INTERP_KERNEL::Exception);
1383 std::string getName() throw(INTERP_KERNEL::Exception);
1384 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1385 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1386 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1387 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1388 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1389 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1390 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1391 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1392 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1393 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1394 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1395 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1396 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1397 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1398 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1401 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1404 double tmp0=self->getTime(tmp1,tmp2);
1405 PyObject *res = PyList_New(3);
1406 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1407 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1408 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1412 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1414 std::pair<int,int> res=self->getDtIt();
1415 PyObject *elt=PyTuple_New(2);
1416 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1417 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1421 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1423 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1426 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1428 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1431 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1433 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1434 return self->changeMeshNames(modifTab);
1437 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1439 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1440 PyObject *ret2=PyList_New(ret.size());
1441 for(int i=0;i<(int)ret.size();i++)
1442 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1446 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1448 std::vector<int> ret1;
1449 int ret0=self->getNonEmptyLevels(mname,ret1);
1450 PyObject *elt=PyTuple_New(2);
1451 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1452 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1456 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1458 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1459 std::vector< std::vector<TypeOfField> > typesF;
1460 std::vector< std::vector<std::string> > pfls;
1461 std::vector< std::vector<std::string> > locs;
1462 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1464 PyObject *ret2=PyList_New(sz);
1465 for(int i=0;i<sz;i++)
1467 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1468 const std::vector<TypeOfField>& typesFI=typesF[i];
1469 const std::vector<std::string>& pflsI=pfls[i];
1470 const std::vector<std::string>& locsI=locs[i];
1471 PyObject *elt=PyTuple_New(2);
1472 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1473 int sz2=ret[i].size();
1474 PyObject *elt2=PyList_New(sz2);
1475 for(int j=0;j<sz2;j++)
1477 PyObject *elt3=PyTuple_New(4);
1478 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1479 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));
1480 PyTuple_SetItem(elt3,1,elt4);
1481 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1482 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1483 PyList_SetItem(elt2,j,elt3);
1485 PyTuple_SetItem(elt,1,elt2);
1486 PyList_SetItem(ret2,i,elt);
1491 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1493 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1494 std::size_t sz=ret.size();
1495 PyObject *retPy=PyList_New(sz);
1496 for(std::size_t i=0;i<sz;i++)
1497 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1501 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1503 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1504 std::size_t sz=ret.size();
1505 PyObject *retPy=PyList_New(sz);
1506 for(std::size_t i=0;i<sz;i++)
1507 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1511 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1513 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1514 std::size_t sz=ret.size();
1515 PyObject *retPy=PyList_New(sz);
1516 for(std::size_t i=0;i<sz;i++)
1517 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1523 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1526 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1527 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1528 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1529 static MEDFileField1TS *New();
1530 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1531 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1532 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1533 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1534 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1535 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1537 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1538 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1539 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1540 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1543 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1545 return MEDFileField1TS::New(fileName,loadAll);
1548 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1550 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1553 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1555 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1560 return MEDFileField1TS::New();
1563 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1565 const DataArrayDouble *arr=0;
1567 arr=field->getArray();
1568 self->copyTinyInfoFrom(field,arr);
1571 std::string __str__() const throw(INTERP_KERNEL::Exception)
1573 return self->simpleRepr();
1576 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1578 DataArrayInt *ret1=0;
1579 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1580 PyObject *ret=PyTuple_New(2);
1581 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1582 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1586 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1588 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1589 std::vector< std::vector<TypeOfField> > typesF;
1590 std::vector< std::vector<std::string> > pfls;
1591 std::vector< std::vector<std::string> > locs;
1592 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1594 PyObject *ret2=PyList_New(sz);
1595 for(int i=0;i<sz;i++)
1597 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1598 const std::vector<TypeOfField>& typesFI=typesF[i];
1599 const std::vector<std::string>& pflsI=pfls[i];
1600 const std::vector<std::string>& locsI=locs[i];
1601 PyObject *elt=PyTuple_New(2);
1602 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1603 int sz2=ret[i].size();
1604 PyObject *elt2=PyList_New(sz2);
1605 for(int j=0;j<sz2;j++)
1607 PyObject *elt3=PyTuple_New(4);
1608 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1609 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1610 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1611 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1612 PyList_SetItem(elt2,j,elt3);
1614 PyTuple_SetItem(elt,1,elt2);
1615 PyList_SetItem(ret2,i,elt);
1620 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1622 DataArrayDouble *ret=self->getUndergroundDataArray();
1628 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1630 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1631 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1634 PyObject *ret=PyTuple_New(2);
1635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1636 std::size_t sz=elt1Cpp.size();
1637 PyObject *elt=PyList_New(sz);
1638 for(std::size_t i=0;i<sz;i++)
1640 PyObject *elt1=PyTuple_New(2);
1641 PyObject *elt2=PyTuple_New(2);
1642 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1643 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1644 PyObject *elt3=PyTuple_New(2);
1645 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1646 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1647 PyTuple_SetItem(elt1,0,elt2);
1648 PyTuple_SetItem(elt1,1,elt3);
1649 PyList_SetItem(elt,i,elt1);
1651 PyTuple_SetItem(ret,1,elt);
1657 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1660 static MEDFileIntField1TS *New();
1661 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1662 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1663 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1664 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1666 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1667 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1670 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1672 return MEDFileIntField1TS::New();
1675 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1677 return MEDFileIntField1TS::New(fileName,loadAll);
1680 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1682 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1685 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1687 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1690 std::string __str__() const throw(INTERP_KERNEL::Exception)
1692 return self->simpleRepr();
1695 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1697 DataArrayInt *ret1=0;
1698 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1699 PyObject *ret=PyTuple_New(2);
1700 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1701 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1705 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1707 DataArrayInt *ret1=0;
1708 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1709 PyObject *ret=PyTuple_New(2);
1710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1715 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1717 DataArrayInt *ret1=0;
1718 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1719 PyObject *ret=PyTuple_New(2);
1720 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1721 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1725 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1727 DataArrayInt *ret1=0;
1728 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1729 PyObject *ret=PyTuple_New(2);
1730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1735 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1737 DataArrayInt *ret1=0;
1738 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1739 PyObject *ret=PyTuple_New(2);
1740 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1741 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1745 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1747 DataArrayInt *ret1=0;
1748 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1749 PyObject *ret=PyTuple_New(2);
1750 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1751 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1755 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1757 DataArrayInt *ret=self->getUndergroundDataArray();
1765 class MEDFileAnyTypeFieldMultiTSIterator
1770 PyObject *next() throw(INTERP_KERNEL::Exception)
1772 MEDFileAnyTypeField1TS *ret=self->nextt();
1774 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1777 PyErr_SetString(PyExc_StopIteration,"No more data.");
1784 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1787 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1788 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1789 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1790 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1791 std::string getName() const throw(INTERP_KERNEL::Exception);
1792 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1793 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1794 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1795 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1796 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1797 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1798 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1799 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1800 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1801 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1802 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1803 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1804 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1805 void loadArrays() throw(INTERP_KERNEL::Exception);
1806 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1807 void unloadArrays() throw(INTERP_KERNEL::Exception);
1808 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1810 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1811 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1812 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1813 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1814 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1817 int __len__() const throw(INTERP_KERNEL::Exception)
1819 return self->getNumberOfTS();
1822 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1824 if(elt0 && PyInt_Check(elt0))
1826 int pos=PyInt_AS_LONG(elt0);
1829 else if(elt0 && PyTuple_Check(elt0))
1831 if(PyTuple_Size(elt0)==2)
1833 PyObject *o0=PyTuple_GetItem(elt0,0);
1834 PyObject *o1=PyTuple_GetItem(elt0,1);
1835 if(PyInt_Check(o0) && PyInt_Check(o1))
1837 int iter=PyInt_AS_LONG(o0);
1838 int order=PyInt_AS_LONG(o1);
1839 return self->getPosOfTimeStep(iter,order);
1842 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 !");
1845 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 !");
1847 else if(elt0 && PyFloat_Check(elt0))
1849 double val=PyFloat_AS_DOUBLE(elt0);
1850 return self->getPosGivenTime(val);
1853 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1856 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1858 std::vector< std::pair<int,int> > res=self->getIterations();
1859 PyObject *ret=PyList_New(res.size());
1861 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1863 PyObject *elt=PyTuple_New(2);
1864 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1865 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1866 PyList_SetItem(ret,rk,elt);
1871 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1873 std::vector<double> ret1;
1874 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1875 std::size_t sz=ret.size();
1876 PyObject *ret2=PyList_New(sz);
1877 for(std::size_t i=0;i<sz;i++)
1879 PyObject *elt=PyTuple_New(3);
1880 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1881 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1882 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1883 PyList_SetItem(ret2,i,elt);
1888 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1890 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1891 PyObject *ret2=PyList_New(ret.size());
1892 for(int i=0;i<(int)ret.size();i++)
1894 const std::vector<TypeOfField>& rett=ret[i];
1895 PyObject *ret3=PyList_New(rett.size());
1896 for(int j=0;j<(int)rett.size();j++)
1897 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1898 PyList_SetItem(ret2,i,ret3);
1903 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1905 std::vector<int> ret1;
1906 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1907 PyObject *elt=PyTuple_New(2);
1908 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1909 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1913 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1915 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1916 std::vector< std::vector<TypeOfField> > typesF;
1917 std::vector< std::vector<std::string> > pfls;
1918 std::vector< std::vector<std::string> > locs;
1919 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1921 PyObject *ret2=PyList_New(sz);
1922 for(int i=0;i<sz;i++)
1924 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1925 const std::vector<TypeOfField>& typesFI=typesF[i];
1926 const std::vector<std::string>& pflsI=pfls[i];
1927 const std::vector<std::string>& locsI=locs[i];
1928 PyObject *elt=PyTuple_New(2);
1929 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1930 int sz2=ret[i].size();
1931 PyObject *elt2=PyList_New(sz2);
1932 for(int j=0;j<sz2;j++)
1934 PyObject *elt3=PyTuple_New(4);
1935 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1936 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));
1937 PyTuple_SetItem(elt3,1,elt4);
1938 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1939 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1940 PyList_SetItem(elt2,j,elt3);
1942 PyTuple_SetItem(elt,1,elt2);
1943 PyList_SetItem(ret2,i,elt);
1948 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1950 if(PyList_Check(elts))
1952 int sz=PyList_Size(elts);
1953 std::vector<int> ret(sz);
1954 for(int i=0;i<sz;i++)
1956 PyObject *elt=PyList_GetItem(elts,i);
1957 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1963 std::vector<int> ret(1);
1964 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1969 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1971 if(PySlice_Check(elts))
1973 Py_ssize_t strt=2,stp=2,step=2;
1974 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1975 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1976 self->eraseTimeStepIds2(strt,stp,step);
1980 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1981 if(!idsToRemove.empty())
1982 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1986 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1990 std::vector<int> pos2;
1991 DataArrayInt *pos3=0;
1992 DataArrayIntTuple *pos4=0;
1993 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1998 self->eraseTimeStepIds(&pos1,&pos1+1);
2005 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2010 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2014 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2018 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2020 return self->iterator();
2023 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2025 if(elt0 && PyList_Check(elt0))
2027 int sz=PyList_Size(elt0);
2028 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2029 int *pt=da->getPointer();
2030 for(int i=0;i<sz;i++,pt++)
2032 PyObject *elt1=PyList_GetItem(elt0,i);
2033 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2035 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2037 else if(elt0 && PySlice_Check(elt0))
2039 Py_ssize_t strt=2,stp=2,step=2;
2040 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2041 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2042 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2045 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2048 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2050 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2051 return self->changeMeshNames(modifTab);
2054 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2056 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2057 std::size_t sz=ret.size();
2058 PyObject *retPy=PyList_New(sz);
2059 for(std::size_t i=0;i<sz;i++)
2060 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2064 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2066 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2067 std::size_t sz=ret.size();
2068 PyObject *retPy=PyList_New(sz);
2069 for(std::size_t i=0;i<sz;i++)
2070 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2074 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2076 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2077 std::size_t sz=ret.size();
2078 PyObject *retPy=PyList_New(sz);
2079 for(std::size_t i=0;i<sz;i++)
2080 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2084 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2086 std::vector<MEDFileAnyTypeField1TS *> tmp;
2087 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2088 self->pushBackTimeSteps(tmp);
2091 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2093 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2094 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2095 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2096 std::size_t sz=ret.size();
2097 PyObject *retPy=PyList_New(sz);
2098 for(std::size_t i=0;i<sz;i++)
2100 std::size_t sz2=ret[i].size();
2101 PyObject *ret1Py=PyList_New(sz2);
2102 for(std::size_t j=0;j<sz2;j++)
2104 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2107 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2109 PyList_SetItem(retPy,i,ret1Py);
2114 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2116 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2117 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2118 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2119 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2120 if(ret2.size()!=ret.size())
2122 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2123 throw INTERP_KERNEL::Exception(oss.str().c_str());
2125 std::size_t sz=ret.size();
2126 PyObject *retPy=PyList_New(sz);
2127 for(std::size_t i=0;i<sz;i++)
2129 std::size_t sz2=ret[i].size();
2130 PyObject *ret0Py=PyTuple_New(2);
2131 PyObject *ret1Py=PyList_New(sz2);
2132 for(std::size_t j=0;j<sz2;j++)
2134 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2137 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2139 PyTuple_SetItem(ret0Py,0,ret1Py);
2140 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2141 PyList_SetItem(retPy,i,ret0Py);
2148 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2151 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2152 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2153 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2155 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2156 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2157 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2158 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2159 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2161 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2162 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2163 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2166 MEDFileFieldMultiTS()
2168 return MEDFileFieldMultiTS::New();
2171 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2173 return MEDFileFieldMultiTS::New(fileName,loadAll);
2176 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2178 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2181 std::string __str__() const throw(INTERP_KERNEL::Exception)
2183 return self->simpleRepr();
2186 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2188 DataArrayInt *ret1=0;
2189 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2190 PyObject *ret=PyTuple_New(2);
2191 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2192 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2198 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2199 std::vector< std::vector<TypeOfField> > typesF;
2200 std::vector< std::vector<std::string> > pfls;
2201 std::vector< std::vector<std::string> > locs;
2202 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2204 PyObject *ret2=PyList_New(sz);
2205 for(int i=0;i<sz;i++)
2207 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2208 const std::vector<TypeOfField>& typesFI=typesF[i];
2209 const std::vector<std::string>& pflsI=pfls[i];
2210 const std::vector<std::string>& locsI=locs[i];
2211 PyObject *elt=PyTuple_New(2);
2212 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2213 int sz2=ret[i].size();
2214 PyObject *elt2=PyList_New(sz2);
2215 for(int j=0;j<sz2;j++)
2217 PyObject *elt3=PyTuple_New(4);
2218 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2219 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2220 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2221 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2222 PyList_SetItem(elt2,j,elt3);
2224 PyTuple_SetItem(elt,1,elt2);
2225 PyList_SetItem(ret2,i,elt);
2229 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2231 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2237 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2239 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2240 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2243 PyObject *ret=PyTuple_New(2);
2244 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2245 std::size_t sz=elt1Cpp.size();
2246 PyObject *elt=PyList_New(sz);
2247 for(std::size_t i=0;i<sz;i++)
2249 PyObject *elt1=PyTuple_New(2);
2250 PyObject *elt2=PyTuple_New(2);
2251 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2252 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2253 PyObject *elt3=PyTuple_New(2);
2254 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2255 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2256 PyTuple_SetItem(elt1,0,elt2);
2257 PyTuple_SetItem(elt1,1,elt3);
2258 PyList_SetItem(elt,i,elt1);
2260 PyTuple_SetItem(ret,1,elt);
2266 class MEDFileFieldsIterator
2271 PyObject *next() throw(INTERP_KERNEL::Exception)
2273 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2275 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2278 PyErr_SetString(PyExc_StopIteration,"No more data.");
2285 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2288 static MEDFileIntFieldMultiTS *New();
2289 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2290 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2292 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2293 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2294 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2297 MEDFileIntFieldMultiTS()
2299 return MEDFileIntFieldMultiTS::New();
2302 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2304 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2307 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2309 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2312 std::string __str__() const throw(INTERP_KERNEL::Exception)
2314 return self->simpleRepr();
2317 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2319 DataArrayInt *ret1=0;
2320 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2321 PyObject *ret=PyTuple_New(2);
2322 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2323 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2327 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2329 DataArrayInt *ret1=0;
2330 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2331 PyObject *ret=PyTuple_New(2);
2332 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2333 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2337 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2339 DataArrayInt *ret1=0;
2340 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2349 DataArrayInt *ret1=0;
2350 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2351 PyObject *ret=PyTuple_New(2);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2359 DataArrayInt *ret1=0;
2360 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2361 PyObject *ret=PyTuple_New(2);
2362 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2363 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2367 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2369 DataArrayInt *ret1=0;
2370 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2371 PyObject *ret=PyTuple_New(2);
2372 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2373 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2377 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2379 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2387 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2390 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2391 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2392 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2393 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2394 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2395 void loadArrays() throw(INTERP_KERNEL::Exception);
2396 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2397 void unloadArrays() throw(INTERP_KERNEL::Exception);
2398 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2399 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2400 int getNumberOfFields() const;
2401 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2402 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2404 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2405 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2406 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2407 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2408 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2409 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2410 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2411 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2412 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2417 return MEDFileFields::New();
2420 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2422 return MEDFileFields::New(fileName,loadAll);
2425 std::string __str__() const throw(INTERP_KERNEL::Exception)
2427 return self->simpleRepr();
2430 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2432 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2433 std::size_t sz(tmp.size());
2434 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2435 for(std::size_t i=0;i<sz;i++)
2437 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2438 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2440 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2443 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2446 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2447 PyObject *ret=PyTuple_New(2);
2448 PyObject *ret_0=PyList_New(ret0.size());
2450 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2452 PyObject *elt=PyTuple_New(2);
2453 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2454 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2455 PyList_SetItem(ret_0,rk,elt);
2457 PyTuple_SetItem(ret,0,ret_0);
2458 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2459 PyTuple_SetItem(ret,1,ret_1);
2463 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2465 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2466 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2469 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2471 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2472 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2475 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2477 if(obj && PyList_Check(obj))
2479 int sz=PyList_Size(obj);
2480 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2481 int *pt=da->getPointer();
2482 for(int i=0;i<sz;i++,pt++)
2484 PyObject *elt1=PyList_GetItem(obj,i);
2485 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2487 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2490 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2493 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2495 self->setFieldAtPos(obj,field);
2499 int __len__() const throw(INTERP_KERNEL::Exception)
2501 return self->getNumberOfFields();
2504 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2506 return self->iterator();
2509 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2511 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2512 return self->changeMeshNames(modifTab);
2515 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2517 if(elt0 && PyInt_Check(elt0))
2519 return PyInt_AS_LONG(elt0);
2521 else if(elt0 && PyString_Check(elt0))
2522 return self->getPosFromFieldName(PyString_AsString(elt0));
2524 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2527 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2529 if(PyList_Check(elts))
2531 int sz=PyList_Size(elts);
2532 std::vector<int> ret(sz);
2533 for(int i=0;i<sz;i++)
2535 PyObject *elt=PyList_GetItem(elts,i);
2536 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2542 std::vector<int> ret(1);
2543 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2548 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2550 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2551 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2552 self->pushFields(tmp);
2555 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2557 if(elts && PySlice_Check(elts))
2559 Py_ssize_t strt=2,stp=2,step=2;
2560 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2561 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2562 self->destroyFieldsAtPos2(strt,stp,step);
2566 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2567 if(!idsToRemove.empty())
2568 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2574 class MEDFileParameter1TS : public RefCountObject
2577 void setIteration(int it);
2578 int getIteration() const;
2579 void setOrder(int order);
2580 int getOrder() const;
2581 void setTimeValue(double time);
2582 void setTime(int dt, int it, double time);
2583 double getTime(int& dt, int& it);
2584 double getTimeValue() const;
2587 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2590 void setValue(double val) throw(INTERP_KERNEL::Exception);
2591 double getValue() const throw(INTERP_KERNEL::Exception);
2592 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2595 std::string __str__() const throw(INTERP_KERNEL::Exception)
2597 return self->simpleRepr();
2602 class MEDFileParameterTinyInfo : public MEDFileWritable
2605 void setDescription(const std::string& name);
2606 std::string getDescription() const;
2607 void setTimeUnit(const std::string& unit);
2608 std::string getTimeUnit() const;
2611 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2614 static MEDFileParameterDouble1TS *New();
2615 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2616 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2617 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2618 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2619 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2620 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2621 std::string getName() const throw(INTERP_KERNEL::Exception);
2622 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2625 MEDFileParameterDouble1TS()
2627 return MEDFileParameterDouble1TS::New();
2630 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2632 return MEDFileParameterDouble1TS::New(fileName);
2635 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2637 return MEDFileParameterDouble1TS::New(fileName,paramName);
2640 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2642 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2645 std::string __str__() const throw(INTERP_KERNEL::Exception)
2647 return self->simpleRepr();
2650 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2653 bool ret0=self->isEqual(other,eps,what);
2654 PyObject *res=PyList_New(2);
2655 PyObject *ret0Py=ret0?Py_True:Py_False;
2657 PyList_SetItem(res,0,ret0Py);
2658 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2664 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2667 static MEDFileParameterMultiTS *New();
2668 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2669 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2670 std::string getName() const;
2671 void setName(const std::string& name);
2672 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2673 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2674 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2675 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2676 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2677 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2678 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2679 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2682 MEDFileParameterMultiTS()
2684 return MEDFileParameterMultiTS::New();
2687 MEDFileParameterMultiTS(const std::string& fileName)
2689 return MEDFileParameterMultiTS::New(fileName);
2692 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2694 return MEDFileParameterMultiTS::New(fileName,paramName);
2697 std::string __str__() const throw(INTERP_KERNEL::Exception)
2699 return self->simpleRepr();
2702 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2705 bool ret0=self->isEqual(other,eps,what);
2706 PyObject *res=PyList_New(2);
2707 PyObject *ret0Py=ret0?Py_True:Py_False;
2709 PyList_SetItem(res,0,ret0Py);
2710 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2714 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2718 std::vector<int> pos2;
2719 DataArrayInt *pos3=0;
2720 DataArrayIntTuple *pos4=0;
2721 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2726 self->eraseTimeStepIds(&pos1,&pos1+1);
2733 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2738 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2742 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2746 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2748 if(elt0 && PyInt_Check(elt0))
2750 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2753 else if(elt0 && PyTuple_Check(elt0))
2755 if(PyTuple_Size(elt0)==2)
2757 PyObject *o0=PyTuple_GetItem(elt0,0);
2758 PyObject *o1=PyTuple_GetItem(elt0,1);
2759 if(PyInt_Check(o0) && PyInt_Check(o1))
2761 int iter=PyInt_AS_LONG(o0);
2762 int order=PyInt_AS_LONG(o1);
2763 return self->getPosOfTimeStep(iter,order);
2766 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 !");
2769 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 !");
2771 else if(elt0 && PyFloat_Check(elt0))
2773 double val=PyFloat_AS_DOUBLE(elt0);
2774 return self->getPosGivenTime(val);
2777 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2780 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2782 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2788 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2790 if(PyList_Check(elts))
2792 int sz=PyList_Size(elts);
2793 std::vector<int> ret(sz);
2794 for(int i=0;i<sz;i++)
2796 PyObject *elt=PyList_GetItem(elts,i);
2797 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2803 std::vector<int> ret(1);
2804 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2809 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2811 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2812 if(!idsToRemove.empty())
2813 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2816 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2818 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2824 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2826 std::vector< std::pair<int,int> > res=self->getIterations();
2827 PyObject *ret=PyList_New(res.size());
2829 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2831 PyObject *elt=PyTuple_New(2);
2832 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2833 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2834 PyList_SetItem(ret,rk,elt);
2839 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2841 std::vector<double> res2;
2842 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2843 PyObject *ret=PyList_New(res.size());
2845 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2847 PyObject *elt=PyTuple_New(3);
2848 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2849 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2850 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2851 PyList_SetItem(ret,rk,elt);
2858 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2861 static MEDFileParameters *New();
2862 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2863 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2864 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2865 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2866 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2867 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2868 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2869 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2870 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2871 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2872 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2877 return MEDFileParameters::New();
2880 MEDFileParameters(const std::string& fileName)
2882 return MEDFileParameters::New(fileName);
2885 std::string __str__() const throw(INTERP_KERNEL::Exception)
2887 return self->simpleRepr();
2890 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2892 if(PyInt_Check(obj))
2894 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2899 else if(PyString_Check(obj))
2901 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2907 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2910 int __len__() const throw(INTERP_KERNEL::Exception)
2912 return self->getNumberOfParams();
2915 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2917 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2923 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2925 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2931 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2934 bool ret0=self->isEqual(other,eps,what);
2935 PyObject *res=PyList_New(2);
2936 PyObject *ret0Py=ret0?Py_True:Py_False;
2938 PyList_SetItem(res,0,ret0Py);
2939 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2945 class MEDFileData : public RefCountObject, public MEDFileWritable
2948 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2949 static MEDFileData *New();
2950 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2951 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2952 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2953 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2954 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2955 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2956 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2958 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2959 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2961 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2964 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2966 return MEDFileData::New(fileName);
2971 return MEDFileData::New();
2974 std::string __str__() const throw(INTERP_KERNEL::Exception)
2976 return self->simpleRepr();
2979 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2981 MEDFileMeshes *ret=self->getMeshes();
2987 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2989 MEDFileParameters *ret=self->getParams();
2995 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2997 MEDFileFields *ret=self->getFields();
3003 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3005 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3006 return self->changeMeshNames(modifTab);
3011 class SauvReader : public RefCountObject
3014 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3015 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3018 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3020 return SauvReader::New(fileName);
3025 class SauvWriter : public RefCountObject
3028 static SauvWriter * New();
3029 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3030 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3031 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3032 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3035 SauvWriter() throw(INTERP_KERNEL::Exception)
3037 return SauvWriter::New();
3044 class MEDFileMeshStruct;
3046 class MEDFileField1TSStructItem
3049 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3052 class MEDFileMeshStruct : public RefCountObject
3055 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3057 ~MEDFileMeshStruct();
3060 class MEDMeshMultiLev : public RefCountObject
3063 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3064 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3070 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3072 DataArrayInt *famIds(0);
3073 bool isWithoutCopy(false);
3074 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3075 PyObject *ret=PyTuple_New(2);
3076 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3078 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3079 PyTuple_SetItem(ret,1,ret1Py);
3083 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3085 DataArrayInt *numIds(0);
3086 bool isWithoutCopy(false);
3087 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3088 PyObject *ret=PyTuple_New(2);
3089 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3091 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3092 PyTuple_SetItem(ret,1,ret1Py);
3096 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3098 DataArrayInt *famIds(0);
3099 bool isWithoutCopy(false);
3100 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3101 PyObject *ret=PyTuple_New(2);
3102 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3104 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3105 PyTuple_SetItem(ret,1,ret1Py);
3109 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3111 DataArrayInt *numIds(0);
3112 bool isWithoutCopy(false);
3113 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3114 PyObject *ret=PyTuple_New(2);
3115 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3117 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3118 PyTuple_SetItem(ret,1,ret1Py);
3122 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3124 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3125 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3126 PyObject *res(PyList_New(result.size()));
3127 for(int i=0;iL!=result.end(); i++, iL++)
3128 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3134 class MEDUMeshMultiLev : public MEDMeshMultiLev
3137 ~MEDUMeshMultiLev();
3141 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3143 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3144 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3145 PyObject *ret0Py=ncc?Py_True:Py_False;
3147 PyObject *ret=PyTuple_New(7);
3148 PyTuple_SetItem(ret,0,ret0Py);
3149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3150 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3151 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3152 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3153 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3154 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3160 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3163 ~MEDStructuredMeshMultiLev();
3166 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3169 ~MEDCMeshMultiLev();
3173 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3176 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3177 std::size_t sz(objs.size());
3178 PyObject *ret(PyTuple_New(2));
3179 PyObject *ret0=PyList_New(sz);
3180 for(std::size_t i=0;i<sz;i++)
3181 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3182 PyTuple_SetItem(ret,0,ret0);
3183 PyObject *ret1Py(isInternal?Py_True:Py_False);
3185 PyTuple_SetItem(ret,1,ret1Py);
3191 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3194 ~MEDCurveLinearMeshMultiLev();
3198 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3200 DataArrayDouble *ret0(0);
3201 std::vector<int> ret1;
3203 self->buildVTUArrays(ret0,ret1,ret2);
3204 std::size_t sz(ret1.size());
3205 PyObject *ret=PyTuple_New(3);
3206 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3207 PyObject *ret1Py=PyList_New(sz);
3208 for(std::size_t i=0;i<sz;i++)
3209 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3210 PyTuple_SetItem(ret,1,ret1Py);
3211 PyObject *ret2Py(ret2?Py_True:Py_False);
3213 PyTuple_SetItem(ret,2,ret2Py);
3219 class MEDFileFastCellSupportComparator : public RefCountObject
3222 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3223 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3224 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3225 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3227 ~MEDFileFastCellSupportComparator();
3231 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3233 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3234 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3235 PyObject *res(PyList_New(result.size()));
3236 for(int i=0;iL!=result.end(); i++, iL++)
3237 PyList_SetItem(res,i,PyInt_FromLong(*iL));