1 // Copyright (C) 2007-2013 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.
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::MEDFileUMesh::New;
97 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
98 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
99 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
100 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
101 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
102 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
103 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
104 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
105 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
109 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
110 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
111 %newobject ParaMEDMEM::MEDFileCMesh::New;
112 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
113 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
114 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
115 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
116 %newobject ParaMEDMEM::MEDFileMeshes::New;
117 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
118 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
119 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
120 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
121 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
123 %newobject ParaMEDMEM::MEDFileFields::New;
124 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
125 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
126 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
127 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
128 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
129 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
130 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
131 %newobject ParaMEDMEM::MEDFileFields::__iter__;
133 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
134 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
135 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
136 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
137 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
138 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
140 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
141 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
142 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
143 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
144 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
145 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
147 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
148 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
149 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
151 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
152 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
153 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
154 %newobject ParaMEDMEM::MEDFileField1TS::New;
155 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
156 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
157 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
158 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
159 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
160 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
161 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
162 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
163 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
165 %newobject ParaMEDMEM::MEDFileData::New;
166 %newobject ParaMEDMEM::MEDFileData::deepCpy;
167 %newobject ParaMEDMEM::MEDFileData::getMeshes;
168 %newobject ParaMEDMEM::MEDFileData::getFields;
169 %newobject ParaMEDMEM::MEDFileData::getParams;
171 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
172 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
173 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
174 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
175 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
176 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
177 %newobject ParaMEDMEM::MEDFileParameters::New;
178 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
179 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
180 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
181 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
183 %newobject ParaMEDMEM::SauvWriter::New;
184 %newobject ParaMEDMEM::SauvReader::New;
185 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
187 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
188 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
189 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
190 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
191 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
193 %feature("unref") MEDFileMesh "$this->decrRef();"
194 %feature("unref") MEDFileUMesh "$this->decrRef();"
195 %feature("unref") MEDFileCMesh "$this->decrRef();"
196 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
197 %feature("unref") MEDFileMeshes "$this->decrRef();"
198 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
199 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
200 %feature("unref") MEDFileField1TS "$this->decrRef();"
201 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
202 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
203 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
204 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
205 %feature("unref") MEDFileFields "$this->decrRef();"
206 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
207 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
208 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
209 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
210 %feature("unref") MEDFileParameters "$this->decrRef();"
211 %feature("unref") MEDFileData "$this->decrRef();"
212 %feature("unref") SauvReader "$this->decrRef();"
213 %feature("unref") SauvWriter "$this->decrRef();"
214 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
215 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
216 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
217 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
218 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
219 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
224 static bool HasXDR();
225 static std::string MEDFileVersionStr();
226 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
227 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
228 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
229 static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
230 static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
231 static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
241 static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
244 static PyObject *MEDFileVersion()
246 int major,minor,release;
247 MEDLoader::MEDFileVersion(major,minor,release);
248 PyObject *ret(PyTuple_New(3));
249 PyTuple_SetItem(ret,0,SWIG_From_int(major));
250 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
251 PyTuple_SetItem(ret,2,SWIG_From_int(release));
255 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
257 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
258 PyObject *ret=PyList_New(res.size());
260 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
262 PyObject *elt=PyTuple_New(2);
263 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
264 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
265 PyList_SetItem(ret,rk,elt);
270 static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
272 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
273 PyObject *ret=PyList_New(res.size());
275 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
277 PyObject *elt=PyTuple_New(3);
278 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
279 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
280 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
281 PyList_SetItem(ret,rk,elt);
286 static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
288 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
289 PyObject *ret=PyList_New(res.size());
291 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
293 PyObject *elt=PyTuple_New(2);
294 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
295 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
296 PyList_SetItem(ret,rk,elt);
300 static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
302 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
303 PyObject *ret=PyList_New(res.size());
305 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
307 PyObject *elt=PyTuple_New(2);
308 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
309 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
310 PyList_SetItem(ret,rk,elt);
314 static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
316 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
317 PyObject *ret=PyList_New(res.size());
319 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
321 PyObject *elt=PyTuple_New(2);
322 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
323 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
324 PyList_SetItem(ret,rk,elt);
328 static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
330 int meshDim,spaceDim,numberOfNodes;
331 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
332 PyObject *ret=PyTuple_New(4);
333 PyObject *elt0=PyList_New(res.size());
335 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
337 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
339 PyObject *elt1=PyList_New(obj2.size());
340 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
342 PyObject *elt2=PyTuple_New(2);
343 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
344 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
345 PyList_SetItem(elt1,j,elt2);
347 PyList_SetItem(elt0,i,elt1);
349 PyTuple_SetItem(ret,0,elt0);
350 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
351 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
352 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
355 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
356 const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
358 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
359 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
360 return convertFieldDoubleVecToPy(res);
362 static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
364 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
365 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
366 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
368 static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
370 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
371 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
372 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
374 static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
376 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
377 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
378 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
380 static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
382 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
384 PyObject *ret=PyList_New(size);
385 for(int i=0;i<size;i++)
386 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
389 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
391 std::vector<std::string> grps;
392 converPyListToVecString(li,grps);
393 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
395 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
397 std::vector<std::string> fams;
398 converPyListToVecString(li,fams);
399 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
402 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
403 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
404 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
405 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
406 static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
407 static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
408 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
409 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
410 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
411 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
412 static void WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
413 static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
414 static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
415 static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
416 static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
417 static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
422 class MEDFileWritable
425 void copyOptionsFrom(const MEDFileWritable& other) const;
426 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
427 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
428 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
429 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
432 class MEDFileMeshReadSelector
435 MEDFileMeshReadSelector();
436 MEDFileMeshReadSelector(unsigned int code);
437 unsigned int getCode() const;
438 void setCode(unsigned int newCode);
439 bool isCellFamilyFieldReading() const;
440 bool isNodeFamilyFieldReading() const;
441 bool isCellNameFieldReading() const;
442 bool isNodeNameFieldReading() const;
443 bool isCellNumFieldReading() const;
444 bool isNodeNumFieldReading() const;
445 void setCellFamilyFieldReading(bool b);
446 void setNodeFamilyFieldReading(bool b);
447 void setCellNameFieldReading(bool b);
448 void setNodeNameFieldReading(bool b);
449 void setCellNumFieldReading(bool b);
450 void setNodeNumFieldReading(bool b);
453 std::string __str__() const throw(INTERP_KERNEL::Exception)
455 std::ostringstream oss;
460 std::string __repr__() const throw(INTERP_KERNEL::Exception)
462 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
468 class MEDFileMesh : public RefCountObject, public MEDFileWritable
471 static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
472 static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
473 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
474 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
475 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
476 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
477 void setName(const char *name);
478 std::string getName();
479 const char *getUnivName() const;
480 bool getUnivNameWrStatus() const;
481 void setUnivNameWrStatus(bool newStatus);
482 void setDescription(const char *name);
483 std::string getDescription() const;
484 void setOrder(int order);
485 int getOrder() const;
486 void setIteration(int it);
488 void setTimeValue(double time);
489 void setTime(int dt, int it, double time);
490 double getTimeValue() const;
491 void setTimeUnit(const char *unit);
492 const char *getTimeUnit() const;
493 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
494 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
495 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
496 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
497 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
498 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
499 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
500 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
501 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
503 bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
504 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
505 bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
506 void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
507 void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
508 void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
509 void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
510 virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
511 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
512 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
513 void clearGrpMap() throw(INTERP_KERNEL::Exception);
514 void clearFamMap() throw(INTERP_KERNEL::Exception);
515 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
516 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
517 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
518 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
519 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
520 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
521 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
522 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
523 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
524 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
525 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
526 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
527 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
528 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
529 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
530 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
531 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
532 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
533 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
534 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
535 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
536 void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
537 void setFamilyInfo(const std::map<std::string,int>& info);
538 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
539 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
540 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
541 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
542 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
543 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
544 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
545 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
546 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
547 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
548 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
549 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
550 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
551 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
552 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
553 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
554 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
555 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
556 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
557 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
558 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
560 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
561 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
562 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
563 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
564 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
565 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
569 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
570 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
571 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 std::string __str__() const throw(INTERP_KERNEL::Exception)
576 return self->simpleRepr();
579 PyObject *getTime() throw(INTERP_KERNEL::Exception)
582 double tmp0=self->getTime(tmp1,tmp2);
583 PyObject *res = PyList_New(3);
584 PyList_SetItem(res,0,SWIG_From_int(tmp1));
585 PyList_SetItem(res,1,SWIG_From_int(tmp2));
586 PyList_SetItem(res,2,SWIG_From_double(tmp0));
590 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
593 bool ret0=self->isEqual(other,eps,what);
594 PyObject *res=PyList_New(2);
595 PyObject *ret0Py=ret0?Py_True:Py_False;
597 PyList_SetItem(res,0,ret0Py);
598 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
602 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
605 bool ret0=self->areFamsEqual(other,what);
606 PyObject *res=PyList_New(2);
607 PyObject *ret0Py=ret0?Py_True:Py_False;
609 PyList_SetItem(res,0,ret0Py);
610 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
614 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
617 bool ret0=self->areGrpsEqual(other,what);
618 PyObject *res=PyList_New(2);
619 PyObject *ret0Py=ret0?Py_True:Py_False;
621 PyList_SetItem(res,0,ret0Py);
622 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
626 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
628 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
631 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
634 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
636 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
639 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
642 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
644 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
647 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
650 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
653 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
654 PyObject *ret=PyTuple_New(2);
655 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
656 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
660 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
662 DataArrayInt *ret3=0;
663 std::vector<int> ret1,ret2;
664 bool ret0=self->unPolyze(ret1,ret2,ret3);
665 PyObject *ret=PyTuple_New(4);
666 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
668 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
669 for(int j=0;j<(int)ret1.size()/3;j++)
671 PyObject *retLev2=PyList_New(3);
672 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
673 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
674 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
675 PyList_SetItem(retLev1_0,j,retLev2);
677 PyTuple_SetItem(ret,1,retLev1_0);
679 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
680 for(int j=0;j<(int)ret2.size()/3;j++)
682 PyObject *retLev2=PyList_New(3);
683 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
684 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
685 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
686 PyList_SetItem(retLev1_1,j,retLev2);
688 PyTuple_SetItem(ret,2,retLev1_1);
690 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
696 class MEDFileUMesh : public MEDFileMesh
699 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
700 static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
701 static MEDFileUMesh *New();
703 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
705 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
706 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
707 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
708 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
709 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
710 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
711 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
712 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
713 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
714 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
715 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
716 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
717 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
718 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
719 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
720 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
721 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
722 DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
723 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
724 DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
725 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
726 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
727 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
728 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
729 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
730 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
732 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
733 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
734 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
735 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
736 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
737 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
738 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
739 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
740 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
741 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
742 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
743 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
746 MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
748 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
751 MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
753 return MEDFileUMesh::New(fileName,mrs);
758 return MEDFileUMesh::New();
761 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
763 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
764 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
765 PyObject *res=PyList_New(result.size());
766 for(int i=0;iL!=result.end(); i++, iL++)
767 PyList_SetItem(res,i,PyInt_FromLong(*iL));
771 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
773 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
776 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
779 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
781 std::vector<const DataArrayInt *> grps;
782 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
783 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
786 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
788 std::vector<const MEDCouplingUMesh *> ms;
789 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
790 self->setMeshes(ms,renum);
793 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
795 std::vector<const MEDCouplingUMesh *> ms;
796 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
797 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
800 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
802 std::vector<const MEDCouplingUMesh *> ms;
803 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
804 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
807 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
809 DataArrayDouble *ret=self->getCoords();
815 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
817 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
818 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
819 PyObject *ret=PyTuple_New(3);
820 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
821 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
822 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
826 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
828 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
834 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
836 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
837 std::size_t sz(tmp.size());
838 PyObject *ret=PyList_New(sz);
839 for(std::size_t i=0;i<sz;i++)
843 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
850 class MEDFileStructuredMesh : public MEDFileMesh
854 class MEDFileCMesh : public MEDFileStructuredMesh
857 static MEDFileCMesh *New();
858 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
859 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
860 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
865 return MEDFileCMesh::New();
868 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
870 return MEDFileCMesh::New(fileName,mrs);
873 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
875 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
878 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
880 const MEDCouplingCMesh *tmp=self->getMesh();
883 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
888 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
891 static MEDFileCurveLinearMesh *New();
892 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
893 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
894 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
897 MEDFileCurveLinearMesh()
899 return MEDFileCurveLinearMesh::New();
902 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
904 return MEDFileCurveLinearMesh::New(fileName,mrs);
907 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
909 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
912 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
914 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
917 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
922 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
925 static MEDFileMeshMultiTS *New();
926 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
927 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
928 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
929 std::string getName() const throw(INTERP_KERNEL::Exception);
930 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
931 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
936 return MEDFileMeshMultiTS::New();
939 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
941 return MEDFileMeshMultiTS::New(fileName);
944 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
946 return MEDFileMeshMultiTS::New(fileName,mName);
949 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
951 MEDFileMesh *ret=self->getOneTimeStep();
959 class MEDFileMeshesIterator
964 PyObject *next() throw(INTERP_KERNEL::Exception)
966 MEDFileMesh *ret=self->nextt();
970 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
974 PyErr_SetString(PyExc_StopIteration,"No more data.");
981 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
984 static MEDFileMeshes *New();
985 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
986 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
987 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
988 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
989 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
991 void resize(int newSize) throw(INTERP_KERNEL::Exception);
992 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
993 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
994 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
999 return MEDFileMeshes::New();
1002 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
1004 return MEDFileMeshes::New(fileName);
1007 std::string __str__() const throw(INTERP_KERNEL::Exception)
1009 return self->simpleRepr();
1012 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1014 if(PyInt_Check(obj))
1016 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
1021 else if(PyString_Check(obj))
1023 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1029 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1032 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1034 self->setMeshAtPos(obj,mesh);
1038 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1040 return self->iterator();
1043 int __len__() const throw(INTERP_KERNEL::Exception)
1045 return self->getNumberOfMeshes();
1048 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1050 MEDFileMesh *ret=self->getMeshAtPos(i);
1055 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1057 MEDFileMesh *ret=self->getMeshWithName(mname);
1065 class MEDFileFieldLoc : public RefCountObject
1068 std::string getName() const;
1069 int getDimension() const;
1070 int getNumberOfGaussPoints() const;
1071 int getNumberOfPointsInCells() const;
1072 const std::vector<double>& getRefCoords() const;
1073 const std::vector<double>& getGaussCoords() const;
1074 const std::vector<double>& getGaussWeights() const;
1075 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1078 std::string __str__() const throw(INTERP_KERNEL::Exception)
1080 return self->repr();
1085 class MEDFileFieldGlobsReal
1088 void resetContent();
1089 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1090 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1091 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1092 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1093 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1094 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1095 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1096 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1097 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1098 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1099 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1100 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1101 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1102 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1103 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1104 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1105 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1106 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1107 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1108 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1109 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1110 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1111 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1112 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1113 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1114 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1117 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1119 const DataArrayInt *ret=self->getProfile(pflName);
1122 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1125 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1127 const DataArrayInt *ret=self->getProfileFromId(pflId);
1130 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1133 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1135 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1138 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1141 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1143 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1146 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1149 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1151 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1152 return convertVecPairVecStToPy(ret);
1155 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1157 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1158 return convertVecPairVecStToPy(ret);
1161 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1163 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1164 self->changePflsNames(v);
1167 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1169 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1170 self->changePflsRefsNamesGen(v);
1173 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1175 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1176 self->changePflsNamesInStruct(v);
1179 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1181 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1182 self->changeLocsNames(v);
1185 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1187 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1188 self->changeLocsRefsNamesGen(v);
1191 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1193 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1194 self->changeLocsNamesInStruct(v);
1197 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1199 std::ostringstream oss;
1200 self->simpleReprGlobs(oss);
1206 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1209 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1210 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1211 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1212 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1213 void loadArrays() throw(INTERP_KERNEL::Exception);
1214 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1215 void unloadArrays() throw(INTERP_KERNEL::Exception);
1216 int getDimension() const throw(INTERP_KERNEL::Exception);
1217 int getIteration() const throw(INTERP_KERNEL::Exception);
1218 int getOrder() const throw(INTERP_KERNEL::Exception);
1219 std::string getName() throw(INTERP_KERNEL::Exception);
1220 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1221 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1222 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1223 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1224 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1225 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1226 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1227 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1228 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1229 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1230 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1231 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1232 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1233 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1236 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1239 double tmp0=self->getTime(tmp1,tmp2);
1240 PyObject *res = PyList_New(3);
1241 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1242 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1243 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1247 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1249 std::pair<int,int> res=self->getDtIt();
1250 PyObject *elt=PyTuple_New(2);
1251 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1252 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1256 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1258 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1261 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1263 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1266 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1268 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1269 return self->changeMeshNames(modifTab);
1272 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1274 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1275 PyObject *ret2=PyList_New(ret.size());
1276 for(int i=0;i<(int)ret.size();i++)
1277 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1281 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1283 std::vector<int> ret1;
1284 int ret0=self->getNonEmptyLevels(mname,ret1);
1285 PyObject *elt=PyTuple_New(2);
1286 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1287 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1291 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1293 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1294 std::vector< std::vector<TypeOfField> > typesF;
1295 std::vector< std::vector<std::string> > pfls;
1296 std::vector< std::vector<std::string> > locs;
1297 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1299 PyObject *ret2=PyList_New(sz);
1300 for(int i=0;i<sz;i++)
1302 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1303 const std::vector<TypeOfField>& typesFI=typesF[i];
1304 const std::vector<std::string>& pflsI=pfls[i];
1305 const std::vector<std::string>& locsI=locs[i];
1306 PyObject *elt=PyTuple_New(2);
1307 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1308 int sz2=ret[i].size();
1309 PyObject *elt2=PyList_New(sz2);
1310 for(int j=0;j<sz2;j++)
1312 PyObject *elt3=PyTuple_New(4);
1313 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1314 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));
1315 PyTuple_SetItem(elt3,1,elt4);
1316 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1317 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1318 PyList_SetItem(elt2,j,elt3);
1320 PyTuple_SetItem(elt,1,elt2);
1321 PyList_SetItem(ret2,i,elt);
1326 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1328 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1329 std::size_t sz=ret.size();
1330 PyObject *retPy=PyList_New(sz);
1331 for(std::size_t i=0;i<sz;i++)
1332 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1336 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1338 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1339 std::size_t sz=ret.size();
1340 PyObject *retPy=PyList_New(sz);
1341 for(std::size_t i=0;i<sz;i++)
1342 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1348 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1351 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1352 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1353 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1354 static MEDFileField1TS *New();
1355 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1356 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1357 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1358 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1359 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1360 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1362 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1363 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1364 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1365 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1368 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1370 return MEDFileField1TS::New(fileName,loadAll);
1373 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1375 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1378 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1380 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1385 return MEDFileField1TS::New();
1388 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1390 const DataArrayDouble *arr=0;
1392 arr=field->getArray();
1393 self->copyTinyInfoFrom(field,arr);
1396 std::string __str__() const throw(INTERP_KERNEL::Exception)
1398 return self->simpleRepr();
1401 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1403 DataArrayInt *ret1=0;
1404 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1405 PyObject *ret=PyTuple_New(2);
1406 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1407 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1411 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1413 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1414 std::vector< std::vector<TypeOfField> > typesF;
1415 std::vector< std::vector<std::string> > pfls;
1416 std::vector< std::vector<std::string> > locs;
1417 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1419 PyObject *ret2=PyList_New(sz);
1420 for(int i=0;i<sz;i++)
1422 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1423 const std::vector<TypeOfField>& typesFI=typesF[i];
1424 const std::vector<std::string>& pflsI=pfls[i];
1425 const std::vector<std::string>& locsI=locs[i];
1426 PyObject *elt=PyTuple_New(2);
1427 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1428 int sz2=ret[i].size();
1429 PyObject *elt2=PyList_New(sz2);
1430 for(int j=0;j<sz2;j++)
1432 PyObject *elt3=PyTuple_New(4);
1433 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1434 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1435 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1436 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1437 PyList_SetItem(elt2,j,elt3);
1439 PyTuple_SetItem(elt,1,elt2);
1440 PyList_SetItem(ret2,i,elt);
1445 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1447 DataArrayDouble *ret=self->getUndergroundDataArray();
1453 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1455 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1456 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1459 PyObject *ret=PyTuple_New(2);
1460 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1461 std::size_t sz=elt1Cpp.size();
1462 PyObject *elt=PyList_New(sz);
1463 for(std::size_t i=0;i<sz;i++)
1465 PyObject *elt1=PyTuple_New(2);
1466 PyObject *elt2=PyTuple_New(2);
1467 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1468 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1469 PyObject *elt3=PyTuple_New(2);
1470 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1471 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1472 PyTuple_SetItem(elt1,0,elt2);
1473 PyTuple_SetItem(elt1,1,elt3);
1474 PyList_SetItem(elt,i,elt1);
1476 PyTuple_SetItem(ret,1,elt);
1482 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1485 static MEDFileIntField1TS *New();
1486 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1487 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1488 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1489 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1491 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1492 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1495 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1497 return MEDFileIntField1TS::New();
1500 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1502 return MEDFileIntField1TS::New(fileName,loadAll);
1505 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1507 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1510 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1512 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1515 std::string __str__() const throw(INTERP_KERNEL::Exception)
1517 return self->simpleRepr();
1520 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1522 DataArrayInt *ret1=0;
1523 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1524 PyObject *ret=PyTuple_New(2);
1525 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1526 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1530 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1532 DataArrayInt *ret1=0;
1533 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1534 PyObject *ret=PyTuple_New(2);
1535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1536 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1540 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1542 DataArrayInt *ret1=0;
1543 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1544 PyObject *ret=PyTuple_New(2);
1545 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1546 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1550 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1552 DataArrayInt *ret1=0;
1553 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1554 PyObject *ret=PyTuple_New(2);
1555 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1556 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1560 PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1562 DataArrayInt *ret1=0;
1563 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1564 PyObject *ret=PyTuple_New(2);
1565 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1566 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1570 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1572 DataArrayInt *ret1=0;
1573 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1574 PyObject *ret=PyTuple_New(2);
1575 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1576 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1580 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1582 DataArrayInt *ret=self->getUndergroundDataArray();
1590 class MEDFileAnyTypeFieldMultiTSIterator
1595 PyObject *next() throw(INTERP_KERNEL::Exception)
1597 MEDFileAnyTypeField1TS *ret=self->nextt();
1599 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1602 PyErr_SetString(PyExc_StopIteration,"No more data.");
1609 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1612 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1613 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1614 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1615 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1616 std::string getName() const throw(INTERP_KERNEL::Exception);
1617 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1618 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1619 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1620 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1621 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1622 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1623 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1624 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1625 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1626 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1627 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1628 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1629 void loadArrays() throw(INTERP_KERNEL::Exception);
1630 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1631 void unloadArrays() throw(INTERP_KERNEL::Exception);
1633 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1634 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1635 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1636 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1637 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1640 int __len__() const throw(INTERP_KERNEL::Exception)
1642 return self->getNumberOfTS();
1645 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1647 if(elt0 && PyInt_Check(elt0))
1649 int pos=PyInt_AS_LONG(elt0);
1652 else if(elt0 && PyTuple_Check(elt0))
1654 if(PyTuple_Size(elt0)==2)
1656 PyObject *o0=PyTuple_GetItem(elt0,0);
1657 PyObject *o1=PyTuple_GetItem(elt0,1);
1658 if(PyInt_Check(o0) && PyInt_Check(o1))
1660 int iter=PyInt_AS_LONG(o0);
1661 int order=PyInt_AS_LONG(o1);
1662 return self->getPosOfTimeStep(iter,order);
1665 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 !");
1668 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 !");
1670 else if(elt0 && PyFloat_Check(elt0))
1672 double val=PyFloat_AS_DOUBLE(elt0);
1673 return self->getPosGivenTime(val);
1676 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1679 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1681 std::vector< std::pair<int,int> > res=self->getIterations();
1682 PyObject *ret=PyList_New(res.size());
1684 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1686 PyObject *elt=PyTuple_New(2);
1687 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1688 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1689 PyList_SetItem(ret,rk,elt);
1694 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1696 std::vector<double> ret1;
1697 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1698 std::size_t sz=ret.size();
1699 PyObject *ret2=PyList_New(sz);
1700 for(std::size_t i=0;i<sz;i++)
1702 PyObject *elt=PyTuple_New(3);
1703 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1704 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1705 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1706 PyList_SetItem(ret2,i,elt);
1711 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1713 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1714 PyObject *ret2=PyList_New(ret.size());
1715 for(int i=0;i<(int)ret.size();i++)
1717 const std::vector<TypeOfField>& rett=ret[i];
1718 PyObject *ret3=PyList_New(rett.size());
1719 for(int j=0;j<(int)rett.size();j++)
1720 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1721 PyList_SetItem(ret2,i,ret3);
1726 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1728 std::vector<int> ret1;
1729 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1730 PyObject *elt=PyTuple_New(2);
1731 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1732 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1736 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1738 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1739 std::vector< std::vector<TypeOfField> > typesF;
1740 std::vector< std::vector<std::string> > pfls;
1741 std::vector< std::vector<std::string> > locs;
1742 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1744 PyObject *ret2=PyList_New(sz);
1745 for(int i=0;i<sz;i++)
1747 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1748 const std::vector<TypeOfField>& typesFI=typesF[i];
1749 const std::vector<std::string>& pflsI=pfls[i];
1750 const std::vector<std::string>& locsI=locs[i];
1751 PyObject *elt=PyTuple_New(2);
1752 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1753 int sz2=ret[i].size();
1754 PyObject *elt2=PyList_New(sz2);
1755 for(int j=0;j<sz2;j++)
1757 PyObject *elt3=PyTuple_New(4);
1758 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1759 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));
1760 PyTuple_SetItem(elt3,1,elt4);
1761 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1762 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1763 PyList_SetItem(elt2,j,elt3);
1765 PyTuple_SetItem(elt,1,elt2);
1766 PyList_SetItem(ret2,i,elt);
1771 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1773 if(PyList_Check(elts))
1775 int sz=PyList_Size(elts);
1776 std::vector<int> ret(sz);
1777 for(int i=0;i<sz;i++)
1779 PyObject *elt=PyList_GetItem(elts,i);
1780 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1786 std::vector<int> ret(1);
1787 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1792 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1794 if(PySlice_Check(elts))
1796 Py_ssize_t strt=2,stp=2,step=2;
1797 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1798 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1800 self->eraseTimeStepIds2(strt,stp,step);
1803 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1807 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1808 if(!idsToRemove.empty())
1809 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1813 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1817 std::vector<int> pos2;
1818 DataArrayInt *pos3=0;
1819 DataArrayIntTuple *pos4=0;
1820 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1825 self->eraseTimeStepIds(&pos1,&pos1+1);
1832 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1837 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1841 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1845 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1847 return self->iterator();
1850 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1852 if(elt0 && PyList_Check(elt0))
1854 int sz=PyList_Size(elt0);
1855 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1856 int *pt=da->getPointer();
1857 for(int i=0;i<sz;i++,pt++)
1859 PyObject *elt1=PyList_GetItem(elt0,i);
1860 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1862 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1864 else if(elt0 && PySlice_Check(elt0))
1866 Py_ssize_t strt=2,stp=2,step=2;
1867 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1868 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1869 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1871 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1874 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1877 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1879 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1880 return self->changeMeshNames(modifTab);
1883 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1885 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1886 std::size_t sz=ret.size();
1887 PyObject *retPy=PyList_New(sz);
1888 for(std::size_t i=0;i<sz;i++)
1889 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1893 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1895 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1896 std::size_t sz=ret.size();
1897 PyObject *retPy=PyList_New(sz);
1898 for(std::size_t i=0;i<sz;i++)
1899 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1903 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1905 std::vector<MEDFileAnyTypeField1TS *> tmp;
1906 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1907 self->pushBackTimeSteps(tmp);
1910 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1912 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1913 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1914 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1915 std::size_t sz=ret.size();
1916 PyObject *retPy=PyList_New(sz);
1917 for(std::size_t i=0;i<sz;i++)
1919 std::size_t sz2=ret[i].size();
1920 PyObject *ret1Py=PyList_New(sz2);
1921 for(std::size_t j=0;j<sz2;j++)
1923 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1926 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1928 PyList_SetItem(retPy,i,ret1Py);
1933 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1935 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1936 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1937 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1938 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1939 if(ret2.size()!=ret.size())
1941 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1942 throw INTERP_KERNEL::Exception(oss.str().c_str());
1944 std::size_t sz=ret.size();
1945 PyObject *retPy=PyList_New(sz);
1946 for(std::size_t i=0;i<sz;i++)
1948 std::size_t sz2=ret[i].size();
1949 PyObject *ret0Py=PyTuple_New(2);
1950 PyObject *ret1Py=PyList_New(sz2);
1951 for(std::size_t j=0;j<sz2;j++)
1953 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1956 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1958 PyTuple_SetItem(ret0Py,0,ret1Py);
1959 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1960 PyList_SetItem(retPy,i,ret0Py);
1967 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1970 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1971 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1972 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1974 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1975 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1976 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1977 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1978 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1980 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1981 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1982 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1985 MEDFileFieldMultiTS()
1987 return MEDFileFieldMultiTS::New();
1990 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1992 return MEDFileFieldMultiTS::New(fileName,loadAll);
1995 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1997 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2000 std::string __str__() const throw(INTERP_KERNEL::Exception)
2002 return self->simpleRepr();
2005 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2007 DataArrayInt *ret1=0;
2008 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2009 PyObject *ret=PyTuple_New(2);
2010 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2011 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2015 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
2017 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2018 std::vector< std::vector<TypeOfField> > typesF;
2019 std::vector< std::vector<std::string> > pfls;
2020 std::vector< std::vector<std::string> > locs;
2021 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2023 PyObject *ret2=PyList_New(sz);
2024 for(int i=0;i<sz;i++)
2026 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2027 const std::vector<TypeOfField>& typesFI=typesF[i];
2028 const std::vector<std::string>& pflsI=pfls[i];
2029 const std::vector<std::string>& locsI=locs[i];
2030 PyObject *elt=PyTuple_New(2);
2031 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2032 int sz2=ret[i].size();
2033 PyObject *elt2=PyList_New(sz2);
2034 for(int j=0;j<sz2;j++)
2036 PyObject *elt3=PyTuple_New(4);
2037 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2038 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2039 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2040 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2041 PyList_SetItem(elt2,j,elt3);
2043 PyTuple_SetItem(elt,1,elt2);
2044 PyList_SetItem(ret2,i,elt);
2048 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2050 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2056 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2058 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2059 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2062 PyObject *ret=PyTuple_New(2);
2063 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2064 std::size_t sz=elt1Cpp.size();
2065 PyObject *elt=PyList_New(sz);
2066 for(std::size_t i=0;i<sz;i++)
2068 PyObject *elt1=PyTuple_New(2);
2069 PyObject *elt2=PyTuple_New(2);
2070 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2071 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2072 PyObject *elt3=PyTuple_New(2);
2073 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2074 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2075 PyTuple_SetItem(elt1,0,elt2);
2076 PyTuple_SetItem(elt1,1,elt3);
2077 PyList_SetItem(elt,i,elt1);
2079 PyTuple_SetItem(ret,1,elt);
2085 class MEDFileFieldsIterator
2090 PyObject *next() throw(INTERP_KERNEL::Exception)
2092 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2094 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2097 PyErr_SetString(PyExc_StopIteration,"No more data.");
2104 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2107 static MEDFileIntFieldMultiTS *New();
2108 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2109 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2111 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2112 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2113 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2116 MEDFileIntFieldMultiTS()
2118 return MEDFileIntFieldMultiTS::New();
2121 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2123 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2126 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2128 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2131 std::string __str__() const throw(INTERP_KERNEL::Exception)
2133 return self->simpleRepr();
2136 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2138 DataArrayInt *ret1=0;
2139 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2140 PyObject *ret=PyTuple_New(2);
2141 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2142 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2146 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2148 DataArrayInt *ret1=0;
2149 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2150 PyObject *ret=PyTuple_New(2);
2151 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2152 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2156 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2158 DataArrayInt *ret1=0;
2159 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2160 PyObject *ret=PyTuple_New(2);
2161 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2162 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2166 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2168 DataArrayInt *ret1=0;
2169 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2170 PyObject *ret=PyTuple_New(2);
2171 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2172 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2178 DataArrayInt *ret1=0;
2179 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2180 PyObject *ret=PyTuple_New(2);
2181 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2182 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2186 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2188 DataArrayInt *ret1=0;
2189 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2190 PyObject *ret=PyTuple_New(2);
2191 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2196 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2198 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2206 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2209 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2210 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2211 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2212 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2213 void loadArrays() throw(INTERP_KERNEL::Exception);
2214 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2215 void unloadArrays() throw(INTERP_KERNEL::Exception);
2216 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2217 int getNumberOfFields() const;
2218 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2219 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2221 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2222 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2223 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2224 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2225 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2226 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2227 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2228 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2233 return MEDFileFields::New();
2236 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2238 return MEDFileFields::New(fileName,loadAll);
2241 std::string __str__() const throw(INTERP_KERNEL::Exception)
2243 return self->simpleRepr();
2246 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2249 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2250 PyObject *ret=PyTuple_New(2);
2251 PyObject *ret_0=PyList_New(ret0.size());
2253 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2255 PyObject *elt=PyTuple_New(2);
2256 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2257 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2258 PyList_SetItem(ret_0,rk,elt);
2260 PyTuple_SetItem(ret,0,ret_0);
2261 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2262 PyTuple_SetItem(ret,1,ret_1);
2266 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2268 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2269 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2272 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2274 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2275 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2278 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2280 if(obj && PyList_Check(obj))
2282 int sz=PyList_Size(obj);
2283 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2284 int *pt=da->getPointer();
2285 for(int i=0;i<sz;i++,pt++)
2287 PyObject *elt1=PyList_GetItem(obj,i);
2288 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2290 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2293 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2296 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2298 self->setFieldAtPos(obj,field);
2302 int __len__() const throw(INTERP_KERNEL::Exception)
2304 return self->getNumberOfFields();
2307 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2309 return self->iterator();
2312 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2314 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2315 return self->changeMeshNames(modifTab);
2318 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2320 if(elt0 && PyInt_Check(elt0))
2322 return PyInt_AS_LONG(elt0);
2324 else if(elt0 && PyString_Check(elt0))
2325 return self->getPosFromFieldName(PyString_AsString(elt0));
2327 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2330 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2332 if(PyList_Check(elts))
2334 int sz=PyList_Size(elts);
2335 std::vector<int> ret(sz);
2336 for(int i=0;i<sz;i++)
2338 PyObject *elt=PyList_GetItem(elts,i);
2339 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2345 std::vector<int> ret(1);
2346 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2351 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2353 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2354 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2355 self->pushFields(tmp);
2358 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2360 if(elts && PySlice_Check(elts))
2362 Py_ssize_t strt=2,stp=2,step=2;
2363 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2364 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2365 self->destroyFieldsAtPos2(strt,stp,step);
2367 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2371 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2372 if(!idsToRemove.empty())
2373 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2379 class MEDFileParameter1TS : public RefCountObject
2382 void setIteration(int it);
2383 int getIteration() const;
2384 void setOrder(int order);
2385 int getOrder() const;
2386 void setTimeValue(double time);
2387 void setTime(int dt, int it, double time);
2388 double getTime(int& dt, int& it);
2389 double getTimeValue() const;
2392 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2395 void setValue(double val) throw(INTERP_KERNEL::Exception);
2396 double getValue() const throw(INTERP_KERNEL::Exception);
2397 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2400 std::string __str__() const throw(INTERP_KERNEL::Exception)
2402 return self->simpleRepr();
2407 class MEDFileParameterTinyInfo : public MEDFileWritable
2410 void setDescription(const char *name);
2411 std::string getDescription() const;
2412 void setTimeUnit(const char *unit);
2413 std::string getTimeUnit() const;
2416 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2419 static MEDFileParameterDouble1TS *New();
2420 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2421 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2422 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2423 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2424 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2425 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2426 std::string getName() const throw(INTERP_KERNEL::Exception);
2427 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2430 MEDFileParameterDouble1TS()
2432 return MEDFileParameterDouble1TS::New();
2435 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2437 return MEDFileParameterDouble1TS::New(fileName);
2440 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2442 return MEDFileParameterDouble1TS::New(fileName,paramName);
2445 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2447 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2450 std::string __str__() const throw(INTERP_KERNEL::Exception)
2452 return self->simpleRepr();
2455 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2458 bool ret0=self->isEqual(other,eps,what);
2459 PyObject *res=PyList_New(2);
2460 PyObject *ret0Py=ret0?Py_True:Py_False;
2462 PyList_SetItem(res,0,ret0Py);
2463 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2469 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2472 static MEDFileParameterMultiTS *New();
2473 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2474 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2475 std::string getName() const;
2476 void setName(const char *name);
2477 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2478 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2479 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2480 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2481 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2482 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2483 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2486 MEDFileParameterMultiTS()
2488 return MEDFileParameterMultiTS::New();
2491 MEDFileParameterMultiTS(const char *fileName)
2493 return MEDFileParameterMultiTS::New(fileName);
2496 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2498 return MEDFileParameterMultiTS::New(fileName,paramName);
2501 std::string __str__() const throw(INTERP_KERNEL::Exception)
2503 return self->simpleRepr();
2506 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2509 bool ret0=self->isEqual(other,eps,what);
2510 PyObject *res=PyList_New(2);
2511 PyObject *ret0Py=ret0?Py_True:Py_False;
2513 PyList_SetItem(res,0,ret0Py);
2514 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2518 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2522 std::vector<int> pos2;
2523 DataArrayInt *pos3=0;
2524 DataArrayIntTuple *pos4=0;
2525 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2530 self->eraseTimeStepIds(&pos1,&pos1+1);
2537 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2542 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2546 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2550 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2552 if(elt0 && PyInt_Check(elt0))
2554 int pos=PyInt_AS_LONG(elt0);
2557 else if(elt0 && PyTuple_Check(elt0))
2559 if(PyTuple_Size(elt0)==2)
2561 PyObject *o0=PyTuple_GetItem(elt0,0);
2562 PyObject *o1=PyTuple_GetItem(elt0,1);
2563 if(PyInt_Check(o0) && PyInt_Check(o1))
2565 int iter=PyInt_AS_LONG(o0);
2566 int order=PyInt_AS_LONG(o1);
2567 return self->getPosOfTimeStep(iter,order);
2570 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 !");
2573 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 !");
2575 else if(elt0 && PyFloat_Check(elt0))
2577 double val=PyFloat_AS_DOUBLE(elt0);
2578 return self->getPosGivenTime(val);
2581 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2584 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2586 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2592 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2594 if(PyList_Check(elts))
2596 int sz=PyList_Size(elts);
2597 std::vector<int> ret(sz);
2598 for(int i=0;i<sz;i++)
2600 PyObject *elt=PyList_GetItem(elts,i);
2601 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2607 std::vector<int> ret(1);
2608 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2613 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2615 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2616 if(!idsToRemove.empty())
2617 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2620 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2622 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2628 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2630 std::vector< std::pair<int,int> > res=self->getIterations();
2631 PyObject *ret=PyList_New(res.size());
2633 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2635 PyObject *elt=PyTuple_New(2);
2636 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2637 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2638 PyList_SetItem(ret,rk,elt);
2643 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2645 std::vector<double> res2;
2646 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2647 PyObject *ret=PyList_New(res.size());
2649 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2651 PyObject *elt=PyTuple_New(3);
2652 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2653 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2654 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2655 PyList_SetItem(ret,rk,elt);
2662 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2665 static MEDFileParameters *New();
2666 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2667 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2668 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2669 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2670 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2671 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2672 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2673 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2674 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2675 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2676 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2681 return MEDFileParameters::New();
2684 MEDFileParameters(const char *fileName)
2686 return MEDFileParameters::New(fileName);
2689 std::string __str__() const throw(INTERP_KERNEL::Exception)
2691 return self->simpleRepr();
2694 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2696 if(PyInt_Check(obj))
2698 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2703 else if(PyString_Check(obj))
2705 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2711 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2714 int __len__() const throw(INTERP_KERNEL::Exception)
2716 return self->getNumberOfParams();
2719 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2721 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2727 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2729 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2735 PyObject *isEqual(const MEDFileParameters *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()));
2749 class MEDFileData : public RefCountObject, public MEDFileWritable
2752 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2753 static MEDFileData *New();
2754 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2755 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2756 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2757 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2758 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2759 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2760 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2762 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2763 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2765 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2768 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2770 return MEDFileData::New(fileName);
2775 return MEDFileData::New();
2778 std::string __str__() const throw(INTERP_KERNEL::Exception)
2780 return self->simpleRepr();
2783 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2785 MEDFileMeshes *ret=self->getMeshes();
2791 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2793 MEDFileParameters *ret=self->getParams();
2799 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2801 MEDFileFields *ret=self->getFields();
2807 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2809 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2810 return self->changeMeshNames(modifTab);
2815 class SauvReader : public RefCountObject
2818 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2819 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2822 class SauvWriter : public RefCountObject
2825 static SauvWriter * New();
2826 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2827 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2828 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2829 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2834 class MEDFileMeshStruct;
2836 class MEDFileField1TSStructItem
2839 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2842 class MEDFileMeshStruct : public RefCountObject
2845 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2847 ~MEDFileMeshStruct();
2850 class MEDMeshMultiLev : public RefCountObject
2853 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2854 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2860 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2862 DataArrayInt *famIds(0);
2863 bool isWithoutCopy(false);
2864 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2865 PyObject *ret=PyTuple_New(2);
2866 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2868 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2869 PyTuple_SetItem(ret,1,ret1Py);
2873 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2875 DataArrayInt *numIds(0);
2876 bool isWithoutCopy(false);
2877 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2878 PyObject *ret=PyTuple_New(2);
2879 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2881 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2882 PyTuple_SetItem(ret,1,ret1Py);
2888 class MEDUMeshMultiLev : public MEDMeshMultiLev
2891 ~MEDUMeshMultiLev();
2895 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2897 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2898 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
2899 PyObject *ret0Py=ncc?Py_True:Py_False;
2901 PyObject *ret=PyTuple_New(7);
2902 PyTuple_SetItem(ret,0,ret0Py);
2903 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2904 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2905 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2906 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2907 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2908 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2914 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2917 ~MEDStructuredMeshMultiLev();
2920 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2923 ~MEDCMeshMultiLev();
2927 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2929 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2930 std::size_t sz(objs.size());
2931 PyObject *ret=PyList_New(sz);
2932 for(std::size_t i=0;i<sz;i++)
2933 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2939 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2942 ~MEDCurveLinearMeshMultiLev();
2946 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2948 DataArrayDouble *ret0(0);
2949 std::vector<int> ret1;
2950 self->buildVTUArrays(ret0,ret1);
2951 std::size_t sz(ret1.size());
2952 PyObject *ret=PyTuple_New(2);
2953 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2954 PyObject *ret1Py=PyList_New(sz);
2955 for(std::size_t i=0;i<sz;i++)
2956 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2957 PyTuple_SetItem(ret,1,ret1Py);
2963 class MEDFileFastCellSupportComparator : public RefCountObject
2966 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2967 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2968 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2970 ~MEDFileFastCellSupportComparator();