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 *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
760 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
763 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
766 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
768 std::vector<const DataArrayInt *> grps;
769 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
770 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
773 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
775 std::vector<const MEDCouplingUMesh *> ms;
776 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
777 self->setMeshes(ms,renum);
780 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
782 std::vector<const MEDCouplingUMesh *> ms;
783 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
784 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
787 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
789 std::vector<const MEDCouplingUMesh *> ms;
790 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
791 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
794 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
796 DataArrayDouble *ret=self->getCoords();
802 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
804 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
805 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
806 PyObject *ret=PyTuple_New(3);
807 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
808 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
809 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
813 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
815 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
821 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
823 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
824 std::size_t sz(tmp.size());
825 PyObject *ret=PyList_New(sz);
826 for(std::size_t i=0;i<sz;i++)
830 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
837 class MEDFileStructuredMesh : public MEDFileMesh
841 class MEDFileCMesh : public MEDFileStructuredMesh
844 static MEDFileCMesh *New();
845 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
846 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
847 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
852 return MEDFileCMesh::New();
855 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
857 return MEDFileCMesh::New(fileName,mrs);
860 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
862 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
865 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
867 const MEDCouplingCMesh *tmp=self->getMesh();
870 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
875 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
878 static MEDFileCurveLinearMesh *New();
879 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
880 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
881 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
884 MEDFileCurveLinearMesh()
886 return MEDFileCurveLinearMesh::New();
889 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
891 return MEDFileCurveLinearMesh::New(fileName,mrs);
894 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
896 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
899 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
901 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
904 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
909 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
912 static MEDFileMeshMultiTS *New();
913 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
914 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
915 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
916 std::string getName() const throw(INTERP_KERNEL::Exception);
917 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
918 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
923 return MEDFileMeshMultiTS::New();
926 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
928 return MEDFileMeshMultiTS::New(fileName);
931 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
933 return MEDFileMeshMultiTS::New(fileName,mName);
936 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
938 MEDFileMesh *ret=self->getOneTimeStep();
946 class MEDFileMeshesIterator
951 PyObject *next() throw(INTERP_KERNEL::Exception)
953 MEDFileMesh *ret=self->nextt();
957 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
961 PyErr_SetString(PyExc_StopIteration,"No more data.");
968 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
971 static MEDFileMeshes *New();
972 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
973 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
974 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
975 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
976 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
978 void resize(int newSize) throw(INTERP_KERNEL::Exception);
979 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
980 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
981 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
986 return MEDFileMeshes::New();
989 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
991 return MEDFileMeshes::New(fileName);
994 std::string __str__() const throw(INTERP_KERNEL::Exception)
996 return self->simpleRepr();
999 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1001 if(PyInt_Check(obj))
1003 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
1008 else if(PyString_Check(obj))
1010 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1016 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1019 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1021 self->setMeshAtPos(obj,mesh);
1025 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1027 return self->iterator();
1030 int __len__() const throw(INTERP_KERNEL::Exception)
1032 return self->getNumberOfMeshes();
1035 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1037 MEDFileMesh *ret=self->getMeshAtPos(i);
1042 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1044 MEDFileMesh *ret=self->getMeshWithName(mname);
1052 class MEDFileFieldLoc : public RefCountObject
1055 std::string getName() const;
1056 int getDimension() const;
1057 int getNumberOfGaussPoints() const;
1058 int getNumberOfPointsInCells() const;
1059 const std::vector<double>& getRefCoords() const;
1060 const std::vector<double>& getGaussCoords() const;
1061 const std::vector<double>& getGaussWeights() const;
1062 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1065 std::string __str__() const throw(INTERP_KERNEL::Exception)
1067 return self->repr();
1072 class MEDFileFieldGlobsReal
1075 void resetContent();
1076 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1077 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1078 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1079 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1080 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1081 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1082 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1083 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1084 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1085 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1086 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1087 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1088 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1089 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1090 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1091 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1092 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1093 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1094 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1095 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1096 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1097 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1098 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1099 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1100 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1101 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1104 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1106 const DataArrayInt *ret=self->getProfile(pflName);
1109 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1112 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1114 const DataArrayInt *ret=self->getProfileFromId(pflId);
1117 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1120 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1122 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1125 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1128 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1130 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1133 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1136 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1138 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1139 return convertVecPairVecStToPy(ret);
1142 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1144 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1145 return convertVecPairVecStToPy(ret);
1148 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1150 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1151 self->changePflsNames(v);
1154 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1156 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1157 self->changePflsRefsNamesGen(v);
1160 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1162 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1163 self->changePflsNamesInStruct(v);
1166 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1168 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1169 self->changeLocsNames(v);
1172 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1174 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1175 self->changeLocsRefsNamesGen(v);
1178 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1180 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1181 self->changeLocsNamesInStruct(v);
1184 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1186 std::ostringstream oss;
1187 self->simpleReprGlobs(oss);
1193 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1196 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1197 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1198 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1199 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1200 void loadArrays() throw(INTERP_KERNEL::Exception);
1201 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1202 void unloadArrays() throw(INTERP_KERNEL::Exception);
1203 int getDimension() const throw(INTERP_KERNEL::Exception);
1204 int getIteration() const throw(INTERP_KERNEL::Exception);
1205 int getOrder() const throw(INTERP_KERNEL::Exception);
1206 std::string getName() throw(INTERP_KERNEL::Exception);
1207 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1208 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1209 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1210 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1211 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1212 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1213 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1214 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1215 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1216 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1217 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1218 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1219 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1220 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1223 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1226 double tmp0=self->getTime(tmp1,tmp2);
1227 PyObject *res = PyList_New(3);
1228 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1229 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1230 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1234 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1236 std::pair<int,int> res=self->getDtIt();
1237 PyObject *elt=PyTuple_New(2);
1238 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1239 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1243 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1245 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1248 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1250 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1253 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1255 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1256 return self->changeMeshNames(modifTab);
1259 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1261 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1262 PyObject *ret2=PyList_New(ret.size());
1263 for(int i=0;i<(int)ret.size();i++)
1264 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1268 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1270 std::vector<int> ret1;
1271 int ret0=self->getNonEmptyLevels(mname,ret1);
1272 PyObject *elt=PyTuple_New(2);
1273 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1274 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1278 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1280 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1281 std::vector< std::vector<TypeOfField> > typesF;
1282 std::vector< std::vector<std::string> > pfls;
1283 std::vector< std::vector<std::string> > locs;
1284 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1286 PyObject *ret2=PyList_New(sz);
1287 for(int i=0;i<sz;i++)
1289 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1290 const std::vector<TypeOfField>& typesFI=typesF[i];
1291 const std::vector<std::string>& pflsI=pfls[i];
1292 const std::vector<std::string>& locsI=locs[i];
1293 PyObject *elt=PyTuple_New(2);
1294 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1295 int sz2=ret[i].size();
1296 PyObject *elt2=PyList_New(sz2);
1297 for(int j=0;j<sz2;j++)
1299 PyObject *elt3=PyTuple_New(4);
1300 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1301 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));
1302 PyTuple_SetItem(elt3,1,elt4);
1303 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1304 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1305 PyList_SetItem(elt2,j,elt3);
1307 PyTuple_SetItem(elt,1,elt2);
1308 PyList_SetItem(ret2,i,elt);
1313 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1315 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1316 std::size_t sz=ret.size();
1317 PyObject *retPy=PyList_New(sz);
1318 for(std::size_t i=0;i<sz;i++)
1319 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1323 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1325 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
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 ));
1335 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1338 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1339 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1340 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1341 static MEDFileField1TS *New();
1342 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1343 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1344 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1345 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1346 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1347 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1349 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1350 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1351 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1352 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1355 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1357 return MEDFileField1TS::New(fileName,loadAll);
1360 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1362 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1365 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1367 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1372 return MEDFileField1TS::New();
1375 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1377 const DataArrayDouble *arr=0;
1379 arr=field->getArray();
1380 self->copyTinyInfoFrom(field,arr);
1383 std::string __str__() const throw(INTERP_KERNEL::Exception)
1385 return self->simpleRepr();
1388 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1390 DataArrayInt *ret1=0;
1391 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1392 PyObject *ret=PyTuple_New(2);
1393 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1394 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1398 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1400 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1401 std::vector< std::vector<TypeOfField> > typesF;
1402 std::vector< std::vector<std::string> > pfls;
1403 std::vector< std::vector<std::string> > locs;
1404 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1406 PyObject *ret2=PyList_New(sz);
1407 for(int i=0;i<sz;i++)
1409 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1410 const std::vector<TypeOfField>& typesFI=typesF[i];
1411 const std::vector<std::string>& pflsI=pfls[i];
1412 const std::vector<std::string>& locsI=locs[i];
1413 PyObject *elt=PyTuple_New(2);
1414 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1415 int sz2=ret[i].size();
1416 PyObject *elt2=PyList_New(sz2);
1417 for(int j=0;j<sz2;j++)
1419 PyObject *elt3=PyTuple_New(4);
1420 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1421 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1422 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1423 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1424 PyList_SetItem(elt2,j,elt3);
1426 PyTuple_SetItem(elt,1,elt2);
1427 PyList_SetItem(ret2,i,elt);
1432 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1434 DataArrayDouble *ret=self->getUndergroundDataArray();
1440 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1442 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1443 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1446 PyObject *ret=PyTuple_New(2);
1447 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1448 std::size_t sz=elt1Cpp.size();
1449 PyObject *elt=PyList_New(sz);
1450 for(std::size_t i=0;i<sz;i++)
1452 PyObject *elt1=PyTuple_New(2);
1453 PyObject *elt2=PyTuple_New(2);
1454 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1455 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1456 PyObject *elt3=PyTuple_New(2);
1457 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1458 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1459 PyTuple_SetItem(elt1,0,elt2);
1460 PyTuple_SetItem(elt1,1,elt3);
1461 PyList_SetItem(elt,i,elt1);
1463 PyTuple_SetItem(ret,1,elt);
1469 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1472 static MEDFileIntField1TS *New();
1473 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1474 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1475 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1476 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1478 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1479 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1482 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1484 return MEDFileIntField1TS::New();
1487 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1489 return MEDFileIntField1TS::New(fileName,loadAll);
1492 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1494 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1497 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1499 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1502 std::string __str__() const throw(INTERP_KERNEL::Exception)
1504 return self->simpleRepr();
1507 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1509 DataArrayInt *ret1=0;
1510 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1511 PyObject *ret=PyTuple_New(2);
1512 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1513 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1517 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1519 DataArrayInt *ret1=0;
1520 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,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 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1529 DataArrayInt *ret1=0;
1530 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,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, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1539 DataArrayInt *ret1=0;
1540 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,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 *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1549 DataArrayInt *ret1=0;
1550 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,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 *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1559 DataArrayInt *ret1=0;
1560 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1561 PyObject *ret=PyTuple_New(2);
1562 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1563 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1567 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1569 DataArrayInt *ret=self->getUndergroundDataArray();
1577 class MEDFileAnyTypeFieldMultiTSIterator
1582 PyObject *next() throw(INTERP_KERNEL::Exception)
1584 MEDFileAnyTypeField1TS *ret=self->nextt();
1586 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1589 PyErr_SetString(PyExc_StopIteration,"No more data.");
1596 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1599 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1600 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1601 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1602 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1603 std::string getName() const throw(INTERP_KERNEL::Exception);
1604 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1605 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1606 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1607 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1608 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1609 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1610 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1611 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1612 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1613 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1614 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1615 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1616 void loadArrays() throw(INTERP_KERNEL::Exception);
1617 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1618 void unloadArrays() throw(INTERP_KERNEL::Exception);
1620 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1621 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1622 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1623 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1624 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1627 int __len__() const throw(INTERP_KERNEL::Exception)
1629 return self->getNumberOfTS();
1632 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1634 if(elt0 && PyInt_Check(elt0))
1636 int pos=PyInt_AS_LONG(elt0);
1639 else if(elt0 && PyTuple_Check(elt0))
1641 if(PyTuple_Size(elt0)==2)
1643 PyObject *o0=PyTuple_GetItem(elt0,0);
1644 PyObject *o1=PyTuple_GetItem(elt0,1);
1645 if(PyInt_Check(o0) && PyInt_Check(o1))
1647 int iter=PyInt_AS_LONG(o0);
1648 int order=PyInt_AS_LONG(o1);
1649 return self->getPosOfTimeStep(iter,order);
1652 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 !");
1655 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 !");
1657 else if(elt0 && PyFloat_Check(elt0))
1659 double val=PyFloat_AS_DOUBLE(elt0);
1660 return self->getPosGivenTime(val);
1663 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1666 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1668 std::vector< std::pair<int,int> > res=self->getIterations();
1669 PyObject *ret=PyList_New(res.size());
1671 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1673 PyObject *elt=PyTuple_New(2);
1674 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1675 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1676 PyList_SetItem(ret,rk,elt);
1681 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1683 std::vector<double> ret1;
1684 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1685 std::size_t sz=ret.size();
1686 PyObject *ret2=PyList_New(sz);
1687 for(std::size_t i=0;i<sz;i++)
1689 PyObject *elt=PyTuple_New(3);
1690 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1691 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1692 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1693 PyList_SetItem(ret2,i,elt);
1698 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1700 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1701 PyObject *ret2=PyList_New(ret.size());
1702 for(int i=0;i<(int)ret.size();i++)
1704 const std::vector<TypeOfField>& rett=ret[i];
1705 PyObject *ret3=PyList_New(rett.size());
1706 for(int j=0;j<(int)rett.size();j++)
1707 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1708 PyList_SetItem(ret2,i,ret3);
1713 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1715 std::vector<int> ret1;
1716 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1717 PyObject *elt=PyTuple_New(2);
1718 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1719 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1723 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1725 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1726 std::vector< std::vector<TypeOfField> > typesF;
1727 std::vector< std::vector<std::string> > pfls;
1728 std::vector< std::vector<std::string> > locs;
1729 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1731 PyObject *ret2=PyList_New(sz);
1732 for(int i=0;i<sz;i++)
1734 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1735 const std::vector<TypeOfField>& typesFI=typesF[i];
1736 const std::vector<std::string>& pflsI=pfls[i];
1737 const std::vector<std::string>& locsI=locs[i];
1738 PyObject *elt=PyTuple_New(2);
1739 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1740 int sz2=ret[i].size();
1741 PyObject *elt2=PyList_New(sz2);
1742 for(int j=0;j<sz2;j++)
1744 PyObject *elt3=PyTuple_New(4);
1745 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1746 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));
1747 PyTuple_SetItem(elt3,1,elt4);
1748 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1749 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1750 PyList_SetItem(elt2,j,elt3);
1752 PyTuple_SetItem(elt,1,elt2);
1753 PyList_SetItem(ret2,i,elt);
1758 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1760 if(PyList_Check(elts))
1762 int sz=PyList_Size(elts);
1763 std::vector<int> ret(sz);
1764 for(int i=0;i<sz;i++)
1766 PyObject *elt=PyList_GetItem(elts,i);
1767 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1773 std::vector<int> ret(1);
1774 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1779 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1781 if(PySlice_Check(elts))
1783 Py_ssize_t strt=2,stp=2,step=2;
1784 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1785 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1787 self->eraseTimeStepIds2(strt,stp,step);
1790 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1794 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1795 if(!idsToRemove.empty())
1796 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1800 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1804 std::vector<int> pos2;
1805 DataArrayInt *pos3=0;
1806 DataArrayIntTuple *pos4=0;
1807 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1812 self->eraseTimeStepIds(&pos1,&pos1+1);
1819 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1824 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1828 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1832 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1834 return self->iterator();
1837 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1839 if(elt0 && PyList_Check(elt0))
1841 int sz=PyList_Size(elt0);
1842 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1843 int *pt=da->getPointer();
1844 for(int i=0;i<sz;i++,pt++)
1846 PyObject *elt1=PyList_GetItem(elt0,i);
1847 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1849 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1851 else if(elt0 && PySlice_Check(elt0))
1853 Py_ssize_t strt=2,stp=2,step=2;
1854 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1855 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1856 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1858 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1861 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1864 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1866 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1867 return self->changeMeshNames(modifTab);
1870 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1872 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1873 std::size_t sz=ret.size();
1874 PyObject *retPy=PyList_New(sz);
1875 for(std::size_t i=0;i<sz;i++)
1876 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1880 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1882 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
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 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1892 std::vector<MEDFileAnyTypeField1TS *> tmp;
1893 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1894 self->pushBackTimeSteps(tmp);
1897 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1899 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1900 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1901 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1902 std::size_t sz=ret.size();
1903 PyObject *retPy=PyList_New(sz);
1904 for(std::size_t i=0;i<sz;i++)
1906 std::size_t sz2=ret[i].size();
1907 PyObject *ret1Py=PyList_New(sz2);
1908 for(std::size_t j=0;j<sz2;j++)
1910 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1913 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1915 PyList_SetItem(retPy,i,ret1Py);
1920 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1922 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1923 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1924 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1925 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1926 if(ret2.size()!=ret.size())
1928 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1929 throw INTERP_KERNEL::Exception(oss.str().c_str());
1931 std::size_t sz=ret.size();
1932 PyObject *retPy=PyList_New(sz);
1933 for(std::size_t i=0;i<sz;i++)
1935 std::size_t sz2=ret[i].size();
1936 PyObject *ret0Py=PyTuple_New(2);
1937 PyObject *ret1Py=PyList_New(sz2);
1938 for(std::size_t j=0;j<sz2;j++)
1940 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1943 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1945 PyTuple_SetItem(ret0Py,0,ret1Py);
1946 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1947 PyList_SetItem(retPy,i,ret0Py);
1954 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1957 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1958 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1959 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1961 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1962 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1963 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1964 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1965 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1967 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1968 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1969 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1972 MEDFileFieldMultiTS()
1974 return MEDFileFieldMultiTS::New();
1977 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1979 return MEDFileFieldMultiTS::New(fileName,loadAll);
1982 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1984 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
1987 std::string __str__() const throw(INTERP_KERNEL::Exception)
1989 return self->simpleRepr();
1992 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1994 DataArrayInt *ret1=0;
1995 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1996 PyObject *ret=PyTuple_New(2);
1997 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1998 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2002 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
2004 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2005 std::vector< std::vector<TypeOfField> > typesF;
2006 std::vector< std::vector<std::string> > pfls;
2007 std::vector< std::vector<std::string> > locs;
2008 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2010 PyObject *ret2=PyList_New(sz);
2011 for(int i=0;i<sz;i++)
2013 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2014 const std::vector<TypeOfField>& typesFI=typesF[i];
2015 const std::vector<std::string>& pflsI=pfls[i];
2016 const std::vector<std::string>& locsI=locs[i];
2017 PyObject *elt=PyTuple_New(2);
2018 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2019 int sz2=ret[i].size();
2020 PyObject *elt2=PyList_New(sz2);
2021 for(int j=0;j<sz2;j++)
2023 PyObject *elt3=PyTuple_New(4);
2024 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2025 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2026 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2027 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2028 PyList_SetItem(elt2,j,elt3);
2030 PyTuple_SetItem(elt,1,elt2);
2031 PyList_SetItem(ret2,i,elt);
2035 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2037 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2043 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2045 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2046 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2049 PyObject *ret=PyTuple_New(2);
2050 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2051 std::size_t sz=elt1Cpp.size();
2052 PyObject *elt=PyList_New(sz);
2053 for(std::size_t i=0;i<sz;i++)
2055 PyObject *elt1=PyTuple_New(2);
2056 PyObject *elt2=PyTuple_New(2);
2057 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2058 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2059 PyObject *elt3=PyTuple_New(2);
2060 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2061 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2062 PyTuple_SetItem(elt1,0,elt2);
2063 PyTuple_SetItem(elt1,1,elt3);
2064 PyList_SetItem(elt,i,elt1);
2066 PyTuple_SetItem(ret,1,elt);
2072 class MEDFileFieldsIterator
2077 PyObject *next() throw(INTERP_KERNEL::Exception)
2079 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2081 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2084 PyErr_SetString(PyExc_StopIteration,"No more data.");
2091 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2094 static MEDFileIntFieldMultiTS *New();
2095 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2096 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2098 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2099 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2100 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2103 MEDFileIntFieldMultiTS()
2105 return MEDFileIntFieldMultiTS::New();
2108 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2110 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2113 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2115 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2118 std::string __str__() const throw(INTERP_KERNEL::Exception)
2120 return self->simpleRepr();
2123 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2125 DataArrayInt *ret1=0;
2126 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2127 PyObject *ret=PyTuple_New(2);
2128 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2129 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2133 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2135 DataArrayInt *ret1=0;
2136 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,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 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2145 DataArrayInt *ret1=0;
2146 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,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, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2155 DataArrayInt *ret1=0;
2156 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,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 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2165 DataArrayInt *ret1=0;
2166 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,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 *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2175 DataArrayInt *ret1=0;
2176 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2177 PyObject *ret=PyTuple_New(2);
2178 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2179 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2185 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2193 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2196 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2197 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2198 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2199 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2200 void loadArrays() throw(INTERP_KERNEL::Exception);
2201 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2202 void unloadArrays() throw(INTERP_KERNEL::Exception);
2203 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2204 int getNumberOfFields() const;
2205 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2206 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2208 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2209 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2210 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2211 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2212 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2213 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2214 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2215 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2220 return MEDFileFields::New();
2223 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2225 return MEDFileFields::New(fileName,loadAll);
2228 std::string __str__() const throw(INTERP_KERNEL::Exception)
2230 return self->simpleRepr();
2233 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2236 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2237 PyObject *ret=PyTuple_New(2);
2238 PyObject *ret_0=PyList_New(ret0.size());
2240 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2242 PyObject *elt=PyTuple_New(2);
2243 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2244 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2245 PyList_SetItem(ret_0,rk,elt);
2247 PyTuple_SetItem(ret,0,ret_0);
2248 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2249 PyTuple_SetItem(ret,1,ret_1);
2253 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2255 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2256 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2259 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2261 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2262 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2265 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2267 if(obj && PyList_Check(obj))
2269 int sz=PyList_Size(obj);
2270 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2271 int *pt=da->getPointer();
2272 for(int i=0;i<sz;i++,pt++)
2274 PyObject *elt1=PyList_GetItem(obj,i);
2275 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2277 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2280 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2283 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2285 self->setFieldAtPos(obj,field);
2289 int __len__() const throw(INTERP_KERNEL::Exception)
2291 return self->getNumberOfFields();
2294 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2296 return self->iterator();
2299 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2301 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2302 return self->changeMeshNames(modifTab);
2305 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2307 if(elt0 && PyInt_Check(elt0))
2309 return PyInt_AS_LONG(elt0);
2311 else if(elt0 && PyString_Check(elt0))
2312 return self->getPosFromFieldName(PyString_AsString(elt0));
2314 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2317 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2319 if(PyList_Check(elts))
2321 int sz=PyList_Size(elts);
2322 std::vector<int> ret(sz);
2323 for(int i=0;i<sz;i++)
2325 PyObject *elt=PyList_GetItem(elts,i);
2326 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2332 std::vector<int> ret(1);
2333 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2338 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2340 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2341 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2342 self->pushFields(tmp);
2345 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2347 if(elts && PySlice_Check(elts))
2349 Py_ssize_t strt=2,stp=2,step=2;
2350 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2351 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2352 self->destroyFieldsAtPos2(strt,stp,step);
2354 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2358 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2359 if(!idsToRemove.empty())
2360 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2366 class MEDFileParameter1TS : public RefCountObject
2369 void setIteration(int it);
2370 int getIteration() const;
2371 void setOrder(int order);
2372 int getOrder() const;
2373 void setTimeValue(double time);
2374 void setTime(int dt, int it, double time);
2375 double getTime(int& dt, int& it);
2376 double getTimeValue() const;
2379 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2382 void setValue(double val) throw(INTERP_KERNEL::Exception);
2383 double getValue() const throw(INTERP_KERNEL::Exception);
2384 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2387 std::string __str__() const throw(INTERP_KERNEL::Exception)
2389 return self->simpleRepr();
2394 class MEDFileParameterTinyInfo : public MEDFileWritable
2397 void setDescription(const char *name);
2398 std::string getDescription() const;
2399 void setTimeUnit(const char *unit);
2400 std::string getTimeUnit() const;
2403 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2406 static MEDFileParameterDouble1TS *New();
2407 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2408 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2409 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2410 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2411 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2412 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2413 std::string getName() const throw(INTERP_KERNEL::Exception);
2414 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2417 MEDFileParameterDouble1TS()
2419 return MEDFileParameterDouble1TS::New();
2422 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2424 return MEDFileParameterDouble1TS::New(fileName);
2427 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2429 return MEDFileParameterDouble1TS::New(fileName,paramName);
2432 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2434 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2437 std::string __str__() const throw(INTERP_KERNEL::Exception)
2439 return self->simpleRepr();
2442 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2445 bool ret0=self->isEqual(other,eps,what);
2446 PyObject *res=PyList_New(2);
2447 PyObject *ret0Py=ret0?Py_True:Py_False;
2449 PyList_SetItem(res,0,ret0Py);
2450 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2456 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2459 static MEDFileParameterMultiTS *New();
2460 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2461 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2462 std::string getName() const;
2463 void setName(const char *name);
2464 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2465 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2466 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2467 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2468 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2469 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2470 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2473 MEDFileParameterMultiTS()
2475 return MEDFileParameterMultiTS::New();
2478 MEDFileParameterMultiTS(const char *fileName)
2480 return MEDFileParameterMultiTS::New(fileName);
2483 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2485 return MEDFileParameterMultiTS::New(fileName,paramName);
2488 std::string __str__() const throw(INTERP_KERNEL::Exception)
2490 return self->simpleRepr();
2493 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2496 bool ret0=self->isEqual(other,eps,what);
2497 PyObject *res=PyList_New(2);
2498 PyObject *ret0Py=ret0?Py_True:Py_False;
2500 PyList_SetItem(res,0,ret0Py);
2501 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2505 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2509 std::vector<int> pos2;
2510 DataArrayInt *pos3=0;
2511 DataArrayIntTuple *pos4=0;
2512 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2517 self->eraseTimeStepIds(&pos1,&pos1+1);
2524 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2529 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2533 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2537 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2539 if(elt0 && PyInt_Check(elt0))
2541 int pos=PyInt_AS_LONG(elt0);
2544 else if(elt0 && PyTuple_Check(elt0))
2546 if(PyTuple_Size(elt0)==2)
2548 PyObject *o0=PyTuple_GetItem(elt0,0);
2549 PyObject *o1=PyTuple_GetItem(elt0,1);
2550 if(PyInt_Check(o0) && PyInt_Check(o1))
2552 int iter=PyInt_AS_LONG(o0);
2553 int order=PyInt_AS_LONG(o1);
2554 return self->getPosOfTimeStep(iter,order);
2557 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 !");
2560 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 !");
2562 else if(elt0 && PyFloat_Check(elt0))
2564 double val=PyFloat_AS_DOUBLE(elt0);
2565 return self->getPosGivenTime(val);
2568 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2571 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2573 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2579 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2581 if(PyList_Check(elts))
2583 int sz=PyList_Size(elts);
2584 std::vector<int> ret(sz);
2585 for(int i=0;i<sz;i++)
2587 PyObject *elt=PyList_GetItem(elts,i);
2588 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2594 std::vector<int> ret(1);
2595 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2600 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2602 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2603 if(!idsToRemove.empty())
2604 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2607 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2609 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2615 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2617 std::vector< std::pair<int,int> > res=self->getIterations();
2618 PyObject *ret=PyList_New(res.size());
2620 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2622 PyObject *elt=PyTuple_New(2);
2623 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2624 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2625 PyList_SetItem(ret,rk,elt);
2630 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2632 std::vector<double> res2;
2633 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2634 PyObject *ret=PyList_New(res.size());
2636 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2638 PyObject *elt=PyTuple_New(3);
2639 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2640 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2641 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2642 PyList_SetItem(ret,rk,elt);
2649 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2652 static MEDFileParameters *New();
2653 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2654 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2655 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2656 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2657 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2658 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2659 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2660 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2661 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2662 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2663 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2668 return MEDFileParameters::New();
2671 MEDFileParameters(const char *fileName)
2673 return MEDFileParameters::New(fileName);
2676 std::string __str__() const throw(INTERP_KERNEL::Exception)
2678 return self->simpleRepr();
2681 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2683 if(PyInt_Check(obj))
2685 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2690 else if(PyString_Check(obj))
2692 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2698 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2701 int __len__() const throw(INTERP_KERNEL::Exception)
2703 return self->getNumberOfParams();
2706 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2708 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2714 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2716 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2722 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2725 bool ret0=self->isEqual(other,eps,what);
2726 PyObject *res=PyList_New(2);
2727 PyObject *ret0Py=ret0?Py_True:Py_False;
2729 PyList_SetItem(res,0,ret0Py);
2730 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2736 class MEDFileData : public RefCountObject, public MEDFileWritable
2739 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2740 static MEDFileData *New();
2741 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2742 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2743 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2744 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2745 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2746 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2747 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2749 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2750 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2752 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2755 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2757 return MEDFileData::New(fileName);
2762 return MEDFileData::New();
2765 std::string __str__() const throw(INTERP_KERNEL::Exception)
2767 return self->simpleRepr();
2770 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2772 MEDFileMeshes *ret=self->getMeshes();
2778 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2780 MEDFileParameters *ret=self->getParams();
2786 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2788 MEDFileFields *ret=self->getFields();
2794 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2796 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2797 return self->changeMeshNames(modifTab);
2802 class SauvReader : public RefCountObject
2805 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2806 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2809 class SauvWriter : public RefCountObject
2812 static SauvWriter * New();
2813 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2814 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2819 class MEDFileMeshStruct;
2821 class MEDFileField1TSStructItem
2824 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2827 class MEDFileMeshStruct : public RefCountObject
2830 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2832 ~MEDFileMeshStruct();
2835 class MEDMeshMultiLev : public RefCountObject
2838 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2839 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2845 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2847 DataArrayInt *famIds(0);
2848 bool isWithoutCopy(false);
2849 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2850 PyObject *ret=PyTuple_New(2);
2851 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2853 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2854 PyTuple_SetItem(ret,1,ret1Py);
2858 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2860 DataArrayInt *numIds(0);
2861 bool isWithoutCopy(false);
2862 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2863 PyObject *ret=PyTuple_New(2);
2864 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2866 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2867 PyTuple_SetItem(ret,1,ret1Py);
2873 class MEDUMeshMultiLev : public MEDMeshMultiLev
2876 ~MEDUMeshMultiLev();
2880 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2882 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2883 self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces);
2884 PyObject *ret=PyTuple_New(6);
2885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2886 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2887 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2888 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2889 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2890 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2896 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2899 ~MEDStructuredMeshMultiLev();
2902 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2905 ~MEDCMeshMultiLev();
2909 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2911 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2912 std::size_t sz(objs.size());
2913 PyObject *ret=PyList_New(sz);
2914 for(std::size_t i=0;i<sz;i++)
2915 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2921 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2924 ~MEDCurveLinearMeshMultiLev();
2928 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2930 DataArrayDouble *ret0(0);
2931 std::vector<int> ret1;
2932 self->buildVTUArrays(ret0,ret1);
2933 std::size_t sz(ret1.size());
2934 PyObject *ret=PyTuple_New(2);
2935 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2936 PyObject *ret1Py=PyList_New(sz);
2937 for(std::size_t i=0;i<sz;i++)
2938 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2939 PyTuple_SetItem(ret,1,ret1Py);
2945 class MEDFileFastCellSupportComparator : public RefCountObject
2948 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2949 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2950 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2952 ~MEDFileFastCellSupportComparator();