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 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
514 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
515 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
516 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
517 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
518 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
519 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
520 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
521 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
522 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
523 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
524 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
525 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
526 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
527 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
528 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
529 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
530 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
531 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
532 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
533 void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
534 void setFamilyInfo(const std::map<std::string,int>& info);
535 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
536 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
537 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
538 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
539 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
540 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
541 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
542 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
543 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
544 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
545 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
546 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
547 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
548 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
549 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
550 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
551 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
552 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
553 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
554 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
555 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
557 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
558 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
559 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
560 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
561 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
562 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
563 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
564 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
565 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
566 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
567 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
568 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
571 std::string __str__() const throw(INTERP_KERNEL::Exception)
573 return self->simpleRepr();
576 PyObject *getTime() throw(INTERP_KERNEL::Exception)
579 double tmp0=self->getTime(tmp1,tmp2);
580 PyObject *res = PyList_New(3);
581 PyList_SetItem(res,0,SWIG_From_int(tmp1));
582 PyList_SetItem(res,1,SWIG_From_int(tmp2));
583 PyList_SetItem(res,2,SWIG_From_double(tmp0));
587 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
590 bool ret0=self->isEqual(other,eps,what);
591 PyObject *res=PyList_New(2);
592 PyObject *ret0Py=ret0?Py_True:Py_False;
594 PyList_SetItem(res,0,ret0Py);
595 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
599 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
602 bool ret0=self->areFamsEqual(other,what);
603 PyObject *res=PyList_New(2);
604 PyObject *ret0Py=ret0?Py_True:Py_False;
606 PyList_SetItem(res,0,ret0Py);
607 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
611 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
614 bool ret0=self->areGrpsEqual(other,what);
615 PyObject *res=PyList_New(2);
616 PyObject *ret0Py=ret0?Py_True:Py_False;
618 PyList_SetItem(res,0,ret0Py);
619 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
623 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
625 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
628 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
631 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
633 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
636 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
639 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
641 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
644 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
647 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
650 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
651 PyObject *ret=PyTuple_New(2);
652 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
653 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
657 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
659 DataArrayInt *ret3=0;
660 std::vector<int> ret1,ret2;
661 bool ret0=self->unPolyze(ret1,ret2,ret3);
662 PyObject *ret=PyTuple_New(4);
663 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
665 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
666 for(int j=0;j<(int)ret1.size()/3;j++)
668 PyObject *retLev2=PyList_New(3);
669 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
670 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
671 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
672 PyList_SetItem(retLev1_0,j,retLev2);
674 PyTuple_SetItem(ret,1,retLev1_0);
676 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
677 for(int j=0;j<(int)ret2.size()/3;j++)
679 PyObject *retLev2=PyList_New(3);
680 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
681 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
682 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
683 PyList_SetItem(retLev1_1,j,retLev2);
685 PyTuple_SetItem(ret,2,retLev1_1);
687 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
693 class MEDFileUMesh : public MEDFileMesh
696 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
697 static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
698 static MEDFileUMesh *New();
700 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
702 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
703 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
704 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
705 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
706 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
707 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
708 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
709 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
710 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
711 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
712 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
713 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
714 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
715 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
716 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
717 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
718 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
719 DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
720 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
721 DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
722 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
723 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
724 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
725 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
726 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
727 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
729 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
730 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
731 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
732 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
733 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
734 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
735 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
736 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
737 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
738 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
739 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
740 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
743 MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
745 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
748 MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
750 return MEDFileUMesh::New(fileName,mrs);
755 return MEDFileUMesh::New();
758 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
760 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
761 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
762 PyObject *res=PyList_New(result.size());
763 for(int i=0;iL!=result.end(); i++, iL++)
764 PyList_SetItem(res,i,PyInt_FromLong(*iL));
768 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
770 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
773 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
776 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
778 std::vector<const DataArrayInt *> grps;
779 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
780 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
783 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
785 std::vector<const MEDCouplingUMesh *> ms;
786 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
787 self->setMeshes(ms,renum);
790 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
792 std::vector<const MEDCouplingUMesh *> ms;
793 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
794 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
797 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
799 std::vector<const MEDCouplingUMesh *> ms;
800 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
801 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
804 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
806 DataArrayDouble *ret=self->getCoords();
812 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
814 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
815 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
816 PyObject *ret=PyTuple_New(3);
817 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
818 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
819 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
823 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
825 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
831 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
833 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
834 std::size_t sz(tmp.size());
835 PyObject *ret=PyList_New(sz);
836 for(std::size_t i=0;i<sz;i++)
840 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
847 class MEDFileStructuredMesh : public MEDFileMesh
851 class MEDFileCMesh : public MEDFileStructuredMesh
854 static MEDFileCMesh *New();
855 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
856 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
857 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
862 return MEDFileCMesh::New();
865 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
867 return MEDFileCMesh::New(fileName,mrs);
870 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
872 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
875 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
877 const MEDCouplingCMesh *tmp=self->getMesh();
880 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
885 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
888 static MEDFileCurveLinearMesh *New();
889 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
890 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
891 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
894 MEDFileCurveLinearMesh()
896 return MEDFileCurveLinearMesh::New();
899 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
901 return MEDFileCurveLinearMesh::New(fileName,mrs);
904 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
906 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
909 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
911 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
914 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
919 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
922 static MEDFileMeshMultiTS *New();
923 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
924 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
925 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
926 std::string getName() const throw(INTERP_KERNEL::Exception);
927 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
928 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
933 return MEDFileMeshMultiTS::New();
936 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
938 return MEDFileMeshMultiTS::New(fileName);
941 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
943 return MEDFileMeshMultiTS::New(fileName,mName);
946 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
948 MEDFileMesh *ret=self->getOneTimeStep();
956 class MEDFileMeshesIterator
961 PyObject *next() throw(INTERP_KERNEL::Exception)
963 MEDFileMesh *ret=self->nextt();
967 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
971 PyErr_SetString(PyExc_StopIteration,"No more data.");
978 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
981 static MEDFileMeshes *New();
982 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
983 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
984 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
985 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
986 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
988 void resize(int newSize) throw(INTERP_KERNEL::Exception);
989 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
990 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
991 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
996 return MEDFileMeshes::New();
999 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
1001 return MEDFileMeshes::New(fileName);
1004 std::string __str__() const throw(INTERP_KERNEL::Exception)
1006 return self->simpleRepr();
1009 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1011 if(PyInt_Check(obj))
1013 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
1018 else if(PyString_Check(obj))
1020 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1026 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1029 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1031 self->setMeshAtPos(obj,mesh);
1035 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1037 return self->iterator();
1040 int __len__() const throw(INTERP_KERNEL::Exception)
1042 return self->getNumberOfMeshes();
1045 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1047 MEDFileMesh *ret=self->getMeshAtPos(i);
1052 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1054 MEDFileMesh *ret=self->getMeshWithName(mname);
1062 class MEDFileFieldLoc : public RefCountObject
1065 std::string getName() const;
1066 int getDimension() const;
1067 int getNumberOfGaussPoints() const;
1068 int getNumberOfPointsInCells() const;
1069 const std::vector<double>& getRefCoords() const;
1070 const std::vector<double>& getGaussCoords() const;
1071 const std::vector<double>& getGaussWeights() const;
1072 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1075 std::string __str__() const throw(INTERP_KERNEL::Exception)
1077 return self->repr();
1082 class MEDFileFieldGlobsReal
1085 void resetContent();
1086 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1087 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1088 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1089 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1090 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1091 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1092 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1093 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1094 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1095 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1096 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1097 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1098 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1099 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1100 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1101 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1102 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1103 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1104 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1105 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1106 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1107 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1108 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1109 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1110 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1111 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1114 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1116 const DataArrayInt *ret=self->getProfile(pflName);
1119 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1122 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1124 const DataArrayInt *ret=self->getProfileFromId(pflId);
1127 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1130 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1132 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1135 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1138 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1140 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1143 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1146 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1148 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1149 return convertVecPairVecStToPy(ret);
1152 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1154 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1155 return convertVecPairVecStToPy(ret);
1158 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1160 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1161 self->changePflsNames(v);
1164 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1166 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1167 self->changePflsRefsNamesGen(v);
1170 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1172 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1173 self->changePflsNamesInStruct(v);
1176 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1178 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1179 self->changeLocsNames(v);
1182 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1184 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1185 self->changeLocsRefsNamesGen(v);
1188 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1190 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1191 self->changeLocsNamesInStruct(v);
1194 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1196 std::ostringstream oss;
1197 self->simpleReprGlobs(oss);
1203 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1206 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1207 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1208 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1209 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1210 void loadArrays() throw(INTERP_KERNEL::Exception);
1211 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1212 void unloadArrays() throw(INTERP_KERNEL::Exception);
1213 int getDimension() const throw(INTERP_KERNEL::Exception);
1214 int getIteration() const throw(INTERP_KERNEL::Exception);
1215 int getOrder() const throw(INTERP_KERNEL::Exception);
1216 std::string getName() throw(INTERP_KERNEL::Exception);
1217 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1218 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1219 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1220 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1221 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1222 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1223 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1224 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1225 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1226 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1227 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1228 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1229 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1230 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1233 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1236 double tmp0=self->getTime(tmp1,tmp2);
1237 PyObject *res = PyList_New(3);
1238 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1239 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1240 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1244 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1246 std::pair<int,int> res=self->getDtIt();
1247 PyObject *elt=PyTuple_New(2);
1248 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1249 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1253 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1255 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1258 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1260 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1263 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1265 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1266 return self->changeMeshNames(modifTab);
1269 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1271 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1272 PyObject *ret2=PyList_New(ret.size());
1273 for(int i=0;i<(int)ret.size();i++)
1274 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1278 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1280 std::vector<int> ret1;
1281 int ret0=self->getNonEmptyLevels(mname,ret1);
1282 PyObject *elt=PyTuple_New(2);
1283 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1284 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1288 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1290 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1291 std::vector< std::vector<TypeOfField> > typesF;
1292 std::vector< std::vector<std::string> > pfls;
1293 std::vector< std::vector<std::string> > locs;
1294 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1296 PyObject *ret2=PyList_New(sz);
1297 for(int i=0;i<sz;i++)
1299 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1300 const std::vector<TypeOfField>& typesFI=typesF[i];
1301 const std::vector<std::string>& pflsI=pfls[i];
1302 const std::vector<std::string>& locsI=locs[i];
1303 PyObject *elt=PyTuple_New(2);
1304 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1305 int sz2=ret[i].size();
1306 PyObject *elt2=PyList_New(sz2);
1307 for(int j=0;j<sz2;j++)
1309 PyObject *elt3=PyTuple_New(4);
1310 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1311 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));
1312 PyTuple_SetItem(elt3,1,elt4);
1313 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1314 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1315 PyList_SetItem(elt2,j,elt3);
1317 PyTuple_SetItem(elt,1,elt2);
1318 PyList_SetItem(ret2,i,elt);
1323 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1325 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1326 std::size_t sz=ret.size();
1327 PyObject *retPy=PyList_New(sz);
1328 for(std::size_t i=0;i<sz;i++)
1329 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1333 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1335 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1336 std::size_t sz=ret.size();
1337 PyObject *retPy=PyList_New(sz);
1338 for(std::size_t i=0;i<sz;i++)
1339 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1345 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1348 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1349 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1350 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1351 static MEDFileField1TS *New();
1352 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1353 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1354 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1355 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1356 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1357 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1359 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1360 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1361 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1362 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1365 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1367 return MEDFileField1TS::New(fileName,loadAll);
1370 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1372 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1375 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1377 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1382 return MEDFileField1TS::New();
1385 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1387 const DataArrayDouble *arr=0;
1389 arr=field->getArray();
1390 self->copyTinyInfoFrom(field,arr);
1393 std::string __str__() const throw(INTERP_KERNEL::Exception)
1395 return self->simpleRepr();
1398 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1400 DataArrayInt *ret1=0;
1401 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1402 PyObject *ret=PyTuple_New(2);
1403 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1404 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1408 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1410 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1411 std::vector< std::vector<TypeOfField> > typesF;
1412 std::vector< std::vector<std::string> > pfls;
1413 std::vector< std::vector<std::string> > locs;
1414 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1416 PyObject *ret2=PyList_New(sz);
1417 for(int i=0;i<sz;i++)
1419 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1420 const std::vector<TypeOfField>& typesFI=typesF[i];
1421 const std::vector<std::string>& pflsI=pfls[i];
1422 const std::vector<std::string>& locsI=locs[i];
1423 PyObject *elt=PyTuple_New(2);
1424 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1425 int sz2=ret[i].size();
1426 PyObject *elt2=PyList_New(sz2);
1427 for(int j=0;j<sz2;j++)
1429 PyObject *elt3=PyTuple_New(4);
1430 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1431 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1432 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1433 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1434 PyList_SetItem(elt2,j,elt3);
1436 PyTuple_SetItem(elt,1,elt2);
1437 PyList_SetItem(ret2,i,elt);
1442 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1444 DataArrayDouble *ret=self->getUndergroundDataArray();
1450 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1452 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1453 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1456 PyObject *ret=PyTuple_New(2);
1457 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1458 std::size_t sz=elt1Cpp.size();
1459 PyObject *elt=PyList_New(sz);
1460 for(std::size_t i=0;i<sz;i++)
1462 PyObject *elt1=PyTuple_New(2);
1463 PyObject *elt2=PyTuple_New(2);
1464 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1465 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1466 PyObject *elt3=PyTuple_New(2);
1467 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1468 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1469 PyTuple_SetItem(elt1,0,elt2);
1470 PyTuple_SetItem(elt1,1,elt3);
1471 PyList_SetItem(elt,i,elt1);
1473 PyTuple_SetItem(ret,1,elt);
1479 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1482 static MEDFileIntField1TS *New();
1483 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1484 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1485 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1486 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1488 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1489 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1492 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1494 return MEDFileIntField1TS::New();
1497 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1499 return MEDFileIntField1TS::New(fileName,loadAll);
1502 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1504 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1507 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1509 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1512 std::string __str__() const throw(INTERP_KERNEL::Exception)
1514 return self->simpleRepr();
1517 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1519 DataArrayInt *ret1=0;
1520 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1521 PyObject *ret=PyTuple_New(2);
1522 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1523 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1527 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1529 DataArrayInt *ret1=0;
1530 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1531 PyObject *ret=PyTuple_New(2);
1532 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1533 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1537 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1539 DataArrayInt *ret1=0;
1540 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1541 PyObject *ret=PyTuple_New(2);
1542 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1543 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1547 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1549 DataArrayInt *ret1=0;
1550 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1551 PyObject *ret=PyTuple_New(2);
1552 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1553 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1557 PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1559 DataArrayInt *ret1=0;
1560 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1561 PyObject *ret=PyTuple_New(2);
1562 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1563 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1567 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1569 DataArrayInt *ret1=0;
1570 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1571 PyObject *ret=PyTuple_New(2);
1572 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1573 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1577 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1579 DataArrayInt *ret=self->getUndergroundDataArray();
1587 class MEDFileAnyTypeFieldMultiTSIterator
1592 PyObject *next() throw(INTERP_KERNEL::Exception)
1594 MEDFileAnyTypeField1TS *ret=self->nextt();
1596 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1599 PyErr_SetString(PyExc_StopIteration,"No more data.");
1606 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1609 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1610 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1611 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1612 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1613 std::string getName() const throw(INTERP_KERNEL::Exception);
1614 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1615 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1616 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1617 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1618 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1619 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1620 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1621 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1622 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1623 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1624 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1625 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1626 void loadArrays() throw(INTERP_KERNEL::Exception);
1627 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1628 void unloadArrays() throw(INTERP_KERNEL::Exception);
1630 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1631 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1632 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1633 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1634 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1637 int __len__() const throw(INTERP_KERNEL::Exception)
1639 return self->getNumberOfTS();
1642 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1644 if(elt0 && PyInt_Check(elt0))
1646 int pos=PyInt_AS_LONG(elt0);
1649 else if(elt0 && PyTuple_Check(elt0))
1651 if(PyTuple_Size(elt0)==2)
1653 PyObject *o0=PyTuple_GetItem(elt0,0);
1654 PyObject *o1=PyTuple_GetItem(elt0,1);
1655 if(PyInt_Check(o0) && PyInt_Check(o1))
1657 int iter=PyInt_AS_LONG(o0);
1658 int order=PyInt_AS_LONG(o1);
1659 return self->getPosOfTimeStep(iter,order);
1662 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 !");
1665 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 !");
1667 else if(elt0 && PyFloat_Check(elt0))
1669 double val=PyFloat_AS_DOUBLE(elt0);
1670 return self->getPosGivenTime(val);
1673 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1676 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1678 std::vector< std::pair<int,int> > res=self->getIterations();
1679 PyObject *ret=PyList_New(res.size());
1681 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1683 PyObject *elt=PyTuple_New(2);
1684 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1685 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1686 PyList_SetItem(ret,rk,elt);
1691 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1693 std::vector<double> ret1;
1694 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1695 std::size_t sz=ret.size();
1696 PyObject *ret2=PyList_New(sz);
1697 for(std::size_t i=0;i<sz;i++)
1699 PyObject *elt=PyTuple_New(3);
1700 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1701 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1702 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1703 PyList_SetItem(ret2,i,elt);
1708 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1710 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1711 PyObject *ret2=PyList_New(ret.size());
1712 for(int i=0;i<(int)ret.size();i++)
1714 const std::vector<TypeOfField>& rett=ret[i];
1715 PyObject *ret3=PyList_New(rett.size());
1716 for(int j=0;j<(int)rett.size();j++)
1717 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1718 PyList_SetItem(ret2,i,ret3);
1723 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1725 std::vector<int> ret1;
1726 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1727 PyObject *elt=PyTuple_New(2);
1728 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1729 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1733 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1735 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1736 std::vector< std::vector<TypeOfField> > typesF;
1737 std::vector< std::vector<std::string> > pfls;
1738 std::vector< std::vector<std::string> > locs;
1739 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1741 PyObject *ret2=PyList_New(sz);
1742 for(int i=0;i<sz;i++)
1744 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1745 const std::vector<TypeOfField>& typesFI=typesF[i];
1746 const std::vector<std::string>& pflsI=pfls[i];
1747 const std::vector<std::string>& locsI=locs[i];
1748 PyObject *elt=PyTuple_New(2);
1749 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1750 int sz2=ret[i].size();
1751 PyObject *elt2=PyList_New(sz2);
1752 for(int j=0;j<sz2;j++)
1754 PyObject *elt3=PyTuple_New(4);
1755 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1756 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));
1757 PyTuple_SetItem(elt3,1,elt4);
1758 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1759 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1760 PyList_SetItem(elt2,j,elt3);
1762 PyTuple_SetItem(elt,1,elt2);
1763 PyList_SetItem(ret2,i,elt);
1768 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1770 if(PyList_Check(elts))
1772 int sz=PyList_Size(elts);
1773 std::vector<int> ret(sz);
1774 for(int i=0;i<sz;i++)
1776 PyObject *elt=PyList_GetItem(elts,i);
1777 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1783 std::vector<int> ret(1);
1784 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1789 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1791 if(PySlice_Check(elts))
1793 Py_ssize_t strt=2,stp=2,step=2;
1794 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1795 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1797 self->eraseTimeStepIds2(strt,stp,step);
1800 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1804 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1805 if(!idsToRemove.empty())
1806 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1810 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1814 std::vector<int> pos2;
1815 DataArrayInt *pos3=0;
1816 DataArrayIntTuple *pos4=0;
1817 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1822 self->eraseTimeStepIds(&pos1,&pos1+1);
1829 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1834 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1838 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1842 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1844 return self->iterator();
1847 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1849 if(elt0 && PyList_Check(elt0))
1851 int sz=PyList_Size(elt0);
1852 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1853 int *pt=da->getPointer();
1854 for(int i=0;i<sz;i++,pt++)
1856 PyObject *elt1=PyList_GetItem(elt0,i);
1857 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1859 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1861 else if(elt0 && PySlice_Check(elt0))
1863 Py_ssize_t strt=2,stp=2,step=2;
1864 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1865 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1866 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1868 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1871 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1874 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1876 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1877 return self->changeMeshNames(modifTab);
1880 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1882 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1883 std::size_t sz=ret.size();
1884 PyObject *retPy=PyList_New(sz);
1885 for(std::size_t i=0;i<sz;i++)
1886 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1890 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1892 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1893 std::size_t sz=ret.size();
1894 PyObject *retPy=PyList_New(sz);
1895 for(std::size_t i=0;i<sz;i++)
1896 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1900 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1902 std::vector<MEDFileAnyTypeField1TS *> tmp;
1903 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1904 self->pushBackTimeSteps(tmp);
1907 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1909 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1910 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1911 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1912 std::size_t sz=ret.size();
1913 PyObject *retPy=PyList_New(sz);
1914 for(std::size_t i=0;i<sz;i++)
1916 std::size_t sz2=ret[i].size();
1917 PyObject *ret1Py=PyList_New(sz2);
1918 for(std::size_t j=0;j<sz2;j++)
1920 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1923 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1925 PyList_SetItem(retPy,i,ret1Py);
1930 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1932 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1933 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1934 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1935 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1936 if(ret2.size()!=ret.size())
1938 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1939 throw INTERP_KERNEL::Exception(oss.str().c_str());
1941 std::size_t sz=ret.size();
1942 PyObject *retPy=PyList_New(sz);
1943 for(std::size_t i=0;i<sz;i++)
1945 std::size_t sz2=ret[i].size();
1946 PyObject *ret0Py=PyTuple_New(2);
1947 PyObject *ret1Py=PyList_New(sz2);
1948 for(std::size_t j=0;j<sz2;j++)
1950 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1953 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1955 PyTuple_SetItem(ret0Py,0,ret1Py);
1956 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1957 PyList_SetItem(retPy,i,ret0Py);
1964 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1967 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1968 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1969 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1971 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1972 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1973 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1974 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1975 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1977 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1978 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1979 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1982 MEDFileFieldMultiTS()
1984 return MEDFileFieldMultiTS::New();
1987 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1989 return MEDFileFieldMultiTS::New(fileName,loadAll);
1992 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1994 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
1997 std::string __str__() const throw(INTERP_KERNEL::Exception)
1999 return self->simpleRepr();
2002 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2004 DataArrayInt *ret1=0;
2005 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2006 PyObject *ret=PyTuple_New(2);
2007 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2008 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2012 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
2014 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2015 std::vector< std::vector<TypeOfField> > typesF;
2016 std::vector< std::vector<std::string> > pfls;
2017 std::vector< std::vector<std::string> > locs;
2018 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2020 PyObject *ret2=PyList_New(sz);
2021 for(int i=0;i<sz;i++)
2023 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2024 const std::vector<TypeOfField>& typesFI=typesF[i];
2025 const std::vector<std::string>& pflsI=pfls[i];
2026 const std::vector<std::string>& locsI=locs[i];
2027 PyObject *elt=PyTuple_New(2);
2028 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2029 int sz2=ret[i].size();
2030 PyObject *elt2=PyList_New(sz2);
2031 for(int j=0;j<sz2;j++)
2033 PyObject *elt3=PyTuple_New(4);
2034 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2035 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2036 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2037 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2038 PyList_SetItem(elt2,j,elt3);
2040 PyTuple_SetItem(elt,1,elt2);
2041 PyList_SetItem(ret2,i,elt);
2045 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2047 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2053 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2055 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2056 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2059 PyObject *ret=PyTuple_New(2);
2060 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2061 std::size_t sz=elt1Cpp.size();
2062 PyObject *elt=PyList_New(sz);
2063 for(std::size_t i=0;i<sz;i++)
2065 PyObject *elt1=PyTuple_New(2);
2066 PyObject *elt2=PyTuple_New(2);
2067 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2068 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2069 PyObject *elt3=PyTuple_New(2);
2070 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2071 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2072 PyTuple_SetItem(elt1,0,elt2);
2073 PyTuple_SetItem(elt1,1,elt3);
2074 PyList_SetItem(elt,i,elt1);
2076 PyTuple_SetItem(ret,1,elt);
2082 class MEDFileFieldsIterator
2087 PyObject *next() throw(INTERP_KERNEL::Exception)
2089 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2091 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2094 PyErr_SetString(PyExc_StopIteration,"No more data.");
2101 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2104 static MEDFileIntFieldMultiTS *New();
2105 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2106 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2108 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2109 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2110 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2113 MEDFileIntFieldMultiTS()
2115 return MEDFileIntFieldMultiTS::New();
2118 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2120 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2123 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2125 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2128 std::string __str__() const throw(INTERP_KERNEL::Exception)
2130 return self->simpleRepr();
2133 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2135 DataArrayInt *ret1=0;
2136 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2137 PyObject *ret=PyTuple_New(2);
2138 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2139 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2143 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2145 DataArrayInt *ret1=0;
2146 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2147 PyObject *ret=PyTuple_New(2);
2148 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2153 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2155 DataArrayInt *ret1=0;
2156 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2157 PyObject *ret=PyTuple_New(2);
2158 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2159 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2163 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2165 DataArrayInt *ret1=0;
2166 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2167 PyObject *ret=PyTuple_New(2);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2169 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2175 DataArrayInt *ret1=0;
2176 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2177 PyObject *ret=PyTuple_New(2);
2178 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2179 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2185 DataArrayInt *ret1=0;
2186 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2187 PyObject *ret=PyTuple_New(2);
2188 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2189 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2195 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2203 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2206 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2207 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2208 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2209 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2210 void loadArrays() throw(INTERP_KERNEL::Exception);
2211 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2212 void unloadArrays() throw(INTERP_KERNEL::Exception);
2213 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2214 int getNumberOfFields() const;
2215 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2216 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2218 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2219 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2220 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2221 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2222 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2223 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2224 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2225 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2230 return MEDFileFields::New();
2233 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2235 return MEDFileFields::New(fileName,loadAll);
2238 std::string __str__() const throw(INTERP_KERNEL::Exception)
2240 return self->simpleRepr();
2243 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2246 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2247 PyObject *ret=PyTuple_New(2);
2248 PyObject *ret_0=PyList_New(ret0.size());
2250 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2252 PyObject *elt=PyTuple_New(2);
2253 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2254 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2255 PyList_SetItem(ret_0,rk,elt);
2257 PyTuple_SetItem(ret,0,ret_0);
2258 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2259 PyTuple_SetItem(ret,1,ret_1);
2263 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2265 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2266 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2269 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2271 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2272 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2275 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2277 if(obj && PyList_Check(obj))
2279 int sz=PyList_Size(obj);
2280 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2281 int *pt=da->getPointer();
2282 for(int i=0;i<sz;i++,pt++)
2284 PyObject *elt1=PyList_GetItem(obj,i);
2285 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2287 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2290 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2293 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2295 self->setFieldAtPos(obj,field);
2299 int __len__() const throw(INTERP_KERNEL::Exception)
2301 return self->getNumberOfFields();
2304 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2306 return self->iterator();
2309 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2311 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2312 return self->changeMeshNames(modifTab);
2315 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2317 if(elt0 && PyInt_Check(elt0))
2319 return PyInt_AS_LONG(elt0);
2321 else if(elt0 && PyString_Check(elt0))
2322 return self->getPosFromFieldName(PyString_AsString(elt0));
2324 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2327 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2329 if(PyList_Check(elts))
2331 int sz=PyList_Size(elts);
2332 std::vector<int> ret(sz);
2333 for(int i=0;i<sz;i++)
2335 PyObject *elt=PyList_GetItem(elts,i);
2336 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2342 std::vector<int> ret(1);
2343 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2348 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2350 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2351 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2352 self->pushFields(tmp);
2355 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2357 if(elts && PySlice_Check(elts))
2359 Py_ssize_t strt=2,stp=2,step=2;
2360 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2361 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2362 self->destroyFieldsAtPos2(strt,stp,step);
2364 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2368 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2369 if(!idsToRemove.empty())
2370 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2376 class MEDFileParameter1TS : public RefCountObject
2379 void setIteration(int it);
2380 int getIteration() const;
2381 void setOrder(int order);
2382 int getOrder() const;
2383 void setTimeValue(double time);
2384 void setTime(int dt, int it, double time);
2385 double getTime(int& dt, int& it);
2386 double getTimeValue() const;
2389 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2392 void setValue(double val) throw(INTERP_KERNEL::Exception);
2393 double getValue() const throw(INTERP_KERNEL::Exception);
2394 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2397 std::string __str__() const throw(INTERP_KERNEL::Exception)
2399 return self->simpleRepr();
2404 class MEDFileParameterTinyInfo : public MEDFileWritable
2407 void setDescription(const char *name);
2408 std::string getDescription() const;
2409 void setTimeUnit(const char *unit);
2410 std::string getTimeUnit() const;
2413 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2416 static MEDFileParameterDouble1TS *New();
2417 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2418 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2419 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2420 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2421 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2422 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2423 std::string getName() const throw(INTERP_KERNEL::Exception);
2424 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2427 MEDFileParameterDouble1TS()
2429 return MEDFileParameterDouble1TS::New();
2432 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2434 return MEDFileParameterDouble1TS::New(fileName);
2437 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2439 return MEDFileParameterDouble1TS::New(fileName,paramName);
2442 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2444 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2447 std::string __str__() const throw(INTERP_KERNEL::Exception)
2449 return self->simpleRepr();
2452 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2455 bool ret0=self->isEqual(other,eps,what);
2456 PyObject *res=PyList_New(2);
2457 PyObject *ret0Py=ret0?Py_True:Py_False;
2459 PyList_SetItem(res,0,ret0Py);
2460 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2466 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2469 static MEDFileParameterMultiTS *New();
2470 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2471 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2472 std::string getName() const;
2473 void setName(const char *name);
2474 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2475 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2476 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2477 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2478 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2479 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2480 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2483 MEDFileParameterMultiTS()
2485 return MEDFileParameterMultiTS::New();
2488 MEDFileParameterMultiTS(const char *fileName)
2490 return MEDFileParameterMultiTS::New(fileName);
2493 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2495 return MEDFileParameterMultiTS::New(fileName,paramName);
2498 std::string __str__() const throw(INTERP_KERNEL::Exception)
2500 return self->simpleRepr();
2503 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2506 bool ret0=self->isEqual(other,eps,what);
2507 PyObject *res=PyList_New(2);
2508 PyObject *ret0Py=ret0?Py_True:Py_False;
2510 PyList_SetItem(res,0,ret0Py);
2511 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2515 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2519 std::vector<int> pos2;
2520 DataArrayInt *pos3=0;
2521 DataArrayIntTuple *pos4=0;
2522 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2527 self->eraseTimeStepIds(&pos1,&pos1+1);
2534 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2539 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2543 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2547 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2549 if(elt0 && PyInt_Check(elt0))
2551 int pos=PyInt_AS_LONG(elt0);
2554 else if(elt0 && PyTuple_Check(elt0))
2556 if(PyTuple_Size(elt0)==2)
2558 PyObject *o0=PyTuple_GetItem(elt0,0);
2559 PyObject *o1=PyTuple_GetItem(elt0,1);
2560 if(PyInt_Check(o0) && PyInt_Check(o1))
2562 int iter=PyInt_AS_LONG(o0);
2563 int order=PyInt_AS_LONG(o1);
2564 return self->getPosOfTimeStep(iter,order);
2567 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 !");
2570 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 !");
2572 else if(elt0 && PyFloat_Check(elt0))
2574 double val=PyFloat_AS_DOUBLE(elt0);
2575 return self->getPosGivenTime(val);
2578 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2581 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2583 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2589 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2591 if(PyList_Check(elts))
2593 int sz=PyList_Size(elts);
2594 std::vector<int> ret(sz);
2595 for(int i=0;i<sz;i++)
2597 PyObject *elt=PyList_GetItem(elts,i);
2598 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2604 std::vector<int> ret(1);
2605 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2610 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2612 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2613 if(!idsToRemove.empty())
2614 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2617 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2619 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2625 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2627 std::vector< std::pair<int,int> > res=self->getIterations();
2628 PyObject *ret=PyList_New(res.size());
2630 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2632 PyObject *elt=PyTuple_New(2);
2633 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2634 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2635 PyList_SetItem(ret,rk,elt);
2640 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2642 std::vector<double> res2;
2643 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2644 PyObject *ret=PyList_New(res.size());
2646 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2648 PyObject *elt=PyTuple_New(3);
2649 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2650 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2651 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2652 PyList_SetItem(ret,rk,elt);
2659 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2662 static MEDFileParameters *New();
2663 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2664 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2665 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2666 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2667 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2668 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2669 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2670 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2671 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2672 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2673 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2678 return MEDFileParameters::New();
2681 MEDFileParameters(const char *fileName)
2683 return MEDFileParameters::New(fileName);
2686 std::string __str__() const throw(INTERP_KERNEL::Exception)
2688 return self->simpleRepr();
2691 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2693 if(PyInt_Check(obj))
2695 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2700 else if(PyString_Check(obj))
2702 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2708 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2711 int __len__() const throw(INTERP_KERNEL::Exception)
2713 return self->getNumberOfParams();
2716 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2718 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2724 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2726 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2732 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2735 bool ret0=self->isEqual(other,eps,what);
2736 PyObject *res=PyList_New(2);
2737 PyObject *ret0Py=ret0?Py_True:Py_False;
2739 PyList_SetItem(res,0,ret0Py);
2740 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2746 class MEDFileData : public RefCountObject, public MEDFileWritable
2749 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2750 static MEDFileData *New();
2751 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2752 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2753 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2754 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2755 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2756 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2757 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2759 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2760 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2762 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2765 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2767 return MEDFileData::New(fileName);
2772 return MEDFileData::New();
2775 std::string __str__() const throw(INTERP_KERNEL::Exception)
2777 return self->simpleRepr();
2780 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2782 MEDFileMeshes *ret=self->getMeshes();
2788 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2790 MEDFileParameters *ret=self->getParams();
2796 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2798 MEDFileFields *ret=self->getFields();
2804 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2806 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2807 return self->changeMeshNames(modifTab);
2812 class SauvReader : public RefCountObject
2815 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2816 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2819 class SauvWriter : public RefCountObject
2822 static SauvWriter * New();
2823 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2824 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2825 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2826 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2831 class MEDFileMeshStruct;
2833 class MEDFileField1TSStructItem
2836 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2839 class MEDFileMeshStruct : public RefCountObject
2842 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2844 ~MEDFileMeshStruct();
2847 class MEDMeshMultiLev : public RefCountObject
2850 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2851 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2857 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2859 DataArrayInt *famIds(0);
2860 bool isWithoutCopy(false);
2861 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2862 PyObject *ret=PyTuple_New(2);
2863 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2865 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2866 PyTuple_SetItem(ret,1,ret1Py);
2870 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2872 DataArrayInt *numIds(0);
2873 bool isWithoutCopy(false);
2874 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2875 PyObject *ret=PyTuple_New(2);
2876 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2878 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2879 PyTuple_SetItem(ret,1,ret1Py);
2885 class MEDUMeshMultiLev : public MEDMeshMultiLev
2888 ~MEDUMeshMultiLev();
2892 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2894 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2895 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
2896 PyObject *ret0Py=ncc?Py_True:Py_False;
2898 PyObject *ret=PyTuple_New(7);
2899 PyTuple_SetItem(ret,0,ret0Py);
2900 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2901 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2902 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2903 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2904 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2905 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2911 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2914 ~MEDStructuredMeshMultiLev();
2917 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2920 ~MEDCMeshMultiLev();
2924 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2926 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2927 std::size_t sz(objs.size());
2928 PyObject *ret=PyList_New(sz);
2929 for(std::size_t i=0;i<sz;i++)
2930 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2936 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2939 ~MEDCurveLinearMeshMultiLev();
2943 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2945 DataArrayDouble *ret0(0);
2946 std::vector<int> ret1;
2947 self->buildVTUArrays(ret0,ret1);
2948 std::size_t sz(ret1.size());
2949 PyObject *ret=PyTuple_New(2);
2950 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2951 PyObject *ret1Py=PyList_New(sz);
2952 for(std::size_t i=0;i<sz;i++)
2953 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2954 PyTuple_SetItem(ret,1,ret1Py);
2960 class MEDFileFastCellSupportComparator : public RefCountObject
2963 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2964 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2965 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2967 ~MEDFileFastCellSupportComparator();