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::LoadSpecificEntities;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
152 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
153 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
154 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
155 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
156 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
157 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
158 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
160 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
161 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
162 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
163 %newobject ParaMEDMEM::MEDFileField1TS::New;
164 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
165 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
166 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
167 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
168 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
169 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
170 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
171 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
172 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
174 %newobject ParaMEDMEM::MEDFileData::New;
175 %newobject ParaMEDMEM::MEDFileData::deepCpy;
176 %newobject ParaMEDMEM::MEDFileData::getMeshes;
177 %newobject ParaMEDMEM::MEDFileData::getFields;
178 %newobject ParaMEDMEM::MEDFileData::getParams;
180 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
181 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
182 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
183 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
184 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
185 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
186 %newobject ParaMEDMEM::MEDFileParameters::New;
187 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
188 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
189 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
190 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
192 %newobject ParaMEDMEM::SauvWriter::New;
193 %newobject ParaMEDMEM::SauvReader::New;
194 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
196 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
197 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
198 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
199 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
200 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
202 %feature("unref") MEDFileMesh "$this->decrRef();"
203 %feature("unref") MEDFileUMesh "$this->decrRef();"
204 %feature("unref") MEDFileCMesh "$this->decrRef();"
205 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileMeshes "$this->decrRef();"
207 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
208 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
209 %feature("unref") MEDFileField1TS "$this->decrRef();"
210 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
211 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
212 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
213 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
214 %feature("unref") MEDFileFields "$this->decrRef();"
215 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
216 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
217 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
218 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
219 %feature("unref") MEDFileParameters "$this->decrRef();"
220 %feature("unref") MEDFileData "$this->decrRef();"
221 %feature("unref") SauvReader "$this->decrRef();"
222 %feature("unref") SauvWriter "$this->decrRef();"
223 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
224 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
225 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
226 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
227 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
228 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
233 static bool HasXDR();
234 static std::string MEDFileVersionStr();
235 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
236 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
237 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
238 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
245 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
246 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
247 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
248 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
249 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
250 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
251 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
254 static PyObject *MEDFileVersion()
256 int major,minor,release;
257 MEDLoader::MEDFileVersion(major,minor,release);
258 PyObject *ret(PyTuple_New(3));
259 PyTuple_SetItem(ret,0,SWIG_From_int(major));
260 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
261 PyTuple_SetItem(ret,2,SWIG_From_int(release));
265 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
267 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
268 PyObject *ret=PyList_New(res.size());
270 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
272 PyObject *elt=PyTuple_New(2);
273 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
274 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
275 PyList_SetItem(ret,rk,elt);
280 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
282 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
283 PyObject *ret=PyList_New(res.size());
285 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
287 PyObject *elt=PyTuple_New(3);
288 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
289 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
290 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
291 PyList_SetItem(ret,rk,elt);
296 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
298 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
299 PyObject *ret=PyList_New(res.size());
301 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
303 PyObject *elt=PyTuple_New(2);
304 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
305 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
306 PyList_SetItem(ret,rk,elt);
310 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
312 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
313 PyObject *ret=PyList_New(res.size());
315 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
317 PyObject *elt=PyTuple_New(2);
318 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
319 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
320 PyList_SetItem(ret,rk,elt);
324 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
326 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
327 PyObject *ret=PyList_New(res.size());
329 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
331 PyObject *elt=PyTuple_New(2);
332 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
333 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
334 PyList_SetItem(ret,rk,elt);
338 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
340 int meshDim,spaceDim,numberOfNodes;
341 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
342 PyObject *ret=PyTuple_New(4);
343 PyObject *elt0=PyList_New(res.size());
345 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
347 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
349 PyObject *elt1=PyList_New(obj2.size());
350 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
352 PyObject *elt2=PyTuple_New(2);
353 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
354 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
355 PyList_SetItem(elt1,j,elt2);
357 PyList_SetItem(elt0,i,elt1);
359 PyTuple_SetItem(ret,0,elt0);
360 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
361 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
362 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
365 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
366 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
368 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
369 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
370 return convertFieldDoubleVecToPy(res);
372 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
374 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
375 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
376 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
378 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
380 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
381 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
382 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
384 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
386 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
387 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
388 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
390 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
392 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
394 PyObject *ret=PyList_New(size);
395 for(int i=0;i<size;i++)
396 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
399 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
401 std::vector<std::string> grps;
402 converPyListToVecString(li,grps);
403 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
405 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
407 std::vector<std::string> fams;
408 converPyListToVecString(li,fams);
409 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
412 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
413 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
414 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
415 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
416 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
417 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);
418 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);
419 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);
420 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);
421 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);
422 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
423 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
424 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
425 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
426 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
427 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
432 class MEDFileWritable
435 void copyOptionsFrom(const MEDFileWritable& other) const;
436 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
437 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
438 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
439 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
442 class MEDFileMeshReadSelector
445 MEDFileMeshReadSelector();
446 MEDFileMeshReadSelector(unsigned int code);
447 unsigned int getCode() const;
448 void setCode(unsigned int newCode);
449 bool isCellFamilyFieldReading() const;
450 bool isNodeFamilyFieldReading() const;
451 bool isCellNameFieldReading() const;
452 bool isNodeNameFieldReading() const;
453 bool isCellNumFieldReading() const;
454 bool isNodeNumFieldReading() const;
455 void setCellFamilyFieldReading(bool b);
456 void setNodeFamilyFieldReading(bool b);
457 void setCellNameFieldReading(bool b);
458 void setNodeNameFieldReading(bool b);
459 void setCellNumFieldReading(bool b);
460 void setNodeNumFieldReading(bool b);
463 std::string __str__() const throw(INTERP_KERNEL::Exception)
465 std::ostringstream oss;
470 std::string __repr__() const throw(INTERP_KERNEL::Exception)
472 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
478 class MEDFileMesh : public RefCountObject, public MEDFileWritable
481 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
482 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
483 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
484 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
485 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
486 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
487 void setName(const std::string& name);
488 std::string getName();
489 std::string getUnivName() const;
490 bool getUnivNameWrStatus() const;
491 void setUnivNameWrStatus(bool newStatus);
492 void setDescription(const std::string& name);
493 std::string getDescription() const;
494 void setOrder(int order);
495 int getOrder() const;
496 void setIteration(int it);
498 void setTimeValue(double time);
499 void setTime(int dt, int it, double time);
500 double getTimeValue() const;
501 void setTimeUnit(const std::string& unit);
502 std::string getTimeUnit() const;
503 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
504 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
505 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
506 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
507 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
508 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
509 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
510 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
511 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
512 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
513 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
514 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
516 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
517 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
518 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
519 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
520 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
521 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
522 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
523 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
524 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
525 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
526 void clearGrpMap() throw(INTERP_KERNEL::Exception);
527 void clearFamMap() throw(INTERP_KERNEL::Exception);
528 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
529 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
530 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
531 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
532 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
533 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
534 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
535 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
536 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
537 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
538 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
539 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
540 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
541 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
542 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
543 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
544 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
545 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
546 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
547 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
548 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
549 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
550 void setFamilyInfo(const std::map<std::string,int>& info);
551 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
552 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
553 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
554 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
555 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
556 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
557 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
558 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
559 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
560 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
561 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
562 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
563 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
564 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
565 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
566 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
567 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
568 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
569 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
570 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
571 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
573 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
575 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
576 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
587 std::string __str__() const throw(INTERP_KERNEL::Exception)
589 return self->simpleRepr();
592 PyObject *getTime() throw(INTERP_KERNEL::Exception)
595 double tmp0=self->getTime(tmp1,tmp2);
596 PyObject *res = PyList_New(3);
597 PyList_SetItem(res,0,SWIG_From_int(tmp1));
598 PyList_SetItem(res,1,SWIG_From_int(tmp2));
599 PyList_SetItem(res,2,SWIG_From_double(tmp0));
603 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
606 bool ret0=self->isEqual(other,eps,what);
607 PyObject *res=PyList_New(2);
608 PyObject *ret0Py=ret0?Py_True:Py_False;
610 PyList_SetItem(res,0,ret0Py);
611 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
615 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
617 std::vector<const DataArrayInt *> grps;
618 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
619 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
622 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
625 bool ret0=self->areFamsEqual(other,what);
626 PyObject *res=PyList_New(2);
627 PyObject *ret0Py=ret0?Py_True:Py_False;
629 PyList_SetItem(res,0,ret0Py);
630 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
634 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
637 bool ret0=self->areGrpsEqual(other,what);
638 PyObject *res=PyList_New(2);
639 PyObject *ret0Py=ret0?Py_True:Py_False;
641 PyList_SetItem(res,0,ret0Py);
642 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
646 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
648 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
649 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
650 PyObject *res=PyList_New(result.size());
651 for(int i=0;iL!=result.end(); i++, iL++)
652 PyList_SetItem(res,i,PyInt_FromLong(*iL));
656 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
658 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
659 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
660 PyObject *res=PyList_New(result.size());
661 for(int i=0;iL!=result.end(); i++, iL++)
662 PyList_SetItem(res,i,PyInt_FromLong(*iL));
666 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
668 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
671 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
674 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
676 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
679 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
682 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
684 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
687 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
690 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
692 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
695 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
698 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
701 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
702 PyObject *ret=PyTuple_New(2);
703 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
704 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
708 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
710 DataArrayInt *ret3=0;
711 std::vector<int> ret1,ret2;
712 bool ret0=self->unPolyze(ret1,ret2,ret3);
713 PyObject *ret=PyTuple_New(4);
714 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
716 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
717 for(int j=0;j<(int)ret1.size()/3;j++)
719 PyObject *retLev2=PyList_New(3);
720 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
721 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
722 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
723 PyList_SetItem(retLev1_0,j,retLev2);
725 PyTuple_SetItem(ret,1,retLev1_0);
727 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
728 for(int j=0;j<(int)ret2.size()/3;j++)
730 PyObject *retLev2=PyList_New(3);
731 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
732 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
733 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
734 PyList_SetItem(retLev1_1,j,retLev2);
736 PyTuple_SetItem(ret,2,retLev1_1);
738 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
744 class MEDFileUMesh : public MEDFileMesh
747 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
748 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
749 static MEDFileUMesh *New();
751 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
752 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
754 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
755 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
756 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
757 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
758 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
759 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
760 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
761 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
762 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
763 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
764 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
765 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
766 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
767 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
768 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
769 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
770 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
771 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
772 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
773 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
775 int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
776 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
777 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
778 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
779 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
780 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
781 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
782 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
783 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
784 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
785 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
786 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
787 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
788 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
791 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
793 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
796 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
798 return MEDFileUMesh::New(fileName,mrs);
803 return MEDFileUMesh::New();
807 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
809 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
812 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)
814 std::vector<int> typesCpp1;
815 convertPyToNewIntArr3(types,typesCpp1);
816 std::size_t sz(typesCpp1.size());
817 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
818 for(std::size_t ii=0;ii<sz;ii++)
819 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
820 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
823 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
824 {// put an empty dict in input to say to __new__ to call __init__...
825 PyObject *ret(PyTuple_New(1));
826 PyObject *ret0(PyDict_New());
827 PyTuple_SetItem(ret,0,ret0);
831 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
833 std::vector<double> a0;
835 std::vector<std::string> a2;
836 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
837 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
838 self->serialize(a0,a1,a2,a3,a4);
839 PyObject *ret(PyTuple_New(5));
840 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
841 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
843 PyObject *ret2(PyList_New(sz));
844 for(int i=0;i<sz;i++)
845 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
846 PyTuple_SetItem(ret,2,ret2);
848 PyObject *ret3(PyList_New(sz));
849 for(int i=0;i<sz;i++)
851 DataArrayInt *elt(a3[i]);
854 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
856 PyTuple_SetItem(ret,3,ret3);
857 DataArrayDouble *ret4(a4);
860 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
864 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
866 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
867 if(!PyTuple_Check(inp))
868 throw INTERP_KERNEL::Exception(MSG);
869 int sz(PyTuple_Size(inp));
871 throw INTERP_KERNEL::Exception(MSG);
872 std::vector<double> a0;
874 std::vector<std::string> a2;
875 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
876 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
878 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
880 fillArrayWithPyListDbl3(a0py,tmp,a0);
881 convertPyToNewIntArr3(a1py,a1);
882 fillStringVector(a2py,a2);
884 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
886 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
887 if(!SWIG_IsOK(status))
888 throw INTERP_KERNEL::Exception(MSG);
889 a4=reinterpret_cast<DataArrayDouble *>(argp);
890 if((DataArrayDouble *)a4)
893 std::vector< DataArrayInt * > a3Tmp;
894 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
895 std::size_t sz(a3Tmp.size());
897 for(std::size_t i=0;i<sz;i++)
903 self->unserialize(a0,a1,a2,a3,a4);
907 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
909 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
912 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
915 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
916 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
919 self->setMeshAtLevel(meshDimRelToMax,m0,false);
922 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
925 self->setMeshAtLevel(meshDimRelToMax,m1);
928 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
931 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
933 self->removeMeshAtLevel(meshDimRelToMax);
936 void setMeshes(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->setMeshes(ms,renum);
943 void setGroupsFromScratch(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->setGroupsFromScratch(meshDimRelToMax,ms,renum);
950 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
952 std::vector<const MEDCouplingUMesh *> ms;
953 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
954 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
957 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
959 DataArrayDouble *ret=self->getCoords();
965 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
967 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
970 return const_cast<PartDefinition *>(ret);
973 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
975 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
976 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
977 PyObject *ret=PyTuple_New(3);
978 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
979 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
980 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
984 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
986 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
992 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
994 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
995 std::size_t sz(tmp.size());
996 PyObject *ret=PyList_New(sz);
997 for(std::size_t i=0;i<sz;i++)
1001 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1008 class MEDFileStructuredMesh : public MEDFileMesh
1013 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1015 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1023 class MEDFileCMesh : public MEDFileStructuredMesh
1026 static MEDFileCMesh *New();
1027 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1028 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1029 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1030 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1035 return MEDFileCMesh::New();
1038 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1040 return MEDFileCMesh::New(fileName,mrs);
1043 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1045 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1048 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1050 const MEDCouplingCMesh *tmp=self->getMesh();
1053 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1058 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1061 static MEDFileCurveLinearMesh *New();
1062 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1063 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1064 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1067 MEDFileCurveLinearMesh()
1069 return MEDFileCurveLinearMesh::New();
1072 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1074 return MEDFileCurveLinearMesh::New(fileName,mrs);
1077 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1079 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1082 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1084 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1087 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1092 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1095 static MEDFileMeshMultiTS *New();
1096 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1097 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1098 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1099 std::string getName() const throw(INTERP_KERNEL::Exception);
1100 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1101 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1104 MEDFileMeshMultiTS()
1106 return MEDFileMeshMultiTS::New();
1109 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1111 return MEDFileMeshMultiTS::New(fileName);
1114 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1116 return MEDFileMeshMultiTS::New(fileName,mName);
1119 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1121 MEDFileMesh *ret=self->getOneTimeStep();
1129 class MEDFileMeshesIterator
1134 PyObject *next() throw(INTERP_KERNEL::Exception)
1136 MEDFileMesh *ret=self->nextt();
1140 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1144 PyErr_SetString(PyExc_StopIteration,"No more data.");
1151 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1154 static MEDFileMeshes *New();
1155 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1156 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1157 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1158 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1159 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1161 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1162 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1163 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1164 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1169 return MEDFileMeshes::New();
1172 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1174 return MEDFileMeshes::New(fileName);
1177 std::string __str__() const throw(INTERP_KERNEL::Exception)
1179 return self->simpleRepr();
1182 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1184 if(PyInt_Check(obj))
1186 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1191 else if(PyString_Check(obj))
1193 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1199 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1202 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1204 self->setMeshAtPos(obj,mesh);
1208 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1210 return self->iterator();
1213 int __len__() const throw(INTERP_KERNEL::Exception)
1215 return self->getNumberOfMeshes();
1218 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1220 MEDFileMesh *ret=self->getMeshAtPos(i);
1225 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1227 MEDFileMesh *ret=self->getMeshWithName(mname);
1235 class MEDFileFieldLoc : public RefCountObject
1238 std::string getName() const;
1239 int getDimension() const;
1240 int getNumberOfGaussPoints() const;
1241 int getNumberOfPointsInCells() const;
1242 const std::vector<double>& getRefCoords() const;
1243 const std::vector<double>& getGaussCoords() const;
1244 const std::vector<double>& getGaussWeights() const;
1245 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1248 std::string __str__() const throw(INTERP_KERNEL::Exception)
1250 return self->repr();
1255 class MEDFileFieldGlobsReal
1258 void resetContent();
1259 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1260 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1261 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1262 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1263 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1264 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1265 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1266 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1267 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1268 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1269 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1270 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1271 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1272 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1273 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1274 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1275 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1276 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1277 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1278 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1279 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1280 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1281 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1282 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1283 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1284 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1287 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1289 const DataArrayInt *ret=self->getProfile(pflName);
1292 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1295 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1297 const DataArrayInt *ret=self->getProfileFromId(pflId);
1300 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1303 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1305 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1308 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1311 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1313 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1316 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1319 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1321 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1322 return convertVecPairVecStToPy(ret);
1325 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1327 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1328 return convertVecPairVecStToPy(ret);
1331 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1333 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1334 self->changePflsNames(v);
1337 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1339 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1340 self->changePflsRefsNamesGen(v);
1343 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1345 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1346 self->changePflsNamesInStruct(v);
1349 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1351 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1352 self->changeLocsNames(v);
1355 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1357 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1358 self->changeLocsRefsNamesGen(v);
1361 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1363 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1364 self->changeLocsNamesInStruct(v);
1367 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1369 std::ostringstream oss;
1370 self->simpleReprGlobs(oss);
1376 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1379 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1380 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1381 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1382 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1383 void loadArrays() throw(INTERP_KERNEL::Exception);
1384 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1385 void unloadArrays() throw(INTERP_KERNEL::Exception);
1386 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1387 int getDimension() const throw(INTERP_KERNEL::Exception);
1388 int getIteration() const throw(INTERP_KERNEL::Exception);
1389 int getOrder() const throw(INTERP_KERNEL::Exception);
1390 std::string getName() throw(INTERP_KERNEL::Exception);
1391 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1392 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1393 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1394 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1395 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1396 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1397 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1398 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1399 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1400 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1401 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1402 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1403 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1404 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1405 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1408 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1411 double tmp0=self->getTime(tmp1,tmp2);
1412 PyObject *res = PyList_New(3);
1413 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1414 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1415 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1419 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1421 std::pair<int,int> res=self->getDtIt();
1422 PyObject *elt=PyTuple_New(2);
1423 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1424 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1428 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1430 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1433 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1435 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1438 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1440 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1441 return self->changeMeshNames(modifTab);
1444 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1446 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1447 PyObject *ret2=PyList_New(ret.size());
1448 for(int i=0;i<(int)ret.size();i++)
1449 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1453 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1455 std::vector<int> ret1;
1456 int ret0=self->getNonEmptyLevels(mname,ret1);
1457 PyObject *elt=PyTuple_New(2);
1458 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1459 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1463 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1465 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1466 std::vector< std::vector<TypeOfField> > typesF;
1467 std::vector< std::vector<std::string> > pfls;
1468 std::vector< std::vector<std::string> > locs;
1469 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1471 PyObject *ret2=PyList_New(sz);
1472 for(int i=0;i<sz;i++)
1474 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1475 const std::vector<TypeOfField>& typesFI=typesF[i];
1476 const std::vector<std::string>& pflsI=pfls[i];
1477 const std::vector<std::string>& locsI=locs[i];
1478 PyObject *elt=PyTuple_New(2);
1479 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1480 int sz2=ret[i].size();
1481 PyObject *elt2=PyList_New(sz2);
1482 for(int j=0;j<sz2;j++)
1484 PyObject *elt3=PyTuple_New(4);
1485 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1486 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));
1487 PyTuple_SetItem(elt3,1,elt4);
1488 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1489 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1490 PyList_SetItem(elt2,j,elt3);
1492 PyTuple_SetItem(elt,1,elt2);
1493 PyList_SetItem(ret2,i,elt);
1498 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1500 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1501 std::size_t sz=ret.size();
1502 PyObject *retPy=PyList_New(sz);
1503 for(std::size_t i=0;i<sz;i++)
1504 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1508 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1510 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1511 std::size_t sz=ret.size();
1512 PyObject *retPy=PyList_New(sz);
1513 for(std::size_t i=0;i<sz;i++)
1514 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1518 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1520 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1521 std::size_t sz=ret.size();
1522 PyObject *retPy=PyList_New(sz);
1523 for(std::size_t i=0;i<sz;i++)
1524 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1530 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1533 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1534 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1535 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1536 static MEDFileField1TS *New();
1537 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1538 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1539 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1540 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1541 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1542 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1544 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1545 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1546 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1547 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1550 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1552 return MEDFileField1TS::New(fileName,loadAll);
1555 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1557 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1560 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1562 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1567 return MEDFileField1TS::New();
1570 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1572 const DataArrayDouble *arr=0;
1574 arr=field->getArray();
1575 self->copyTinyInfoFrom(field,arr);
1578 std::string __str__() const throw(INTERP_KERNEL::Exception)
1580 return self->simpleRepr();
1583 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1585 DataArrayInt *ret1=0;
1586 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1587 PyObject *ret=PyTuple_New(2);
1588 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1589 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1593 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1595 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1596 std::vector< std::vector<TypeOfField> > typesF;
1597 std::vector< std::vector<std::string> > pfls;
1598 std::vector< std::vector<std::string> > locs;
1599 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1601 PyObject *ret2=PyList_New(sz);
1602 for(int i=0;i<sz;i++)
1604 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1605 const std::vector<TypeOfField>& typesFI=typesF[i];
1606 const std::vector<std::string>& pflsI=pfls[i];
1607 const std::vector<std::string>& locsI=locs[i];
1608 PyObject *elt=PyTuple_New(2);
1609 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1610 int sz2=ret[i].size();
1611 PyObject *elt2=PyList_New(sz2);
1612 for(int j=0;j<sz2;j++)
1614 PyObject *elt3=PyTuple_New(4);
1615 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1616 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1617 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1618 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1619 PyList_SetItem(elt2,j,elt3);
1621 PyTuple_SetItem(elt,1,elt2);
1622 PyList_SetItem(ret2,i,elt);
1627 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1629 DataArrayDouble *ret=self->getUndergroundDataArray();
1635 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1637 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1638 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1641 PyObject *ret=PyTuple_New(2);
1642 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1643 std::size_t sz=elt1Cpp.size();
1644 PyObject *elt=PyList_New(sz);
1645 for(std::size_t i=0;i<sz;i++)
1647 PyObject *elt1=PyTuple_New(2);
1648 PyObject *elt2=PyTuple_New(2);
1649 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1650 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1651 PyObject *elt3=PyTuple_New(2);
1652 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1653 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1654 PyTuple_SetItem(elt1,0,elt2);
1655 PyTuple_SetItem(elt1,1,elt3);
1656 PyList_SetItem(elt,i,elt1);
1658 PyTuple_SetItem(ret,1,elt);
1664 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1667 static MEDFileIntField1TS *New();
1668 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1669 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1670 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1671 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1673 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1674 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1677 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1679 return MEDFileIntField1TS::New();
1682 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1684 return MEDFileIntField1TS::New(fileName,loadAll);
1687 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1689 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1692 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1694 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1697 std::string __str__() const throw(INTERP_KERNEL::Exception)
1699 return self->simpleRepr();
1702 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1704 DataArrayInt *ret1=0;
1705 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1706 PyObject *ret=PyTuple_New(2);
1707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1708 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1712 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1714 DataArrayInt *ret1=0;
1715 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1716 PyObject *ret=PyTuple_New(2);
1717 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1718 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1722 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1724 DataArrayInt *ret1=0;
1725 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1726 PyObject *ret=PyTuple_New(2);
1727 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1728 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1732 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1734 DataArrayInt *ret1=0;
1735 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1736 PyObject *ret=PyTuple_New(2);
1737 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1738 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1742 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1744 DataArrayInt *ret1=0;
1745 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1746 PyObject *ret=PyTuple_New(2);
1747 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1748 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1752 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1754 DataArrayInt *ret1=0;
1755 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1756 PyObject *ret=PyTuple_New(2);
1757 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1758 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1762 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1764 DataArrayInt *ret=self->getUndergroundDataArray();
1772 class MEDFileAnyTypeFieldMultiTSIterator
1777 PyObject *next() throw(INTERP_KERNEL::Exception)
1779 MEDFileAnyTypeField1TS *ret=self->nextt();
1781 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1784 PyErr_SetString(PyExc_StopIteration,"No more data.");
1791 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1794 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1795 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1796 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1797 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1798 std::string getName() const throw(INTERP_KERNEL::Exception);
1799 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1800 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1801 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1802 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1803 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1804 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1805 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1806 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1807 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1808 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1809 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1810 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1811 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1812 void loadArrays() throw(INTERP_KERNEL::Exception);
1813 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1814 void unloadArrays() throw(INTERP_KERNEL::Exception);
1815 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1817 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1818 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1819 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1820 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1821 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1824 int __len__() const throw(INTERP_KERNEL::Exception)
1826 return self->getNumberOfTS();
1829 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1831 if(elt0 && PyInt_Check(elt0))
1833 int pos=PyInt_AS_LONG(elt0);
1836 else if(elt0 && PyTuple_Check(elt0))
1838 if(PyTuple_Size(elt0)==2)
1840 PyObject *o0=PyTuple_GetItem(elt0,0);
1841 PyObject *o1=PyTuple_GetItem(elt0,1);
1842 if(PyInt_Check(o0) && PyInt_Check(o1))
1844 int iter=PyInt_AS_LONG(o0);
1845 int order=PyInt_AS_LONG(o1);
1846 return self->getPosOfTimeStep(iter,order);
1849 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 !");
1852 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 !");
1854 else if(elt0 && PyFloat_Check(elt0))
1856 double val=PyFloat_AS_DOUBLE(elt0);
1857 return self->getPosGivenTime(val);
1860 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1863 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1865 std::vector< std::pair<int,int> > res=self->getIterations();
1866 PyObject *ret=PyList_New(res.size());
1868 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1870 PyObject *elt=PyTuple_New(2);
1871 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1872 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1873 PyList_SetItem(ret,rk,elt);
1878 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1880 std::vector<double> ret1;
1881 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1882 std::size_t sz=ret.size();
1883 PyObject *ret2=PyList_New(sz);
1884 for(std::size_t i=0;i<sz;i++)
1886 PyObject *elt=PyTuple_New(3);
1887 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1888 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1889 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1890 PyList_SetItem(ret2,i,elt);
1895 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1897 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1898 PyObject *ret2=PyList_New(ret.size());
1899 for(int i=0;i<(int)ret.size();i++)
1901 const std::vector<TypeOfField>& rett=ret[i];
1902 PyObject *ret3=PyList_New(rett.size());
1903 for(int j=0;j<(int)rett.size();j++)
1904 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1905 PyList_SetItem(ret2,i,ret3);
1910 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1912 std::vector<int> ret1;
1913 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1914 PyObject *elt=PyTuple_New(2);
1915 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1916 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1920 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1922 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1923 std::vector< std::vector<TypeOfField> > typesF;
1924 std::vector< std::vector<std::string> > pfls;
1925 std::vector< std::vector<std::string> > locs;
1926 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1928 PyObject *ret2=PyList_New(sz);
1929 for(int i=0;i<sz;i++)
1931 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1932 const std::vector<TypeOfField>& typesFI=typesF[i];
1933 const std::vector<std::string>& pflsI=pfls[i];
1934 const std::vector<std::string>& locsI=locs[i];
1935 PyObject *elt=PyTuple_New(2);
1936 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1937 int sz2=ret[i].size();
1938 PyObject *elt2=PyList_New(sz2);
1939 for(int j=0;j<sz2;j++)
1941 PyObject *elt3=PyTuple_New(4);
1942 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1943 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));
1944 PyTuple_SetItem(elt3,1,elt4);
1945 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1946 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1947 PyList_SetItem(elt2,j,elt3);
1949 PyTuple_SetItem(elt,1,elt2);
1950 PyList_SetItem(ret2,i,elt);
1955 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1957 if(PyList_Check(elts))
1959 int sz=PyList_Size(elts);
1960 std::vector<int> ret(sz);
1961 for(int i=0;i<sz;i++)
1963 PyObject *elt=PyList_GetItem(elts,i);
1964 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1970 std::vector<int> ret(1);
1971 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1976 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1978 if(PySlice_Check(elts))
1980 Py_ssize_t strt=2,stp=2,step=2;
1981 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1982 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1983 self->eraseTimeStepIds2(strt,stp,step);
1987 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1988 if(!idsToRemove.empty())
1989 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1993 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1997 std::vector<int> pos2;
1998 DataArrayInt *pos3=0;
1999 DataArrayIntTuple *pos4=0;
2000 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2005 self->eraseTimeStepIds(&pos1,&pos1+1);
2012 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2017 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2021 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2025 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2027 return self->iterator();
2030 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2032 if(elt0 && PyList_Check(elt0))
2034 int sz=PyList_Size(elt0);
2035 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2036 int *pt=da->getPointer();
2037 for(int i=0;i<sz;i++,pt++)
2039 PyObject *elt1=PyList_GetItem(elt0,i);
2040 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2042 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2044 else if(elt0 && PySlice_Check(elt0))
2046 Py_ssize_t strt=2,stp=2,step=2;
2047 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2048 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2049 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2052 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2055 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2057 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2058 return self->changeMeshNames(modifTab);
2061 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2063 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2064 std::size_t sz=ret.size();
2065 PyObject *retPy=PyList_New(sz);
2066 for(std::size_t i=0;i<sz;i++)
2067 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2071 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2073 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2074 std::size_t sz=ret.size();
2075 PyObject *retPy=PyList_New(sz);
2076 for(std::size_t i=0;i<sz;i++)
2077 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2081 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2083 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2084 std::size_t sz=ret.size();
2085 PyObject *retPy=PyList_New(sz);
2086 for(std::size_t i=0;i<sz;i++)
2087 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2091 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2093 std::vector<MEDFileAnyTypeField1TS *> tmp;
2094 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2095 self->pushBackTimeSteps(tmp);
2098 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2100 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2101 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2102 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2103 std::size_t sz=ret.size();
2104 PyObject *retPy=PyList_New(sz);
2105 for(std::size_t i=0;i<sz;i++)
2107 std::size_t sz2=ret[i].size();
2108 PyObject *ret1Py=PyList_New(sz2);
2109 for(std::size_t j=0;j<sz2;j++)
2111 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2114 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2116 PyList_SetItem(retPy,i,ret1Py);
2121 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2123 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2124 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2125 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2126 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2127 if(ret2.size()!=ret.size())
2129 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2130 throw INTERP_KERNEL::Exception(oss.str().c_str());
2132 std::size_t sz=ret.size();
2133 PyObject *retPy=PyList_New(sz);
2134 for(std::size_t i=0;i<sz;i++)
2136 std::size_t sz2=ret[i].size();
2137 PyObject *ret0Py=PyTuple_New(2);
2138 PyObject *ret1Py=PyList_New(sz2);
2139 for(std::size_t j=0;j<sz2;j++)
2141 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2144 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2146 PyTuple_SetItem(ret0Py,0,ret1Py);
2147 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2148 PyList_SetItem(retPy,i,ret0Py);
2155 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2158 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2159 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2160 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2162 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2163 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2164 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2165 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2166 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2168 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2169 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2170 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2173 MEDFileFieldMultiTS()
2175 return MEDFileFieldMultiTS::New();
2178 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2180 return MEDFileFieldMultiTS::New(fileName,loadAll);
2183 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2185 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2188 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2190 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2191 std::size_t sz(tmp.size());
2192 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2193 for(std::size_t i=0;i<sz;i++)
2195 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2196 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2198 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2201 std::string __str__() const throw(INTERP_KERNEL::Exception)
2203 return self->simpleRepr();
2206 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2208 DataArrayInt *ret1=0;
2209 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2210 PyObject *ret=PyTuple_New(2);
2211 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2212 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2218 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2219 std::vector< std::vector<TypeOfField> > typesF;
2220 std::vector< std::vector<std::string> > pfls;
2221 std::vector< std::vector<std::string> > locs;
2222 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2224 PyObject *ret2=PyList_New(sz);
2225 for(int i=0;i<sz;i++)
2227 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2228 const std::vector<TypeOfField>& typesFI=typesF[i];
2229 const std::vector<std::string>& pflsI=pfls[i];
2230 const std::vector<std::string>& locsI=locs[i];
2231 PyObject *elt=PyTuple_New(2);
2232 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2233 int sz2=ret[i].size();
2234 PyObject *elt2=PyList_New(sz2);
2235 for(int j=0;j<sz2;j++)
2237 PyObject *elt3=PyTuple_New(4);
2238 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2239 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2240 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2241 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2242 PyList_SetItem(elt2,j,elt3);
2244 PyTuple_SetItem(elt,1,elt2);
2245 PyList_SetItem(ret2,i,elt);
2249 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2251 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2257 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2259 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2260 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2263 PyObject *ret=PyTuple_New(2);
2264 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2265 std::size_t sz=elt1Cpp.size();
2266 PyObject *elt=PyList_New(sz);
2267 for(std::size_t i=0;i<sz;i++)
2269 PyObject *elt1=PyTuple_New(2);
2270 PyObject *elt2=PyTuple_New(2);
2271 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2272 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2273 PyObject *elt3=PyTuple_New(2);
2274 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2275 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2276 PyTuple_SetItem(elt1,0,elt2);
2277 PyTuple_SetItem(elt1,1,elt3);
2278 PyList_SetItem(elt,i,elt1);
2280 PyTuple_SetItem(ret,1,elt);
2286 class MEDFileFieldsIterator
2291 PyObject *next() throw(INTERP_KERNEL::Exception)
2293 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2295 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2298 PyErr_SetString(PyExc_StopIteration,"No more data.");
2305 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2308 static MEDFileIntFieldMultiTS *New();
2309 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2310 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2312 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2313 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2314 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2317 MEDFileIntFieldMultiTS()
2319 return MEDFileIntFieldMultiTS::New();
2322 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2324 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2327 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2329 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2332 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2334 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2335 std::size_t sz(tmp.size());
2336 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2337 for(std::size_t i=0;i<sz;i++)
2339 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2340 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2342 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2345 std::string __str__() const throw(INTERP_KERNEL::Exception)
2347 return self->simpleRepr();
2350 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2352 DataArrayInt *ret1=0;
2353 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2354 PyObject *ret=PyTuple_New(2);
2355 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2356 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2360 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2362 DataArrayInt *ret1=0;
2363 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2364 PyObject *ret=PyTuple_New(2);
2365 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2366 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2370 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2372 DataArrayInt *ret1=0;
2373 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2374 PyObject *ret=PyTuple_New(2);
2375 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2376 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2380 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2382 DataArrayInt *ret1=0;
2383 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2384 PyObject *ret=PyTuple_New(2);
2385 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2386 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2390 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2392 DataArrayInt *ret1=0;
2393 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2394 PyObject *ret=PyTuple_New(2);
2395 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2396 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2400 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2402 DataArrayInt *ret1=0;
2403 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2404 PyObject *ret=PyTuple_New(2);
2405 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2406 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2410 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2412 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2420 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2423 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2424 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2425 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2426 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2427 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2428 void loadArrays() throw(INTERP_KERNEL::Exception);
2429 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2430 void unloadArrays() throw(INTERP_KERNEL::Exception);
2431 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2432 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2433 int getNumberOfFields() const;
2434 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2435 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2437 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2438 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2439 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2440 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2441 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2442 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2443 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2444 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2445 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2450 return MEDFileFields::New();
2453 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2455 return MEDFileFields::New(fileName,loadAll);
2458 std::string __str__() const throw(INTERP_KERNEL::Exception)
2460 return self->simpleRepr();
2463 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2465 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2466 std::size_t sz(tmp.size());
2467 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2468 for(std::size_t i=0;i<sz;i++)
2470 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2471 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2473 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2476 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2479 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2480 PyObject *ret=PyTuple_New(2);
2481 PyObject *ret_0=PyList_New(ret0.size());
2483 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2485 PyObject *elt=PyTuple_New(2);
2486 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2487 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2488 PyList_SetItem(ret_0,rk,elt);
2490 PyTuple_SetItem(ret,0,ret_0);
2491 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2492 PyTuple_SetItem(ret,1,ret_1);
2496 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2498 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2499 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2502 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2504 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2505 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2508 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2510 if(obj && PyList_Check(obj))
2512 int sz=PyList_Size(obj);
2513 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2514 int *pt=da->getPointer();
2515 for(int i=0;i<sz;i++,pt++)
2517 PyObject *elt1=PyList_GetItem(obj,i);
2518 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2520 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2523 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2526 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2528 self->setFieldAtPos(obj,field);
2532 int __len__() const throw(INTERP_KERNEL::Exception)
2534 return self->getNumberOfFields();
2537 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2539 return self->iterator();
2542 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2544 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2545 return self->changeMeshNames(modifTab);
2548 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2550 if(elt0 && PyInt_Check(elt0))
2552 return PyInt_AS_LONG(elt0);
2554 else if(elt0 && PyString_Check(elt0))
2555 return self->getPosFromFieldName(PyString_AsString(elt0));
2557 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2560 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2562 if(PyList_Check(elts))
2564 int sz=PyList_Size(elts);
2565 std::vector<int> ret(sz);
2566 for(int i=0;i<sz;i++)
2568 PyObject *elt=PyList_GetItem(elts,i);
2569 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2575 std::vector<int> ret(1);
2576 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2581 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2583 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2584 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2585 self->pushFields(tmp);
2588 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2590 if(elts && PySlice_Check(elts))
2592 Py_ssize_t strt=2,stp=2,step=2;
2593 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2594 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2595 self->destroyFieldsAtPos2(strt,stp,step);
2599 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2600 if(!idsToRemove.empty())
2601 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2607 class MEDFileParameter1TS : public RefCountObject
2610 void setIteration(int it);
2611 int getIteration() const;
2612 void setOrder(int order);
2613 int getOrder() const;
2614 void setTimeValue(double time);
2615 void setTime(int dt, int it, double time);
2616 double getTime(int& dt, int& it);
2617 double getTimeValue() const;
2620 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2623 void setValue(double val) throw(INTERP_KERNEL::Exception);
2624 double getValue() const throw(INTERP_KERNEL::Exception);
2625 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2628 std::string __str__() const throw(INTERP_KERNEL::Exception)
2630 return self->simpleRepr();
2635 class MEDFileParameterTinyInfo : public MEDFileWritable
2638 void setDescription(const std::string& name);
2639 std::string getDescription() const;
2640 void setTimeUnit(const std::string& unit);
2641 std::string getTimeUnit() const;
2644 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2647 static MEDFileParameterDouble1TS *New();
2648 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2649 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2650 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2651 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2652 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2653 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2654 std::string getName() const throw(INTERP_KERNEL::Exception);
2655 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2658 MEDFileParameterDouble1TS()
2660 return MEDFileParameterDouble1TS::New();
2663 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2665 return MEDFileParameterDouble1TS::New(fileName);
2668 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2670 return MEDFileParameterDouble1TS::New(fileName,paramName);
2673 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2675 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2678 std::string __str__() const throw(INTERP_KERNEL::Exception)
2680 return self->simpleRepr();
2683 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2686 bool ret0=self->isEqual(other,eps,what);
2687 PyObject *res=PyList_New(2);
2688 PyObject *ret0Py=ret0?Py_True:Py_False;
2690 PyList_SetItem(res,0,ret0Py);
2691 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2697 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2700 static MEDFileParameterMultiTS *New();
2701 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2702 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2703 std::string getName() const;
2704 void setName(const std::string& name);
2705 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2706 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2707 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2708 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2709 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2710 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2711 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2712 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2715 MEDFileParameterMultiTS()
2717 return MEDFileParameterMultiTS::New();
2720 MEDFileParameterMultiTS(const std::string& fileName)
2722 return MEDFileParameterMultiTS::New(fileName);
2725 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2727 return MEDFileParameterMultiTS::New(fileName,paramName);
2730 std::string __str__() const throw(INTERP_KERNEL::Exception)
2732 return self->simpleRepr();
2735 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2738 bool ret0=self->isEqual(other,eps,what);
2739 PyObject *res=PyList_New(2);
2740 PyObject *ret0Py=ret0?Py_True:Py_False;
2742 PyList_SetItem(res,0,ret0Py);
2743 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2747 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2751 std::vector<int> pos2;
2752 DataArrayInt *pos3=0;
2753 DataArrayIntTuple *pos4=0;
2754 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2759 self->eraseTimeStepIds(&pos1,&pos1+1);
2766 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2771 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2775 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2779 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2781 if(elt0 && PyInt_Check(elt0))
2783 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2786 else if(elt0 && PyTuple_Check(elt0))
2788 if(PyTuple_Size(elt0)==2)
2790 PyObject *o0=PyTuple_GetItem(elt0,0);
2791 PyObject *o1=PyTuple_GetItem(elt0,1);
2792 if(PyInt_Check(o0) && PyInt_Check(o1))
2794 int iter=PyInt_AS_LONG(o0);
2795 int order=PyInt_AS_LONG(o1);
2796 return self->getPosOfTimeStep(iter,order);
2799 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 !");
2802 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 !");
2804 else if(elt0 && PyFloat_Check(elt0))
2806 double val=PyFloat_AS_DOUBLE(elt0);
2807 return self->getPosGivenTime(val);
2810 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2813 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2815 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2821 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2823 if(PyList_Check(elts))
2825 int sz=PyList_Size(elts);
2826 std::vector<int> ret(sz);
2827 for(int i=0;i<sz;i++)
2829 PyObject *elt=PyList_GetItem(elts,i);
2830 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2836 std::vector<int> ret(1);
2837 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2842 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2844 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2845 if(!idsToRemove.empty())
2846 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2849 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2851 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2857 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2859 std::vector< std::pair<int,int> > res=self->getIterations();
2860 PyObject *ret=PyList_New(res.size());
2862 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2864 PyObject *elt=PyTuple_New(2);
2865 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2866 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2867 PyList_SetItem(ret,rk,elt);
2872 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2874 std::vector<double> res2;
2875 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2876 PyObject *ret=PyList_New(res.size());
2878 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2880 PyObject *elt=PyTuple_New(3);
2881 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2882 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2883 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2884 PyList_SetItem(ret,rk,elt);
2891 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2894 static MEDFileParameters *New();
2895 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2896 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2897 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2898 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2899 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2900 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2901 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2902 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2903 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2904 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2905 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2910 return MEDFileParameters::New();
2913 MEDFileParameters(const std::string& fileName)
2915 return MEDFileParameters::New(fileName);
2918 std::string __str__() const throw(INTERP_KERNEL::Exception)
2920 return self->simpleRepr();
2923 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2925 if(PyInt_Check(obj))
2927 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2932 else if(PyString_Check(obj))
2934 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2940 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2943 int __len__() const throw(INTERP_KERNEL::Exception)
2945 return self->getNumberOfParams();
2948 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2950 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2956 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2958 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2964 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2967 bool ret0=self->isEqual(other,eps,what);
2968 PyObject *res=PyList_New(2);
2969 PyObject *ret0Py=ret0?Py_True:Py_False;
2971 PyList_SetItem(res,0,ret0Py);
2972 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2978 class MEDFileData : public RefCountObject, public MEDFileWritable
2981 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2982 static MEDFileData *New();
2983 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2984 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2985 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2986 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2987 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2988 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2989 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2991 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2992 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2994 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2997 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2999 return MEDFileData::New(fileName);
3004 return MEDFileData::New();
3007 std::string __str__() const throw(INTERP_KERNEL::Exception)
3009 return self->simpleRepr();
3012 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3014 MEDFileMeshes *ret=self->getMeshes();
3020 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3022 MEDFileParameters *ret=self->getParams();
3028 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3030 MEDFileFields *ret=self->getFields();
3036 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3038 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3039 return self->changeMeshNames(modifTab);
3044 class SauvReader : public RefCountObject
3047 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3048 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3051 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3053 return SauvReader::New(fileName);
3058 class SauvWriter : public RefCountObject
3061 static SauvWriter * New();
3062 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3063 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3064 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3065 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3068 SauvWriter() throw(INTERP_KERNEL::Exception)
3070 return SauvWriter::New();
3077 class MEDFileMeshStruct;
3079 class MEDFileField1TSStructItem
3082 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3085 class MEDFileMeshStruct : public RefCountObject
3088 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3090 ~MEDFileMeshStruct();
3093 class MEDMeshMultiLev : public RefCountObject
3096 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3097 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3103 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3105 DataArrayInt *famIds(0);
3106 bool isWithoutCopy(false);
3107 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3108 PyObject *ret=PyTuple_New(2);
3109 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3111 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3112 PyTuple_SetItem(ret,1,ret1Py);
3116 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3118 DataArrayInt *numIds(0);
3119 bool isWithoutCopy(false);
3120 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3121 PyObject *ret=PyTuple_New(2);
3122 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3124 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3125 PyTuple_SetItem(ret,1,ret1Py);
3129 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3131 DataArrayInt *famIds(0);
3132 bool isWithoutCopy(false);
3133 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3134 PyObject *ret=PyTuple_New(2);
3135 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3137 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3138 PyTuple_SetItem(ret,1,ret1Py);
3142 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3144 DataArrayInt *numIds(0);
3145 bool isWithoutCopy(false);
3146 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3147 PyObject *ret=PyTuple_New(2);
3148 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3150 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3151 PyTuple_SetItem(ret,1,ret1Py);
3155 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3157 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3158 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3159 PyObject *res(PyList_New(result.size()));
3160 for(int i=0;iL!=result.end(); i++, iL++)
3161 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3167 class MEDUMeshMultiLev : public MEDMeshMultiLev
3170 ~MEDUMeshMultiLev();
3174 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3176 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3177 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3178 PyObject *ret0Py=ncc?Py_True:Py_False;
3180 PyObject *ret=PyTuple_New(7);
3181 PyTuple_SetItem(ret,0,ret0Py);
3182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3183 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3184 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3185 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3186 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3187 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3193 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3196 ~MEDStructuredMeshMultiLev();
3199 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3202 ~MEDCMeshMultiLev();
3206 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3209 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3210 std::size_t sz(objs.size());
3211 PyObject *ret(PyTuple_New(2));
3212 PyObject *ret0=PyList_New(sz);
3213 for(std::size_t i=0;i<sz;i++)
3214 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3215 PyTuple_SetItem(ret,0,ret0);
3216 PyObject *ret1Py(isInternal?Py_True:Py_False);
3218 PyTuple_SetItem(ret,1,ret1Py);
3224 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3227 ~MEDCurveLinearMeshMultiLev();
3231 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3233 DataArrayDouble *ret0(0);
3234 std::vector<int> ret1;
3236 self->buildVTUArrays(ret0,ret1,ret2);
3237 std::size_t sz(ret1.size());
3238 PyObject *ret=PyTuple_New(3);
3239 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3240 PyObject *ret1Py=PyList_New(sz);
3241 for(std::size_t i=0;i<sz;i++)
3242 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3243 PyTuple_SetItem(ret,1,ret1Py);
3244 PyObject *ret2Py(ret2?Py_True:Py_False);
3246 PyTuple_SetItem(ret,2,ret2Py);
3252 class MEDFileFastCellSupportComparator : public RefCountObject
3255 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3256 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3257 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3258 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3260 ~MEDFileFastCellSupportComparator();
3264 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3266 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3267 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3268 PyObject *res(PyList_New(result.size()));
3269 for(int i=0;iL!=result.end(); i++, iL++)
3270 PyList_SetItem(res,i,PyInt_FromLong(*iL));