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::ReadField;
76 %newobject MEDLoader::ReadFieldCell;
77 %newobject MEDLoader::ReadFieldNode;
78 %newobject MEDLoader::ReadFieldGauss;
79 %newobject MEDLoader::ReadFieldGaussNE;
80 %newobject ParaMEDMEM::MEDFileMesh::New;
81 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
82 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
83 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
85 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
94 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
95 %newobject ParaMEDMEM::MEDFileUMesh::New;
96 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
97 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
98 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
99 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
100 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
101 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
102 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
103 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
104 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
105 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
106 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
108 %newobject ParaMEDMEM::MEDFileCMesh::New;
109 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
110 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
111 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
112 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
113 %newobject ParaMEDMEM::MEDFileMeshes::New;
114 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
115 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
116 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
117 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
118 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
120 %newobject ParaMEDMEM::MEDFileFields::New;
121 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
122 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
123 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
124 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
125 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
126 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
127 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
128 %newobject ParaMEDMEM::MEDFileFields::__iter__;
130 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
131 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
132 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
133 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
134 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
135 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
136 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
137 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
138 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
139 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
140 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
141 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
142 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
143 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
144 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
145 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
146 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
148 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
149 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
150 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
151 %newobject ParaMEDMEM::MEDFileField1TS::New;
152 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
153 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
154 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
155 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
156 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
157 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
158 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
159 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
160 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
162 %newobject ParaMEDMEM::MEDFileData::New;
163 %newobject ParaMEDMEM::MEDFileData::deepCpy;
164 %newobject ParaMEDMEM::MEDFileData::getMeshes;
165 %newobject ParaMEDMEM::MEDFileData::getFields;
166 %newobject ParaMEDMEM::MEDFileData::getParams;
168 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
169 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
170 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
171 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
172 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
173 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
174 %newobject ParaMEDMEM::MEDFileParameters::New;
175 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
176 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
177 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
178 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
180 %newobject ParaMEDMEM::SauvWriter::New;
181 %newobject ParaMEDMEM::SauvReader::New;
182 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
184 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
185 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
186 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
187 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
189 %feature("unref") MEDFileMesh "$this->decrRef();"
190 %feature("unref") MEDFileUMesh "$this->decrRef();"
191 %feature("unref") MEDFileCMesh "$this->decrRef();"
192 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
193 %feature("unref") MEDFileMeshes "$this->decrRef();"
194 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
195 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
196 %feature("unref") MEDFileField1TS "$this->decrRef();"
197 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
198 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
199 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
200 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
201 %feature("unref") MEDFileFields "$this->decrRef();"
202 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
203 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
204 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
205 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileParameters "$this->decrRef();"
207 %feature("unref") MEDFileData "$this->decrRef();"
208 %feature("unref") SauvReader "$this->decrRef();"
209 %feature("unref") SauvWriter "$this->decrRef();"
210 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
211 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
212 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
213 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
214 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
215 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
220 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
221 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
222 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
223 static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
224 static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
225 static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
226 static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
227 static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
228 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
229 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
230 static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
231 static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
235 static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
238 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
240 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
241 PyObject *ret=PyList_New(res.size());
243 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
245 PyObject *elt=PyTuple_New(2);
246 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
247 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
248 PyList_SetItem(ret,rk,elt);
253 static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
255 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
256 PyObject *ret=PyList_New(res.size());
258 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
260 PyObject *elt=PyTuple_New(3);
261 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
262 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
263 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
264 PyList_SetItem(ret,rk,elt);
269 static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
271 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
272 PyObject *ret=PyList_New(res.size());
274 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
276 PyObject *elt=PyTuple_New(2);
277 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
278 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
279 PyList_SetItem(ret,rk,elt);
283 static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
285 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
286 PyObject *ret=PyList_New(res.size());
288 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
290 PyObject *elt=PyTuple_New(2);
291 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
292 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
293 PyList_SetItem(ret,rk,elt);
297 static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
299 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
300 PyObject *ret=PyList_New(res.size());
302 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
304 PyObject *elt=PyTuple_New(2);
305 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
306 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
307 PyList_SetItem(ret,rk,elt);
311 static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
313 int meshDim,spaceDim,numberOfNodes;
314 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
315 PyObject *ret=PyTuple_New(4);
316 PyObject *elt0=PyList_New(res.size());
318 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
320 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
322 PyObject *elt1=PyList_New(obj2.size());
323 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
325 PyObject *elt2=PyTuple_New(2);
326 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
327 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
328 PyList_SetItem(elt1,j,elt2);
330 PyList_SetItem(elt0,i,elt1);
332 PyTuple_SetItem(ret,0,elt0);
333 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
334 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
335 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
338 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
339 const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
341 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
342 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
343 return convertFieldDoubleVecToPy(res);
345 static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
347 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
348 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
349 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
351 static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
353 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
354 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
355 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
357 static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
359 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
360 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
361 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
363 static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
365 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
367 PyObject *ret=PyList_New(size);
368 for(int i=0;i<size;i++)
369 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
372 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
374 std::vector<std::string> grps;
375 converPyListToVecString(li,grps);
376 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
378 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
380 std::vector<std::string> fams;
381 converPyListToVecString(li,fams);
382 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
385 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
386 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
387 static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
388 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);
389 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
390 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
391 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
392 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
393 static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
394 static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
395 static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
396 static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
397 static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
402 class MEDFileWritable
405 void copyOptionsFrom(const MEDFileWritable& other) const;
406 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
407 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
408 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
409 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
412 class MEDFileMeshReadSelector
415 MEDFileMeshReadSelector();
416 MEDFileMeshReadSelector(unsigned int code);
417 unsigned int getCode() const;
418 void setCode(unsigned int newCode);
419 bool isCellFamilyFieldReading() const;
420 bool isNodeFamilyFieldReading() const;
421 bool isCellNameFieldReading() const;
422 bool isNodeNameFieldReading() const;
423 bool isCellNumFieldReading() const;
424 bool isNodeNumFieldReading() const;
425 void setCellFamilyFieldReading(bool b);
426 void setNodeFamilyFieldReading(bool b);
427 void setCellNameFieldReading(bool b);
428 void setNodeNameFieldReading(bool b);
429 void setCellNumFieldReading(bool b);
430 void setNodeNumFieldReading(bool b);
433 std::string __str__() const throw(INTERP_KERNEL::Exception)
435 std::ostringstream oss;
440 std::string __repr__() const throw(INTERP_KERNEL::Exception)
442 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
448 class MEDFileMesh : public RefCountObject, public MEDFileWritable
451 static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
452 static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
453 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
454 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
455 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
456 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
457 void setName(const char *name);
458 std::string getName();
459 const char *getUnivName() const;
460 bool getUnivNameWrStatus() const;
461 void setUnivNameWrStatus(bool newStatus);
462 void setDescription(const char *name);
463 std::string getDescription() const;
464 void setOrder(int order);
465 int getOrder() const;
466 void setIteration(int it);
468 void setTimeValue(double time);
469 void setTime(int dt, int it, double time);
470 double getTimeValue() const;
471 void setTimeUnit(const char *unit);
472 const char *getTimeUnit() const;
473 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
474 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
475 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
476 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
477 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
478 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
479 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
480 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
481 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
483 bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
484 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
485 bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
486 void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
487 void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
488 void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
489 void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
490 virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
491 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
492 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
493 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
494 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
495 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
496 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
497 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
498 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
499 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
500 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
501 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
502 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
503 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
504 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
505 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
506 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
507 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
508 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
509 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
510 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
511 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
512 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
513 void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
514 void setFamilyInfo(const std::map<std::string,int>& info);
515 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
516 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
517 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
518 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
519 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
520 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
521 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
522 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
523 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
524 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
525 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
526 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
527 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
528 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
529 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
530 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
531 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
532 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
533 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
534 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
535 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
537 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
538 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
539 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
540 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
541 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
542 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
543 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
544 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
545 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
546 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
547 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
548 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
551 std::string __str__() const throw(INTERP_KERNEL::Exception)
553 return self->simpleRepr();
556 PyObject *getTime() throw(INTERP_KERNEL::Exception)
559 double tmp0=self->getTime(tmp1,tmp2);
560 PyObject *res = PyList_New(3);
561 PyList_SetItem(res,0,SWIG_From_int(tmp1));
562 PyList_SetItem(res,1,SWIG_From_int(tmp2));
563 PyList_SetItem(res,2,SWIG_From_double(tmp0));
567 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
570 bool ret0=self->isEqual(other,eps,what);
571 PyObject *res=PyList_New(2);
572 PyObject *ret0Py=ret0?Py_True:Py_False;
574 PyList_SetItem(res,0,ret0Py);
575 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
579 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
582 bool ret0=self->areFamsEqual(other,what);
583 PyObject *res=PyList_New(2);
584 PyObject *ret0Py=ret0?Py_True:Py_False;
586 PyList_SetItem(res,0,ret0Py);
587 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
591 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
594 bool ret0=self->areGrpsEqual(other,what);
595 PyObject *res=PyList_New(2);
596 PyObject *ret0Py=ret0?Py_True:Py_False;
598 PyList_SetItem(res,0,ret0Py);
599 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
603 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
605 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
608 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
611 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
613 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
616 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
619 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
621 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
624 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
627 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
630 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
631 PyObject *ret=PyTuple_New(2);
632 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
633 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
637 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
639 DataArrayInt *ret3=0;
640 std::vector<int> ret1,ret2;
641 bool ret0=self->unPolyze(ret1,ret2,ret3);
642 PyObject *ret=PyTuple_New(4);
643 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
645 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
646 for(int j=0;j<(int)ret1.size()/3;j++)
648 PyObject *retLev2=PyList_New(3);
649 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
650 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
651 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
652 PyList_SetItem(retLev1_0,j,retLev2);
654 PyTuple_SetItem(ret,1,retLev1_0);
656 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
657 for(int j=0;j<(int)ret2.size()/3;j++)
659 PyObject *retLev2=PyList_New(3);
660 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
661 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
662 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
663 PyList_SetItem(retLev1_1,j,retLev2);
665 PyTuple_SetItem(ret,2,retLev1_1);
667 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
673 class MEDFileUMesh : public MEDFileMesh
676 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
677 static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
678 static MEDFileUMesh *New();
680 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
682 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
683 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
684 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
685 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
686 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
687 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
688 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
689 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
690 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
691 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
692 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
693 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
694 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
695 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
696 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
697 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
698 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
699 DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
700 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
701 DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
702 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
703 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
704 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
705 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
706 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
707 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
709 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
710 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
711 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
712 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
713 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
714 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
715 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
716 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
717 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
720 MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
722 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
725 MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
727 return MEDFileUMesh::New(fileName,mrs);
732 return MEDFileUMesh::New();
735 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
737 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
740 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
743 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
745 std::vector<const DataArrayInt *> grps;
746 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
747 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
750 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
752 std::vector<const MEDCouplingUMesh *> ms;
753 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
754 self->setMeshes(ms,renum);
757 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
759 std::vector<const MEDCouplingUMesh *> ms;
760 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
761 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
764 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
766 std::vector<const MEDCouplingUMesh *> ms;
767 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
768 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
771 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
773 DataArrayDouble *ret=self->getCoords();
779 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
781 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
782 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
783 PyObject *ret=PyTuple_New(3);
784 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
785 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
786 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
790 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
792 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
798 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
800 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
801 std::size_t sz(tmp.size());
802 PyObject *ret=PyList_New(sz);
803 for(std::size_t i=0;i<sz;i++)
807 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
814 class MEDFileStructuredMesh : public MEDFileMesh
818 class MEDFileCMesh : public MEDFileStructuredMesh
821 static MEDFileCMesh *New();
822 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
823 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
824 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
829 return MEDFileCMesh::New();
832 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
834 return MEDFileCMesh::New(fileName,mrs);
837 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
839 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
842 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
844 const MEDCouplingCMesh *tmp=self->getMesh();
847 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
852 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
855 static MEDFileCurveLinearMesh *New();
856 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
857 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
858 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
861 MEDFileCurveLinearMesh()
863 return MEDFileCurveLinearMesh::New();
866 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
868 return MEDFileCurveLinearMesh::New(fileName,mrs);
871 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
873 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
876 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
878 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
881 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
886 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
889 static MEDFileMeshMultiTS *New();
890 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
891 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
892 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
893 std::string getName() const throw(INTERP_KERNEL::Exception);
894 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
895 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
900 return MEDFileMeshMultiTS::New();
903 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
905 return MEDFileMeshMultiTS::New(fileName);
908 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
910 return MEDFileMeshMultiTS::New(fileName,mName);
913 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
915 MEDFileMesh *ret=self->getOneTimeStep();
923 class MEDFileMeshesIterator
928 PyObject *next() throw(INTERP_KERNEL::Exception)
930 MEDFileMesh *ret=self->nextt();
934 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
938 PyErr_SetString(PyExc_StopIteration,"No more data.");
945 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
948 static MEDFileMeshes *New();
949 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
950 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
951 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
952 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
953 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
955 void resize(int newSize) throw(INTERP_KERNEL::Exception);
956 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
957 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
958 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
963 return MEDFileMeshes::New();
966 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
968 return MEDFileMeshes::New(fileName);
971 std::string __str__() const throw(INTERP_KERNEL::Exception)
973 return self->simpleRepr();
976 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
980 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
985 else if(PyString_Check(obj))
987 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
993 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
996 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
998 self->setMeshAtPos(obj,mesh);
1002 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1004 return self->iterator();
1007 int __len__() const throw(INTERP_KERNEL::Exception)
1009 return self->getNumberOfMeshes();
1012 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1014 MEDFileMesh *ret=self->getMeshAtPos(i);
1019 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1021 MEDFileMesh *ret=self->getMeshWithName(mname);
1029 class MEDFileFieldLoc : public RefCountObject
1032 std::string getName() const;
1033 int getDimension() const;
1034 int getNumberOfGaussPoints() const;
1035 int getNumberOfPointsInCells() const;
1036 const std::vector<double>& getRefCoords() const;
1037 const std::vector<double>& getGaussCoords() const;
1038 const std::vector<double>& getGaussWeights() const;
1039 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1042 std::string __str__() const throw(INTERP_KERNEL::Exception)
1044 return self->repr();
1049 class MEDFileFieldGlobsReal
1052 void resetContent();
1053 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1054 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1055 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1056 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1057 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1058 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1059 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1060 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1061 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1062 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1063 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1064 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1065 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1066 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1067 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1068 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1069 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1070 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1071 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1072 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1073 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1074 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1075 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1076 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1077 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1078 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1081 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1083 const DataArrayInt *ret=self->getProfile(pflName);
1086 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1089 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1091 const DataArrayInt *ret=self->getProfileFromId(pflId);
1094 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1097 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1099 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1102 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1105 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1107 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1110 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1113 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1115 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1116 return convertVecPairVecStToPy(ret);
1119 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1121 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1122 return convertVecPairVecStToPy(ret);
1125 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1127 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1128 self->changePflsNames(v);
1131 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1133 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1134 self->changePflsRefsNamesGen(v);
1137 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1139 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1140 self->changePflsNamesInStruct(v);
1143 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1145 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1146 self->changeLocsNames(v);
1149 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1151 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1152 self->changeLocsRefsNamesGen(v);
1155 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1157 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1158 self->changeLocsNamesInStruct(v);
1161 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1163 std::ostringstream oss;
1164 self->simpleReprGlobs(oss);
1170 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1173 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1174 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1175 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1176 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1177 void loadArrays() throw(INTERP_KERNEL::Exception);
1178 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1179 void unloadArrays() throw(INTERP_KERNEL::Exception);
1180 int getDimension() const throw(INTERP_KERNEL::Exception);
1181 int getIteration() const throw(INTERP_KERNEL::Exception);
1182 int getOrder() const throw(INTERP_KERNEL::Exception);
1183 std::string getName() throw(INTERP_KERNEL::Exception);
1184 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1185 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1186 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1187 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1188 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1189 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1190 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1191 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1192 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1193 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1194 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1195 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1196 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1197 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1200 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1203 double tmp0=self->getTime(tmp1,tmp2);
1204 PyObject *res = PyList_New(3);
1205 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1206 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1207 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1211 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1213 std::pair<int,int> res=self->getDtIt();
1214 PyObject *elt=PyTuple_New(2);
1215 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1216 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1220 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1222 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1225 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1227 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1230 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1232 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1233 return self->changeMeshNames(modifTab);
1236 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1238 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1239 PyObject *ret2=PyList_New(ret.size());
1240 for(int i=0;i<(int)ret.size();i++)
1241 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1245 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1247 std::vector<int> ret1;
1248 int ret0=self->getNonEmptyLevels(mname,ret1);
1249 PyObject *elt=PyTuple_New(2);
1250 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1251 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1255 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1257 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1258 std::vector< std::vector<TypeOfField> > typesF;
1259 std::vector< std::vector<std::string> > pfls;
1260 std::vector< std::vector<std::string> > locs;
1261 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1263 PyObject *ret2=PyList_New(sz);
1264 for(int i=0;i<sz;i++)
1266 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1267 const std::vector<TypeOfField>& typesFI=typesF[i];
1268 const std::vector<std::string>& pflsI=pfls[i];
1269 const std::vector<std::string>& locsI=locs[i];
1270 PyObject *elt=PyTuple_New(2);
1271 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1272 int sz2=ret[i].size();
1273 PyObject *elt2=PyList_New(sz2);
1274 for(int j=0;j<sz2;j++)
1276 PyObject *elt3=PyTuple_New(4);
1277 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1278 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));
1279 PyTuple_SetItem(elt3,1,elt4);
1280 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1281 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1282 PyList_SetItem(elt2,j,elt3);
1284 PyTuple_SetItem(elt,1,elt2);
1285 PyList_SetItem(ret2,i,elt);
1290 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1292 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1293 std::size_t sz=ret.size();
1294 PyObject *retPy=PyList_New(sz);
1295 for(std::size_t i=0;i<sz;i++)
1296 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1300 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1302 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1303 std::size_t sz=ret.size();
1304 PyObject *retPy=PyList_New(sz);
1305 for(std::size_t i=0;i<sz;i++)
1306 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1312 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1315 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1316 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1317 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1318 static MEDFileField1TS *New();
1319 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1320 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1321 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1322 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1323 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1324 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1326 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1327 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1328 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1329 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1332 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1334 return MEDFileField1TS::New(fileName,loadAll);
1337 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1339 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1342 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1344 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1349 return MEDFileField1TS::New();
1352 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1354 const DataArrayDouble *arr=0;
1356 arr=field->getArray();
1357 self->copyTinyInfoFrom(field,arr);
1360 std::string __str__() const throw(INTERP_KERNEL::Exception)
1362 return self->simpleRepr();
1365 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1367 DataArrayInt *ret1=0;
1368 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1369 PyObject *ret=PyTuple_New(2);
1370 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1371 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1375 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1377 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1378 std::vector< std::vector<TypeOfField> > typesF;
1379 std::vector< std::vector<std::string> > pfls;
1380 std::vector< std::vector<std::string> > locs;
1381 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1383 PyObject *ret2=PyList_New(sz);
1384 for(int i=0;i<sz;i++)
1386 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1387 const std::vector<TypeOfField>& typesFI=typesF[i];
1388 const std::vector<std::string>& pflsI=pfls[i];
1389 const std::vector<std::string>& locsI=locs[i];
1390 PyObject *elt=PyTuple_New(2);
1391 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1392 int sz2=ret[i].size();
1393 PyObject *elt2=PyList_New(sz2);
1394 for(int j=0;j<sz2;j++)
1396 PyObject *elt3=PyTuple_New(4);
1397 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1398 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1399 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1400 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1401 PyList_SetItem(elt2,j,elt3);
1403 PyTuple_SetItem(elt,1,elt2);
1404 PyList_SetItem(ret2,i,elt);
1409 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1411 DataArrayDouble *ret=self->getUndergroundDataArray();
1417 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1419 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1420 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1423 PyObject *ret=PyTuple_New(2);
1424 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1425 std::size_t sz=elt1Cpp.size();
1426 PyObject *elt=PyList_New(sz);
1427 for(std::size_t i=0;i<sz;i++)
1429 PyObject *elt1=PyTuple_New(2);
1430 PyObject *elt2=PyTuple_New(2);
1431 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1432 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1433 PyObject *elt3=PyTuple_New(2);
1434 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1435 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1436 PyTuple_SetItem(elt1,0,elt2);
1437 PyTuple_SetItem(elt1,1,elt3);
1438 PyList_SetItem(elt,i,elt1);
1440 PyTuple_SetItem(ret,1,elt);
1446 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1449 static MEDFileIntField1TS *New();
1450 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1451 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1452 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1453 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1455 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1456 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1459 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1461 return MEDFileIntField1TS::New();
1464 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1466 return MEDFileIntField1TS::New(fileName,loadAll);
1469 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1471 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1474 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1476 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1479 std::string __str__() const throw(INTERP_KERNEL::Exception)
1481 return self->simpleRepr();
1484 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1486 DataArrayInt *ret1=0;
1487 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1488 PyObject *ret=PyTuple_New(2);
1489 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1490 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1494 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1496 DataArrayInt *ret1=0;
1497 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1498 PyObject *ret=PyTuple_New(2);
1499 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1500 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1504 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1506 DataArrayInt *ret1=0;
1507 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1508 PyObject *ret=PyTuple_New(2);
1509 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1510 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1514 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1516 DataArrayInt *ret1=0;
1517 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1518 PyObject *ret=PyTuple_New(2);
1519 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1520 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1524 PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1526 DataArrayInt *ret1=0;
1527 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1528 PyObject *ret=PyTuple_New(2);
1529 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1530 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1534 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1536 DataArrayInt *ret1=0;
1537 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1538 PyObject *ret=PyTuple_New(2);
1539 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1540 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1544 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1546 DataArrayInt *ret=self->getUndergroundDataArray();
1554 class MEDFileAnyTypeFieldMultiTSIterator
1559 PyObject *next() throw(INTERP_KERNEL::Exception)
1561 MEDFileAnyTypeField1TS *ret=self->nextt();
1563 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1566 PyErr_SetString(PyExc_StopIteration,"No more data.");
1573 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1576 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1577 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1578 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1579 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1580 std::string getName() const throw(INTERP_KERNEL::Exception);
1581 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1582 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1583 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1584 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1585 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1586 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1587 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1588 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1589 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1590 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1591 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1592 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1593 void loadArrays() throw(INTERP_KERNEL::Exception);
1594 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1595 void unloadArrays() throw(INTERP_KERNEL::Exception);
1597 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1598 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1599 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1600 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1601 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1604 int __len__() const throw(INTERP_KERNEL::Exception)
1606 return self->getNumberOfTS();
1609 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1611 if(elt0 && PyInt_Check(elt0))
1613 int pos=PyInt_AS_LONG(elt0);
1616 else if(elt0 && PyTuple_Check(elt0))
1618 if(PyTuple_Size(elt0)==2)
1620 PyObject *o0=PyTuple_GetItem(elt0,0);
1621 PyObject *o1=PyTuple_GetItem(elt0,1);
1622 if(PyInt_Check(o0) && PyInt_Check(o1))
1624 int iter=PyInt_AS_LONG(o0);
1625 int order=PyInt_AS_LONG(o1);
1626 return self->getPosOfTimeStep(iter,order);
1629 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 !");
1632 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 !");
1634 else if(elt0 && PyFloat_Check(elt0))
1636 double val=PyFloat_AS_DOUBLE(elt0);
1637 return self->getPosGivenTime(val);
1640 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1643 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1645 std::vector< std::pair<int,int> > res=self->getIterations();
1646 PyObject *ret=PyList_New(res.size());
1648 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1650 PyObject *elt=PyTuple_New(2);
1651 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1652 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1653 PyList_SetItem(ret,rk,elt);
1658 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1660 std::vector<double> ret1;
1661 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1662 std::size_t sz=ret.size();
1663 PyObject *ret2=PyList_New(sz);
1664 for(std::size_t i=0;i<sz;i++)
1666 PyObject *elt=PyTuple_New(3);
1667 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1668 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1669 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1670 PyList_SetItem(ret2,i,elt);
1675 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1677 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1678 PyObject *ret2=PyList_New(ret.size());
1679 for(int i=0;i<(int)ret.size();i++)
1681 const std::vector<TypeOfField>& rett=ret[i];
1682 PyObject *ret3=PyList_New(rett.size());
1683 for(int j=0;j<(int)rett.size();j++)
1684 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1685 PyList_SetItem(ret2,i,ret3);
1690 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1692 std::vector<int> ret1;
1693 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1694 PyObject *elt=PyTuple_New(2);
1695 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1696 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1700 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1702 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1703 std::vector< std::vector<TypeOfField> > typesF;
1704 std::vector< std::vector<std::string> > pfls;
1705 std::vector< std::vector<std::string> > locs;
1706 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1708 PyObject *ret2=PyList_New(sz);
1709 for(int i=0;i<sz;i++)
1711 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1712 const std::vector<TypeOfField>& typesFI=typesF[i];
1713 const std::vector<std::string>& pflsI=pfls[i];
1714 const std::vector<std::string>& locsI=locs[i];
1715 PyObject *elt=PyTuple_New(2);
1716 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1717 int sz2=ret[i].size();
1718 PyObject *elt2=PyList_New(sz2);
1719 for(int j=0;j<sz2;j++)
1721 PyObject *elt3=PyTuple_New(4);
1722 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1723 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));
1724 PyTuple_SetItem(elt3,1,elt4);
1725 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1726 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1727 PyList_SetItem(elt2,j,elt3);
1729 PyTuple_SetItem(elt,1,elt2);
1730 PyList_SetItem(ret2,i,elt);
1735 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1737 if(PyList_Check(elts))
1739 int sz=PyList_Size(elts);
1740 std::vector<int> ret(sz);
1741 for(int i=0;i<sz;i++)
1743 PyObject *elt=PyList_GetItem(elts,i);
1744 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1750 std::vector<int> ret(1);
1751 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1756 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1758 if(PySlice_Check(elts))
1760 Py_ssize_t strt=2,stp=2,step=2;
1761 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1762 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1764 self->eraseTimeStepIds2(strt,stp,step);
1767 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1771 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1772 if(!idsToRemove.empty())
1773 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1777 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1781 std::vector<int> pos2;
1782 DataArrayInt *pos3=0;
1783 DataArrayIntTuple *pos4=0;
1784 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1789 self->eraseTimeStepIds(&pos1,&pos1+1);
1796 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1801 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1805 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1809 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1811 return self->iterator();
1814 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1816 if(elt0 && PyList_Check(elt0))
1818 int sz=PyList_Size(elt0);
1819 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1820 int *pt=da->getPointer();
1821 for(int i=0;i<sz;i++,pt++)
1823 PyObject *elt1=PyList_GetItem(elt0,i);
1824 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1826 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1828 else if(elt0 && PySlice_Check(elt0))
1830 Py_ssize_t strt=2,stp=2,step=2;
1831 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1832 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1833 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1835 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1838 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1841 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1843 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1844 return self->changeMeshNames(modifTab);
1847 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1849 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1850 std::size_t sz=ret.size();
1851 PyObject *retPy=PyList_New(sz);
1852 for(std::size_t i=0;i<sz;i++)
1853 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1857 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1859 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1860 std::size_t sz=ret.size();
1861 PyObject *retPy=PyList_New(sz);
1862 for(std::size_t i=0;i<sz;i++)
1863 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1867 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1869 std::vector<MEDFileAnyTypeField1TS *> tmp;
1870 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1871 self->pushBackTimeSteps(tmp);
1874 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1876 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1877 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1878 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1879 std::size_t sz=ret.size();
1880 PyObject *retPy=PyList_New(sz);
1881 for(std::size_t i=0;i<sz;i++)
1883 std::size_t sz2=ret[i].size();
1884 PyObject *ret1Py=PyList_New(sz2);
1885 for(std::size_t j=0;j<sz2;j++)
1887 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1890 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1892 PyList_SetItem(retPy,i,ret1Py);
1897 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) 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::SplitPerCommonSupport(vectFMTS,mesh);
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);
1922 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1925 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1926 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1927 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1929 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1930 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1931 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1932 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1933 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1935 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1936 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1937 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1940 MEDFileFieldMultiTS()
1942 return MEDFileFieldMultiTS::New();
1945 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1947 return MEDFileFieldMultiTS::New(fileName,loadAll);
1950 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1952 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
1955 std::string __str__() const throw(INTERP_KERNEL::Exception)
1957 return self->simpleRepr();
1960 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1962 DataArrayInt *ret1=0;
1963 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1964 PyObject *ret=PyTuple_New(2);
1965 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1966 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1970 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1972 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1973 std::vector< std::vector<TypeOfField> > typesF;
1974 std::vector< std::vector<std::string> > pfls;
1975 std::vector< std::vector<std::string> > locs;
1976 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1978 PyObject *ret2=PyList_New(sz);
1979 for(int i=0;i<sz;i++)
1981 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1982 const std::vector<TypeOfField>& typesFI=typesF[i];
1983 const std::vector<std::string>& pflsI=pfls[i];
1984 const std::vector<std::string>& locsI=locs[i];
1985 PyObject *elt=PyTuple_New(2);
1986 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1987 int sz2=ret[i].size();
1988 PyObject *elt2=PyList_New(sz2);
1989 for(int j=0;j<sz2;j++)
1991 PyObject *elt3=PyTuple_New(4);
1992 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1993 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1994 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1995 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1996 PyList_SetItem(elt2,j,elt3);
1998 PyTuple_SetItem(elt,1,elt2);
1999 PyList_SetItem(ret2,i,elt);
2003 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2005 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2011 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2013 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2014 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2017 PyObject *ret=PyTuple_New(2);
2018 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2019 std::size_t sz=elt1Cpp.size();
2020 PyObject *elt=PyList_New(sz);
2021 for(std::size_t i=0;i<sz;i++)
2023 PyObject *elt1=PyTuple_New(2);
2024 PyObject *elt2=PyTuple_New(2);
2025 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2026 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2027 PyObject *elt3=PyTuple_New(2);
2028 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2029 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2030 PyTuple_SetItem(elt1,0,elt2);
2031 PyTuple_SetItem(elt1,1,elt3);
2032 PyList_SetItem(elt,i,elt1);
2034 PyTuple_SetItem(ret,1,elt);
2040 class MEDFileFieldsIterator
2045 PyObject *next() throw(INTERP_KERNEL::Exception)
2047 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2049 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2052 PyErr_SetString(PyExc_StopIteration,"No more data.");
2059 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2062 static MEDFileIntFieldMultiTS *New();
2063 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2064 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2066 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2067 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2068 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2071 MEDFileIntFieldMultiTS()
2073 return MEDFileIntFieldMultiTS::New();
2076 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2078 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2081 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2083 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2086 std::string __str__() const throw(INTERP_KERNEL::Exception)
2088 return self->simpleRepr();
2091 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2093 DataArrayInt *ret1=0;
2094 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2095 PyObject *ret=PyTuple_New(2);
2096 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2097 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2101 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2103 DataArrayInt *ret1=0;
2104 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2105 PyObject *ret=PyTuple_New(2);
2106 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2107 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2111 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2113 DataArrayInt *ret1=0;
2114 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2115 PyObject *ret=PyTuple_New(2);
2116 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2117 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2121 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2123 DataArrayInt *ret1=0;
2124 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2125 PyObject *ret=PyTuple_New(2);
2126 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2127 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2131 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2133 DataArrayInt *ret1=0;
2134 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2135 PyObject *ret=PyTuple_New(2);
2136 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2137 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2141 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2143 DataArrayInt *ret1=0;
2144 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2145 PyObject *ret=PyTuple_New(2);
2146 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2147 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2153 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2161 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2164 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2165 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2166 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2167 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2168 void loadArrays() throw(INTERP_KERNEL::Exception);
2169 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2170 void unloadArrays() throw(INTERP_KERNEL::Exception);
2171 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2172 int getNumberOfFields() const;
2173 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2174 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2176 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2177 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2178 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2179 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2180 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2181 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2182 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2183 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2188 return MEDFileFields::New();
2191 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2193 return MEDFileFields::New(fileName,loadAll);
2196 std::string __str__() const throw(INTERP_KERNEL::Exception)
2198 return self->simpleRepr();
2201 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2204 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2205 PyObject *ret=PyTuple_New(2);
2206 PyObject *ret_0=PyList_New(ret0.size());
2208 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2210 PyObject *elt=PyTuple_New(2);
2211 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2212 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2213 PyList_SetItem(ret_0,rk,elt);
2215 PyTuple_SetItem(ret,0,ret_0);
2216 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2217 PyTuple_SetItem(ret,1,ret_1);
2221 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2223 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2224 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2227 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2229 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2230 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2233 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2235 if(obj && PyList_Check(obj))
2237 int sz=PyList_Size(obj);
2238 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2239 int *pt=da->getPointer();
2240 for(int i=0;i<sz;i++,pt++)
2242 PyObject *elt1=PyList_GetItem(obj,i);
2243 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2245 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2248 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2251 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2253 self->setFieldAtPos(obj,field);
2257 int __len__() const throw(INTERP_KERNEL::Exception)
2259 return self->getNumberOfFields();
2262 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2264 return self->iterator();
2267 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2269 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2270 return self->changeMeshNames(modifTab);
2273 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2275 if(elt0 && PyInt_Check(elt0))
2277 return PyInt_AS_LONG(elt0);
2279 else if(elt0 && PyString_Check(elt0))
2280 return self->getPosFromFieldName(PyString_AsString(elt0));
2282 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2285 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2287 if(PyList_Check(elts))
2289 int sz=PyList_Size(elts);
2290 std::vector<int> ret(sz);
2291 for(int i=0;i<sz;i++)
2293 PyObject *elt=PyList_GetItem(elts,i);
2294 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2300 std::vector<int> ret(1);
2301 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2306 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2308 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2309 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2310 self->pushFields(tmp);
2313 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2315 if(elts && PySlice_Check(elts))
2317 Py_ssize_t strt=2,stp=2,step=2;
2318 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2319 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2320 self->destroyFieldsAtPos2(strt,stp,step);
2322 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2326 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2327 if(!idsToRemove.empty())
2328 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2334 class MEDFileParameter1TS : public RefCountObject
2337 void setIteration(int it);
2338 int getIteration() const;
2339 void setOrder(int order);
2340 int getOrder() const;
2341 void setTimeValue(double time);
2342 void setTime(int dt, int it, double time);
2343 double getTime(int& dt, int& it);
2344 double getTimeValue() const;
2347 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2350 void setValue(double val) throw(INTERP_KERNEL::Exception);
2351 double getValue() const throw(INTERP_KERNEL::Exception);
2352 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2355 std::string __str__() const throw(INTERP_KERNEL::Exception)
2357 return self->simpleRepr();
2362 class MEDFileParameterTinyInfo : public MEDFileWritable
2365 void setDescription(const char *name);
2366 std::string getDescription() const;
2367 void setTimeUnit(const char *unit);
2368 std::string getTimeUnit() const;
2371 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2374 static MEDFileParameterDouble1TS *New();
2375 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2376 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2377 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2378 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2379 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2380 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2381 std::string getName() const throw(INTERP_KERNEL::Exception);
2382 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2385 MEDFileParameterDouble1TS()
2387 return MEDFileParameterDouble1TS::New();
2390 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2392 return MEDFileParameterDouble1TS::New(fileName);
2395 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2397 return MEDFileParameterDouble1TS::New(fileName,paramName);
2400 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2402 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2405 std::string __str__() const throw(INTERP_KERNEL::Exception)
2407 return self->simpleRepr();
2410 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2413 bool ret0=self->isEqual(other,eps,what);
2414 PyObject *res=PyList_New(2);
2415 PyObject *ret0Py=ret0?Py_True:Py_False;
2417 PyList_SetItem(res,0,ret0Py);
2418 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2424 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2427 static MEDFileParameterMultiTS *New();
2428 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2429 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2430 std::string getName() const;
2431 void setName(const char *name);
2432 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2433 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2434 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2435 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2436 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2437 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2438 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2441 MEDFileParameterMultiTS()
2443 return MEDFileParameterMultiTS::New();
2446 MEDFileParameterMultiTS(const char *fileName)
2448 return MEDFileParameterMultiTS::New(fileName);
2451 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2453 return MEDFileParameterMultiTS::New(fileName,paramName);
2456 std::string __str__() const throw(INTERP_KERNEL::Exception)
2458 return self->simpleRepr();
2461 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2464 bool ret0=self->isEqual(other,eps,what);
2465 PyObject *res=PyList_New(2);
2466 PyObject *ret0Py=ret0?Py_True:Py_False;
2468 PyList_SetItem(res,0,ret0Py);
2469 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2473 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2477 std::vector<int> pos2;
2478 DataArrayInt *pos3=0;
2479 DataArrayIntTuple *pos4=0;
2480 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2485 self->eraseTimeStepIds(&pos1,&pos1+1);
2492 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2497 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2501 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2505 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2507 if(elt0 && PyInt_Check(elt0))
2509 int pos=PyInt_AS_LONG(elt0);
2512 else if(elt0 && PyTuple_Check(elt0))
2514 if(PyTuple_Size(elt0)==2)
2516 PyObject *o0=PyTuple_GetItem(elt0,0);
2517 PyObject *o1=PyTuple_GetItem(elt0,1);
2518 if(PyInt_Check(o0) && PyInt_Check(o1))
2520 int iter=PyInt_AS_LONG(o0);
2521 int order=PyInt_AS_LONG(o1);
2522 return self->getPosOfTimeStep(iter,order);
2525 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 !");
2528 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 !");
2530 else if(elt0 && PyFloat_Check(elt0))
2532 double val=PyFloat_AS_DOUBLE(elt0);
2533 return self->getPosGivenTime(val);
2536 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2539 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2541 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2547 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2549 if(PyList_Check(elts))
2551 int sz=PyList_Size(elts);
2552 std::vector<int> ret(sz);
2553 for(int i=0;i<sz;i++)
2555 PyObject *elt=PyList_GetItem(elts,i);
2556 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2562 std::vector<int> ret(1);
2563 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2568 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2570 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2571 if(!idsToRemove.empty())
2572 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2575 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2577 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2583 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2585 std::vector< std::pair<int,int> > res=self->getIterations();
2586 PyObject *ret=PyList_New(res.size());
2588 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2590 PyObject *elt=PyTuple_New(2);
2591 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2592 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2593 PyList_SetItem(ret,rk,elt);
2598 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2600 std::vector<double> res2;
2601 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2602 PyObject *ret=PyList_New(res.size());
2604 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2606 PyObject *elt=PyTuple_New(3);
2607 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2608 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2609 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2610 PyList_SetItem(ret,rk,elt);
2617 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2620 static MEDFileParameters *New();
2621 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2622 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2623 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2624 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2625 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2626 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2627 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2628 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2629 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2630 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2631 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2636 return MEDFileParameters::New();
2639 MEDFileParameters(const char *fileName)
2641 return MEDFileParameters::New(fileName);
2644 std::string __str__() const throw(INTERP_KERNEL::Exception)
2646 return self->simpleRepr();
2649 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2651 if(PyInt_Check(obj))
2653 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2658 else if(PyString_Check(obj))
2660 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2666 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2669 int __len__() const throw(INTERP_KERNEL::Exception)
2671 return self->getNumberOfParams();
2674 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2676 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2682 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2684 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2690 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2693 bool ret0=self->isEqual(other,eps,what);
2694 PyObject *res=PyList_New(2);
2695 PyObject *ret0Py=ret0?Py_True:Py_False;
2697 PyList_SetItem(res,0,ret0Py);
2698 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2704 class MEDFileData : public RefCountObject, public MEDFileWritable
2707 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2708 static MEDFileData *New();
2709 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2710 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2711 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2712 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2713 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2714 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2715 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2717 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2718 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2720 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2723 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2725 return MEDFileData::New(fileName);
2730 return MEDFileData::New();
2733 std::string __str__() const throw(INTERP_KERNEL::Exception)
2735 return self->simpleRepr();
2738 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2740 MEDFileMeshes *ret=self->getMeshes();
2746 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2748 MEDFileParameters *ret=self->getParams();
2754 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2756 MEDFileFields *ret=self->getFields();
2762 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2764 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2765 return self->changeMeshNames(modifTab);
2770 class SauvReader : public RefCountObject
2773 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2774 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2777 class SauvWriter : public RefCountObject
2780 static SauvWriter * New();
2781 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2782 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2787 class MEDFileMeshStruct;
2789 class MEDFileField1TSStructItem
2792 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2795 class MEDFileMeshStruct : public RefCountObject
2798 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2800 ~MEDFileMeshStruct();
2803 class MEDMeshMultiLev : public RefCountObject
2806 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2811 class MEDUMeshMultiLev : public MEDMeshMultiLev
2814 ~MEDUMeshMultiLev();
2818 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2820 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2821 self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces);
2822 PyObject *ret=PyTuple_New(6);
2823 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2824 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2825 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2826 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2827 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2828 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2834 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2837 ~MEDStructuredMeshMultiLev();
2840 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2843 ~MEDCMeshMultiLev();
2847 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2849 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2850 std::size_t sz(objs.size());
2851 PyObject *ret=PyList_New(sz);
2852 for(std::size_t i=0;i<sz;i++)
2853 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2859 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2862 ~MEDCurveLinearMeshMultiLev();
2866 PyObject *buildVTUArrays(DataArrayDouble *&coords, std::vector<int>& nodeStrct) const throw(INTERP_KERNEL::Exception)
2868 DataArrayDouble *ret0(0);
2869 std::vector<int> ret1;
2870 self->buildVTUArrays(ret0,ret1);
2871 std::size_t sz(ret1.size());
2872 PyObject *ret=PyTuple_New(2);
2873 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2874 PyObject *ret1Py=PyList_New(sz);
2875 for(std::size_t i=0;i<sz;i++)
2876 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2877 PyTuple_SetItem(ret,1,ret1Py);
2883 class MEDFileFastCellSupportComparator : public RefCountObject
2886 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2887 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2888 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2890 ~MEDFileFastCellSupportComparator();