1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
101 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
102 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
103 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
104 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
105 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
111 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
112 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
113 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
114 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
115 %newobject ParaMEDMEM::MEDFileUMesh::__getitem__;
116 %newobject ParaMEDMEM::MEDFileCMesh::New;
117 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
118 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
119 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
120 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
121 %newobject ParaMEDMEM::MEDFileMeshes::New;
122 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
123 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
124 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
125 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
126 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
128 %newobject ParaMEDMEM::MEDFileFields::New;
129 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
130 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
131 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
132 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
133 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
134 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
135 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
136 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
137 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
138 %newobject ParaMEDMEM::MEDFileFields::__iter__;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
143 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
144 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
145 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
146 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
152 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
153 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
154 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
155 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
156 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
157 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
158 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
160 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
161 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
162 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
163 %newobject ParaMEDMEM::MEDFileField1TS::New;
164 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
165 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
166 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
167 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
168 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
169 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
170 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
171 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
172 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
174 %newobject ParaMEDMEM::MEDFileData::New;
175 %newobject ParaMEDMEM::MEDFileData::deepCpy;
176 %newobject ParaMEDMEM::MEDFileData::getMeshes;
177 %newobject ParaMEDMEM::MEDFileData::getFields;
178 %newobject ParaMEDMEM::MEDFileData::getParams;
180 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
181 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
182 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
183 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
184 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
185 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
186 %newobject ParaMEDMEM::MEDFileParameters::New;
187 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
188 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
189 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
190 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
192 %newobject ParaMEDMEM::SauvWriter::New;
193 %newobject ParaMEDMEM::SauvReader::New;
194 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
196 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
197 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
198 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
199 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
200 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
202 %feature("unref") MEDFileMesh "$this->decrRef();"
203 %feature("unref") MEDFileUMesh "$this->decrRef();"
204 %feature("unref") MEDFileCMesh "$this->decrRef();"
205 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileMeshes "$this->decrRef();"
207 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
208 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
209 %feature("unref") MEDFileField1TS "$this->decrRef();"
210 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
211 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
212 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
213 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
214 %feature("unref") MEDFileFields "$this->decrRef();"
215 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
216 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
217 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
218 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
219 %feature("unref") MEDFileParameters "$this->decrRef();"
220 %feature("unref") MEDFileData "$this->decrRef();"
221 %feature("unref") SauvReader "$this->decrRef();"
222 %feature("unref") SauvWriter "$this->decrRef();"
223 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
224 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
225 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
226 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
227 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
228 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
233 static bool HasXDR();
234 static std::string MEDFileVersionStr();
235 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
236 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
237 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
238 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
245 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
246 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
247 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
248 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
249 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
250 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
251 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
254 static PyObject *MEDFileVersion()
256 int major,minor,release;
257 MEDLoader::MEDFileVersion(major,minor,release);
258 PyObject *ret(PyTuple_New(3));
259 PyTuple_SetItem(ret,0,SWIG_From_int(major));
260 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
261 PyTuple_SetItem(ret,2,SWIG_From_int(release));
265 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
267 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
268 PyObject *ret=PyList_New(res.size());
270 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
272 PyObject *elt=PyTuple_New(2);
273 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
274 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
275 PyList_SetItem(ret,rk,elt);
280 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
282 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
283 PyObject *ret=PyList_New(res.size());
285 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
287 PyObject *elt=PyTuple_New(3);
288 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
289 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
290 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
291 PyList_SetItem(ret,rk,elt);
296 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
298 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
299 PyObject *ret=PyList_New(res.size());
301 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
303 PyObject *elt=PyTuple_New(2);
304 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
305 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
306 PyList_SetItem(ret,rk,elt);
310 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
312 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
313 PyObject *ret=PyList_New(res.size());
315 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
317 PyObject *elt=PyTuple_New(2);
318 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
319 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
320 PyList_SetItem(ret,rk,elt);
324 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
326 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
327 PyObject *ret=PyList_New(res.size());
329 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
331 PyObject *elt=PyTuple_New(2);
332 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
333 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
334 PyList_SetItem(ret,rk,elt);
338 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
340 int meshDim,spaceDim,numberOfNodes;
341 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
342 PyObject *ret=PyTuple_New(4);
343 PyObject *elt0=PyList_New(res.size());
345 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
347 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
349 PyObject *elt1=PyList_New(obj2.size());
350 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
352 PyObject *elt2=PyTuple_New(2);
353 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
354 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
355 PyList_SetItem(elt1,j,elt2);
357 PyList_SetItem(elt0,i,elt1);
359 PyTuple_SetItem(ret,0,elt0);
360 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
361 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
362 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
365 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
366 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
368 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
369 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
370 return convertFieldDoubleVecToPy(res);
372 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
374 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
375 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
376 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
378 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
380 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
381 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
382 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
384 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
386 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
387 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
388 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
390 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
392 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
394 PyObject *ret=PyList_New(size);
395 for(int i=0;i<size;i++)
396 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
399 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
401 std::vector<std::string> grps;
402 converPyListToVecString(li,grps);
403 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
405 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
407 std::vector<std::string> fams;
408 converPyListToVecString(li,fams);
409 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
412 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
413 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
414 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
415 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
416 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
417 static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
418 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
419 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
420 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
421 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
422 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
423 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
424 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
425 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
426 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
427 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
432 class MEDFileWritable
435 void copyOptionsFrom(const MEDFileWritable& other) const;
436 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
437 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
438 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
439 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
442 class MEDFileMeshReadSelector
445 MEDFileMeshReadSelector();
446 MEDFileMeshReadSelector(unsigned int code);
447 unsigned int getCode() const;
448 void setCode(unsigned int newCode);
449 bool isCellFamilyFieldReading() const;
450 bool isNodeFamilyFieldReading() const;
451 bool isCellNameFieldReading() const;
452 bool isNodeNameFieldReading() const;
453 bool isCellNumFieldReading() const;
454 bool isNodeNumFieldReading() const;
455 void setCellFamilyFieldReading(bool b);
456 void setNodeFamilyFieldReading(bool b);
457 void setCellNameFieldReading(bool b);
458 void setNodeNameFieldReading(bool b);
459 void setCellNumFieldReading(bool b);
460 void setNodeNumFieldReading(bool b);
463 std::string __str__() const throw(INTERP_KERNEL::Exception)
465 std::ostringstream oss;
470 std::string __repr__() const throw(INTERP_KERNEL::Exception)
472 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
478 class MEDFileMesh : public RefCountObject, public MEDFileWritable
481 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
482 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
483 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
484 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
485 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
486 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
487 void setName(const std::string& name);
488 std::string getName();
489 std::string getUnivName() const;
490 bool getUnivNameWrStatus() const;
491 void setUnivNameWrStatus(bool newStatus);
492 void setDescription(const std::string& name);
493 std::string getDescription() const;
494 void setOrder(int order);
495 int getOrder() const;
496 void setIteration(int it);
498 void setTimeValue(double time);
499 void setTime(int dt, int it, double time);
500 double getTimeValue() const;
501 void setTimeUnit(const std::string& unit);
502 std::string getTimeUnit() const;
503 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
504 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
505 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
506 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
507 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
508 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
509 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
510 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
511 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
512 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
513 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
514 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
516 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
517 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
518 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
519 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
520 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
521 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
522 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
523 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
524 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
525 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
526 void clearGrpMap() throw(INTERP_KERNEL::Exception);
527 void clearFamMap() throw(INTERP_KERNEL::Exception);
528 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
529 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
530 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
531 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
532 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
533 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
534 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
535 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
536 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
537 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
538 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
539 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
540 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
541 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
542 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
543 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
544 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
545 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
546 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
547 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
548 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
549 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
550 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
551 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
552 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
553 void setFamilyInfo(const std::map<std::string,int>& info);
554 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
555 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
556 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
557 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
558 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
559 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
560 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
561 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
562 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
563 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
564 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
565 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
566 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
567 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
568 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
569 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
570 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
571 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
572 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
573 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
574 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
576 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
578 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
579 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
580 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
590 std::string __str__() const throw(INTERP_KERNEL::Exception)
592 return self->simpleRepr();
595 PyObject *getTime() throw(INTERP_KERNEL::Exception)
598 double tmp0=self->getTime(tmp1,tmp2);
599 PyObject *res = PyList_New(3);
600 PyList_SetItem(res,0,SWIG_From_int(tmp1));
601 PyList_SetItem(res,1,SWIG_From_int(tmp2));
602 PyList_SetItem(res,2,SWIG_From_double(tmp0));
606 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
609 bool ret0=self->isEqual(other,eps,what);
610 PyObject *res=PyList_New(2);
611 PyObject *ret0Py=ret0?Py_True:Py_False;
613 PyList_SetItem(res,0,ret0Py);
614 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
618 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
620 std::vector<const DataArrayInt *> grps;
621 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
622 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
625 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
628 bool ret0=self->areFamsEqual(other,what);
629 PyObject *res=PyList_New(2);
630 PyObject *ret0Py=ret0?Py_True:Py_False;
632 PyList_SetItem(res,0,ret0Py);
633 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
637 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
640 bool ret0=self->areGrpsEqual(other,what);
641 PyObject *res=PyList_New(2);
642 PyObject *ret0Py=ret0?Py_True:Py_False;
644 PyList_SetItem(res,0,ret0Py);
645 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
649 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
651 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
652 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
653 PyObject *res=PyList_New(result.size());
654 for(int i=0;iL!=result.end(); i++, iL++)
655 PyList_SetItem(res,i,PyInt_FromLong(*iL));
659 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
661 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
662 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
663 PyObject *res=PyList_New(result.size());
664 for(int i=0;iL!=result.end(); i++, iL++)
665 PyList_SetItem(res,i,PyInt_FromLong(*iL));
669 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
671 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
674 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
677 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
679 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
682 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
685 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
687 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
690 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
693 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
695 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
698 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
701 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
704 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
705 PyObject *ret=PyTuple_New(2);
706 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
707 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
711 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
713 DataArrayInt *ret3=0;
714 std::vector<int> ret1,ret2;
715 bool ret0=self->unPolyze(ret1,ret2,ret3);
716 PyObject *ret=PyTuple_New(4);
717 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
719 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
720 for(int j=0;j<(int)ret1.size()/3;j++)
722 PyObject *retLev2=PyList_New(3);
723 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
724 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
725 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
726 PyList_SetItem(retLev1_0,j,retLev2);
728 PyTuple_SetItem(ret,1,retLev1_0);
730 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
731 for(int j=0;j<(int)ret2.size()/3;j++)
733 PyObject *retLev2=PyList_New(3);
734 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
735 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
736 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
737 PyList_SetItem(retLev1_1,j,retLev2);
739 PyTuple_SetItem(ret,2,retLev1_1);
741 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
747 class MEDFileUMesh : public MEDFileMesh
750 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
751 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
752 static MEDFileUMesh *New();
754 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
755 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
757 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
758 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
759 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
760 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
761 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
762 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
763 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
764 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
765 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
766 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
767 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
768 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
769 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
770 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
771 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
772 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
773 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
774 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
775 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
776 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
778 int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
779 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
780 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
781 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
782 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
783 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
784 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
785 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
786 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
787 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
788 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
789 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
790 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
791 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
794 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
796 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
799 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
801 return MEDFileUMesh::New(fileName,mrs);
806 return MEDFileUMesh::New();
810 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
812 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
815 static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
817 std::vector<int> typesCpp1;
818 convertPyToNewIntArr3(types,typesCpp1);
819 std::size_t sz(typesCpp1.size());
820 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
821 for(std::size_t ii=0;ii<sz;ii++)
822 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
823 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
826 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
827 {// put an empty dict in input to say to __new__ to call __init__...
828 PyObject *ret(PyTuple_New(1));
829 PyObject *ret0(PyDict_New());
830 PyTuple_SetItem(ret,0,ret0);
834 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
836 std::vector<double> a0;
838 std::vector<std::string> a2;
839 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
840 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
841 self->serialize(a0,a1,a2,a3,a4);
842 PyObject *ret(PyTuple_New(5));
843 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
844 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
846 PyObject *ret2(PyList_New(sz));
847 for(int i=0;i<sz;i++)
848 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
849 PyTuple_SetItem(ret,2,ret2);
851 PyObject *ret3(PyList_New(sz));
852 for(int i=0;i<sz;i++)
854 DataArrayInt *elt(a3[i]);
857 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
859 PyTuple_SetItem(ret,3,ret3);
860 DataArrayDouble *ret4(a4);
863 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
867 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
869 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
870 if(!PyTuple_Check(inp))
871 throw INTERP_KERNEL::Exception(MSG);
872 int sz(PyTuple_Size(inp));
874 throw INTERP_KERNEL::Exception(MSG);
875 std::vector<double> a0;
877 std::vector<std::string> a2;
878 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
879 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
881 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
883 fillArrayWithPyListDbl3(a0py,tmp,a0);
884 convertPyToNewIntArr3(a1py,a1);
885 fillStringVector(a2py,a2);
887 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
889 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
890 if(!SWIG_IsOK(status))
891 throw INTERP_KERNEL::Exception(MSG);
892 a4=reinterpret_cast<DataArrayDouble *>(argp);
893 if((DataArrayDouble *)a4)
896 std::vector< DataArrayInt * > a3Tmp;
897 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
898 std::size_t sz(a3Tmp.size());
900 for(std::size_t i=0;i<sz;i++)
906 self->unserialize(a0,a1,a2,a3,a4);
910 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
912 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
915 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
918 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
919 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
922 self->setMeshAtLevel(meshDimRelToMax,m0,false);
925 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
928 self->setMeshAtLevel(meshDimRelToMax,m1);
931 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
934 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
936 self->removeMeshAtLevel(meshDimRelToMax);
939 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
941 std::vector<const MEDCouplingUMesh *> ms;
942 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
943 self->setMeshes(ms,renum);
946 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
948 std::vector<const MEDCouplingUMesh *> ms;
949 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
950 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
953 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
955 std::vector<const MEDCouplingUMesh *> ms;
956 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
957 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
960 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
962 DataArrayDouble *ret=self->getCoords();
968 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
970 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
973 return const_cast<PartDefinition *>(ret);
976 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
978 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
979 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
980 PyObject *ret=PyTuple_New(3);
981 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
982 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
983 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
987 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
989 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
995 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
997 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
998 std::size_t sz(tmp.size());
999 PyObject *ret=PyList_New(sz);
1000 for(std::size_t i=0;i<sz;i++)
1004 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1011 class MEDFileStructuredMesh : public MEDFileMesh
1016 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1018 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1026 class MEDFileCMesh : public MEDFileStructuredMesh
1029 static MEDFileCMesh *New();
1030 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1031 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1032 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1033 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1038 return MEDFileCMesh::New();
1041 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1043 return MEDFileCMesh::New(fileName,mrs);
1046 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1048 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1051 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1053 const MEDCouplingCMesh *tmp=self->getMesh();
1056 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1061 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1064 static MEDFileCurveLinearMesh *New();
1065 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1066 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1067 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1070 MEDFileCurveLinearMesh()
1072 return MEDFileCurveLinearMesh::New();
1075 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1077 return MEDFileCurveLinearMesh::New(fileName,mrs);
1080 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1082 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1085 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1087 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1090 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1095 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1098 static MEDFileMeshMultiTS *New();
1099 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1100 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1101 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1102 std::string getName() const throw(INTERP_KERNEL::Exception);
1103 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1104 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1107 MEDFileMeshMultiTS()
1109 return MEDFileMeshMultiTS::New();
1112 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1114 return MEDFileMeshMultiTS::New(fileName);
1117 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1119 return MEDFileMeshMultiTS::New(fileName,mName);
1122 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1124 MEDFileMesh *ret=self->getOneTimeStep();
1132 class MEDFileMeshesIterator
1137 PyObject *next() throw(INTERP_KERNEL::Exception)
1139 MEDFileMesh *ret=self->nextt();
1143 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1147 PyErr_SetString(PyExc_StopIteration,"No more data.");
1154 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1157 static MEDFileMeshes *New();
1158 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1159 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1160 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1161 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1162 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1164 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1165 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1166 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1167 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1172 return MEDFileMeshes::New();
1175 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1177 return MEDFileMeshes::New(fileName);
1180 std::string __str__() const throw(INTERP_KERNEL::Exception)
1182 return self->simpleRepr();
1185 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1187 if(PyInt_Check(obj))
1189 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1194 else if(PyString_Check(obj))
1196 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1202 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1205 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1207 self->setMeshAtPos(obj,mesh);
1211 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1213 return self->iterator();
1216 int __len__() const throw(INTERP_KERNEL::Exception)
1218 return self->getNumberOfMeshes();
1221 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1223 MEDFileMesh *ret=self->getMeshAtPos(i);
1228 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1230 MEDFileMesh *ret=self->getMeshWithName(mname);
1238 class MEDFileFieldLoc : public RefCountObject
1241 std::string getName() const;
1242 int getDimension() const;
1243 int getNumberOfGaussPoints() const;
1244 int getNumberOfPointsInCells() const;
1245 const std::vector<double>& getRefCoords() const;
1246 const std::vector<double>& getGaussCoords() const;
1247 const std::vector<double>& getGaussWeights() const;
1248 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1251 std::string __str__() const throw(INTERP_KERNEL::Exception)
1253 return self->repr();
1258 class MEDFileFieldGlobsReal
1261 void resetContent();
1262 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1263 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1264 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1265 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1266 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1267 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1268 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1269 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1270 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1271 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1272 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1273 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1274 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1275 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1276 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1277 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1278 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1279 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1280 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1281 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1282 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1283 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1284 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1285 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1286 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1287 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1290 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1292 const DataArrayInt *ret=self->getProfile(pflName);
1295 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1298 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1300 const DataArrayInt *ret=self->getProfileFromId(pflId);
1303 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1306 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1308 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1311 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1314 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1316 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1319 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1322 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1324 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1325 return convertVecPairVecStToPy(ret);
1328 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1330 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1331 return convertVecPairVecStToPy(ret);
1334 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1336 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1337 self->changePflsNames(v);
1340 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1342 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1343 self->changePflsRefsNamesGen(v);
1346 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1348 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1349 self->changePflsNamesInStruct(v);
1352 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1354 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1355 self->changeLocsNames(v);
1358 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1360 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1361 self->changeLocsRefsNamesGen(v);
1364 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1366 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1367 self->changeLocsNamesInStruct(v);
1370 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1372 std::ostringstream oss;
1373 self->simpleReprGlobs(oss);
1379 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1382 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1383 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1384 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1385 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1386 void loadArrays() throw(INTERP_KERNEL::Exception);
1387 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1388 void unloadArrays() throw(INTERP_KERNEL::Exception);
1389 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1390 int getDimension() const throw(INTERP_KERNEL::Exception);
1391 int getIteration() const throw(INTERP_KERNEL::Exception);
1392 int getOrder() const throw(INTERP_KERNEL::Exception);
1393 std::string getName() throw(INTERP_KERNEL::Exception);
1394 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1395 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1396 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1397 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1398 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1399 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1400 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1401 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1402 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1403 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1404 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1405 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1406 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1407 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1408 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1411 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1414 double tmp0=self->getTime(tmp1,tmp2);
1415 PyObject *res = PyList_New(3);
1416 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1417 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1418 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1422 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1424 std::pair<int,int> res=self->getDtIt();
1425 PyObject *elt=PyTuple_New(2);
1426 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1427 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1431 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1433 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1436 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1438 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1441 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1443 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1444 return self->changeMeshNames(modifTab);
1447 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1449 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1450 PyObject *ret2=PyList_New(ret.size());
1451 for(int i=0;i<(int)ret.size();i++)
1452 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1456 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1458 std::vector<int> ret1;
1459 int ret0=self->getNonEmptyLevels(mname,ret1);
1460 PyObject *elt=PyTuple_New(2);
1461 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1462 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1466 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1468 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1469 std::vector< std::vector<TypeOfField> > typesF;
1470 std::vector< std::vector<std::string> > pfls;
1471 std::vector< std::vector<std::string> > locs;
1472 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1474 PyObject *ret2=PyList_New(sz);
1475 for(int i=0;i<sz;i++)
1477 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1478 const std::vector<TypeOfField>& typesFI=typesF[i];
1479 const std::vector<std::string>& pflsI=pfls[i];
1480 const std::vector<std::string>& locsI=locs[i];
1481 PyObject *elt=PyTuple_New(2);
1482 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1483 int sz2=ret[i].size();
1484 PyObject *elt2=PyList_New(sz2);
1485 for(int j=0;j<sz2;j++)
1487 PyObject *elt3=PyTuple_New(4);
1488 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1489 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));
1490 PyTuple_SetItem(elt3,1,elt4);
1491 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1492 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1493 PyList_SetItem(elt2,j,elt3);
1495 PyTuple_SetItem(elt,1,elt2);
1496 PyList_SetItem(ret2,i,elt);
1501 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1503 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1504 std::size_t sz=ret.size();
1505 PyObject *retPy=PyList_New(sz);
1506 for(std::size_t i=0;i<sz;i++)
1507 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1511 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1513 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1514 std::size_t sz=ret.size();
1515 PyObject *retPy=PyList_New(sz);
1516 for(std::size_t i=0;i<sz;i++)
1517 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1521 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1523 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1524 std::size_t sz=ret.size();
1525 PyObject *retPy=PyList_New(sz);
1526 for(std::size_t i=0;i<sz;i++)
1527 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1533 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1536 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1537 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1538 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1539 static MEDFileField1TS *New();
1540 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1541 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1542 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1543 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1544 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1545 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1547 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1548 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1549 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1550 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1553 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1555 return MEDFileField1TS::New(fileName,loadAll);
1558 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1560 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1563 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1565 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1570 return MEDFileField1TS::New();
1573 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1575 const DataArrayDouble *arr=0;
1577 arr=field->getArray();
1578 self->copyTinyInfoFrom(field,arr);
1581 std::string __str__() const throw(INTERP_KERNEL::Exception)
1583 return self->simpleRepr();
1586 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1588 DataArrayInt *ret1=0;
1589 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1590 PyObject *ret=PyTuple_New(2);
1591 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1592 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1596 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1598 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1599 std::vector< std::vector<TypeOfField> > typesF;
1600 std::vector< std::vector<std::string> > pfls;
1601 std::vector< std::vector<std::string> > locs;
1602 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1604 PyObject *ret2=PyList_New(sz);
1605 for(int i=0;i<sz;i++)
1607 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1608 const std::vector<TypeOfField>& typesFI=typesF[i];
1609 const std::vector<std::string>& pflsI=pfls[i];
1610 const std::vector<std::string>& locsI=locs[i];
1611 PyObject *elt=PyTuple_New(2);
1612 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1613 int sz2=ret[i].size();
1614 PyObject *elt2=PyList_New(sz2);
1615 for(int j=0;j<sz2;j++)
1617 PyObject *elt3=PyTuple_New(4);
1618 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1619 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1620 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1621 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1622 PyList_SetItem(elt2,j,elt3);
1624 PyTuple_SetItem(elt,1,elt2);
1625 PyList_SetItem(ret2,i,elt);
1630 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1632 DataArrayDouble *ret=self->getUndergroundDataArray();
1638 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1640 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1641 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1644 PyObject *ret=PyTuple_New(2);
1645 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1646 std::size_t sz=elt1Cpp.size();
1647 PyObject *elt=PyList_New(sz);
1648 for(std::size_t i=0;i<sz;i++)
1650 PyObject *elt1=PyTuple_New(2);
1651 PyObject *elt2=PyTuple_New(2);
1652 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1653 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1654 PyObject *elt3=PyTuple_New(2);
1655 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1656 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1657 PyTuple_SetItem(elt1,0,elt2);
1658 PyTuple_SetItem(elt1,1,elt3);
1659 PyList_SetItem(elt,i,elt1);
1661 PyTuple_SetItem(ret,1,elt);
1667 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1670 static MEDFileIntField1TS *New();
1671 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1672 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1673 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1674 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1676 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1677 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1680 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1682 return MEDFileIntField1TS::New();
1685 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1687 return MEDFileIntField1TS::New(fileName,loadAll);
1690 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1692 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1695 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1697 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1700 std::string __str__() const throw(INTERP_KERNEL::Exception)
1702 return self->simpleRepr();
1705 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1707 DataArrayInt *ret1=0;
1708 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1709 PyObject *ret=PyTuple_New(2);
1710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1715 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1717 DataArrayInt *ret1=0;
1718 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1719 PyObject *ret=PyTuple_New(2);
1720 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1721 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1725 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1727 DataArrayInt *ret1=0;
1728 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1729 PyObject *ret=PyTuple_New(2);
1730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1735 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1737 DataArrayInt *ret1=0;
1738 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1739 PyObject *ret=PyTuple_New(2);
1740 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1741 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1745 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1747 DataArrayInt *ret1=0;
1748 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1749 PyObject *ret=PyTuple_New(2);
1750 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1751 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1755 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1757 DataArrayInt *ret1=0;
1758 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1759 PyObject *ret=PyTuple_New(2);
1760 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1761 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1765 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1767 DataArrayInt *ret=self->getUndergroundDataArray();
1775 class MEDFileAnyTypeFieldMultiTSIterator
1780 PyObject *next() throw(INTERP_KERNEL::Exception)
1782 MEDFileAnyTypeField1TS *ret=self->nextt();
1784 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1787 PyErr_SetString(PyExc_StopIteration,"No more data.");
1794 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1797 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1798 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1799 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1800 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1801 std::string getName() const throw(INTERP_KERNEL::Exception);
1802 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1803 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1804 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1805 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1806 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1807 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1808 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1809 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1810 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1811 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1812 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1813 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1814 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1815 void loadArrays() throw(INTERP_KERNEL::Exception);
1816 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1817 void unloadArrays() throw(INTERP_KERNEL::Exception);
1818 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1820 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1821 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1822 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1823 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1824 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1827 int __len__() const throw(INTERP_KERNEL::Exception)
1829 return self->getNumberOfTS();
1832 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1834 if(elt0 && PyInt_Check(elt0))
1836 int pos=PyInt_AS_LONG(elt0);
1839 else if(elt0 && PyTuple_Check(elt0))
1841 if(PyTuple_Size(elt0)==2)
1843 PyObject *o0=PyTuple_GetItem(elt0,0);
1844 PyObject *o1=PyTuple_GetItem(elt0,1);
1845 if(PyInt_Check(o0) && PyInt_Check(o1))
1847 int iter=PyInt_AS_LONG(o0);
1848 int order=PyInt_AS_LONG(o1);
1849 return self->getPosOfTimeStep(iter,order);
1852 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 !");
1855 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 !");
1857 else if(elt0 && PyFloat_Check(elt0))
1859 double val=PyFloat_AS_DOUBLE(elt0);
1860 return self->getPosGivenTime(val);
1863 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1866 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1868 std::vector< std::pair<int,int> > res=self->getIterations();
1869 PyObject *ret=PyList_New(res.size());
1871 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1873 PyObject *elt=PyTuple_New(2);
1874 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1875 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1876 PyList_SetItem(ret,rk,elt);
1881 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1883 std::vector<double> ret1;
1884 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1885 std::size_t sz=ret.size();
1886 PyObject *ret2=PyList_New(sz);
1887 for(std::size_t i=0;i<sz;i++)
1889 PyObject *elt=PyTuple_New(3);
1890 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1891 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1892 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1893 PyList_SetItem(ret2,i,elt);
1898 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1900 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1901 PyObject *ret2=PyList_New(ret.size());
1902 for(int i=0;i<(int)ret.size();i++)
1904 const std::vector<TypeOfField>& rett=ret[i];
1905 PyObject *ret3=PyList_New(rett.size());
1906 for(int j=0;j<(int)rett.size();j++)
1907 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1908 PyList_SetItem(ret2,i,ret3);
1913 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1915 std::vector<int> ret1;
1916 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1917 PyObject *elt=PyTuple_New(2);
1918 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1919 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1923 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1925 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1926 std::vector< std::vector<TypeOfField> > typesF;
1927 std::vector< std::vector<std::string> > pfls;
1928 std::vector< std::vector<std::string> > locs;
1929 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1931 PyObject *ret2=PyList_New(sz);
1932 for(int i=0;i<sz;i++)
1934 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1935 const std::vector<TypeOfField>& typesFI=typesF[i];
1936 const std::vector<std::string>& pflsI=pfls[i];
1937 const std::vector<std::string>& locsI=locs[i];
1938 PyObject *elt=PyTuple_New(2);
1939 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1940 int sz2=ret[i].size();
1941 PyObject *elt2=PyList_New(sz2);
1942 for(int j=0;j<sz2;j++)
1944 PyObject *elt3=PyTuple_New(4);
1945 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1946 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));
1947 PyTuple_SetItem(elt3,1,elt4);
1948 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1949 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1950 PyList_SetItem(elt2,j,elt3);
1952 PyTuple_SetItem(elt,1,elt2);
1953 PyList_SetItem(ret2,i,elt);
1958 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1960 if(PyList_Check(elts))
1962 int sz=PyList_Size(elts);
1963 std::vector<int> ret(sz);
1964 for(int i=0;i<sz;i++)
1966 PyObject *elt=PyList_GetItem(elts,i);
1967 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1973 std::vector<int> ret(1);
1974 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1979 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1981 if(PySlice_Check(elts))
1983 Py_ssize_t strt=2,stp=2,step=2;
1984 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1985 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1986 self->eraseTimeStepIds2(strt,stp,step);
1990 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1991 if(!idsToRemove.empty())
1992 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1996 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2000 std::vector<int> pos2;
2001 DataArrayInt *pos3=0;
2002 DataArrayIntTuple *pos4=0;
2003 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2008 self->eraseTimeStepIds(&pos1,&pos1+1);
2015 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2020 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2024 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2028 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2030 return self->iterator();
2033 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2035 if(elt0 && PyList_Check(elt0))
2037 int sz=PyList_Size(elt0);
2038 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2039 int *pt=da->getPointer();
2040 for(int i=0;i<sz;i++,pt++)
2042 PyObject *elt1=PyList_GetItem(elt0,i);
2043 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2045 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2047 else if(elt0 && PySlice_Check(elt0))
2049 Py_ssize_t strt=2,stp=2,step=2;
2050 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2051 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2052 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2055 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2058 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2060 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2061 return self->changeMeshNames(modifTab);
2064 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2066 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2067 std::size_t sz=ret.size();
2068 PyObject *retPy=PyList_New(sz);
2069 for(std::size_t i=0;i<sz;i++)
2070 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2074 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2076 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2077 std::size_t sz=ret.size();
2078 PyObject *retPy=PyList_New(sz);
2079 for(std::size_t i=0;i<sz;i++)
2080 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2084 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2086 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2087 std::size_t sz=ret.size();
2088 PyObject *retPy=PyList_New(sz);
2089 for(std::size_t i=0;i<sz;i++)
2090 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2094 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2097 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2098 if(SWIG_IsOK(status))
2100 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2104 std::vector<MEDFileAnyTypeField1TS *> tmp;
2105 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2106 self->pushBackTimeSteps(tmp);
2110 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2112 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2113 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2114 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2115 std::size_t sz=ret.size();
2116 PyObject *retPy=PyList_New(sz);
2117 for(std::size_t i=0;i<sz;i++)
2119 std::size_t sz2=ret[i].size();
2120 PyObject *ret1Py=PyList_New(sz2);
2121 for(std::size_t j=0;j<sz2;j++)
2123 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2126 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2128 PyList_SetItem(retPy,i,ret1Py);
2133 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2135 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2136 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2137 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2138 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2139 if(ret2.size()!=ret.size())
2141 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2142 throw INTERP_KERNEL::Exception(oss.str().c_str());
2144 std::size_t sz=ret.size();
2145 PyObject *retPy=PyList_New(sz);
2146 for(std::size_t i=0;i<sz;i++)
2148 std::size_t sz2=ret[i].size();
2149 PyObject *ret0Py=PyTuple_New(2);
2150 PyObject *ret1Py=PyList_New(sz2);
2151 for(std::size_t j=0;j<sz2;j++)
2153 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2156 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2158 PyTuple_SetItem(ret0Py,0,ret1Py);
2159 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2160 PyList_SetItem(retPy,i,ret0Py);
2167 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2170 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2171 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2172 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2174 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2175 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2176 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2177 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2178 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2180 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2181 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2182 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2185 MEDFileFieldMultiTS()
2187 return MEDFileFieldMultiTS::New();
2190 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2192 return MEDFileFieldMultiTS::New(fileName,loadAll);
2195 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2197 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2200 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2202 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2203 std::size_t sz(tmp.size());
2204 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2205 for(std::size_t i=0;i<sz;i++)
2207 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2208 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2210 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2213 std::string __str__() const throw(INTERP_KERNEL::Exception)
2215 return self->simpleRepr();
2218 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2220 DataArrayInt *ret1=0;
2221 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2222 PyObject *ret=PyTuple_New(2);
2223 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2224 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2230 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2231 std::vector< std::vector<TypeOfField> > typesF;
2232 std::vector< std::vector<std::string> > pfls;
2233 std::vector< std::vector<std::string> > locs;
2234 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2236 PyObject *ret2=PyList_New(sz);
2237 for(int i=0;i<sz;i++)
2239 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2240 const std::vector<TypeOfField>& typesFI=typesF[i];
2241 const std::vector<std::string>& pflsI=pfls[i];
2242 const std::vector<std::string>& locsI=locs[i];
2243 PyObject *elt=PyTuple_New(2);
2244 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2245 int sz2=ret[i].size();
2246 PyObject *elt2=PyList_New(sz2);
2247 for(int j=0;j<sz2;j++)
2249 PyObject *elt3=PyTuple_New(4);
2250 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2251 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2252 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2253 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2254 PyList_SetItem(elt2,j,elt3);
2256 PyTuple_SetItem(elt,1,elt2);
2257 PyList_SetItem(ret2,i,elt);
2261 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2263 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2269 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2271 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2272 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2275 PyObject *ret=PyTuple_New(2);
2276 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2277 std::size_t sz=elt1Cpp.size();
2278 PyObject *elt=PyList_New(sz);
2279 for(std::size_t i=0;i<sz;i++)
2281 PyObject *elt1=PyTuple_New(2);
2282 PyObject *elt2=PyTuple_New(2);
2283 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2284 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2285 PyObject *elt3=PyTuple_New(2);
2286 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2287 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2288 PyTuple_SetItem(elt1,0,elt2);
2289 PyTuple_SetItem(elt1,1,elt3);
2290 PyList_SetItem(elt,i,elt1);
2292 PyTuple_SetItem(ret,1,elt);
2298 class MEDFileFieldsIterator
2303 PyObject *next() throw(INTERP_KERNEL::Exception)
2305 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2307 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2310 PyErr_SetString(PyExc_StopIteration,"No more data.");
2317 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2320 static MEDFileIntFieldMultiTS *New();
2321 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2322 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2324 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2325 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2326 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2329 MEDFileIntFieldMultiTS()
2331 return MEDFileIntFieldMultiTS::New();
2334 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2336 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2339 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2341 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2344 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2346 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2347 std::size_t sz(tmp.size());
2348 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2349 for(std::size_t i=0;i<sz;i++)
2351 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2352 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2354 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2357 std::string __str__() const throw(INTERP_KERNEL::Exception)
2359 return self->simpleRepr();
2362 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2364 DataArrayInt *ret1=0;
2365 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2366 PyObject *ret=PyTuple_New(2);
2367 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2368 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2372 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2374 DataArrayInt *ret1=0;
2375 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2376 PyObject *ret=PyTuple_New(2);
2377 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2378 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2382 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2384 DataArrayInt *ret1=0;
2385 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2386 PyObject *ret=PyTuple_New(2);
2387 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2388 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2392 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2394 DataArrayInt *ret1=0;
2395 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2396 PyObject *ret=PyTuple_New(2);
2397 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2398 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2402 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2404 DataArrayInt *ret1=0;
2405 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2406 PyObject *ret=PyTuple_New(2);
2407 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2408 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2412 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2414 DataArrayInt *ret1=0;
2415 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2416 PyObject *ret=PyTuple_New(2);
2417 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2418 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2422 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2424 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2432 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2435 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2436 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2437 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2438 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2439 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2440 void loadArrays() throw(INTERP_KERNEL::Exception);
2441 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2442 void unloadArrays() throw(INTERP_KERNEL::Exception);
2443 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2444 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2445 int getNumberOfFields() const;
2446 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2447 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2449 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2450 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2451 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2452 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2453 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2454 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2455 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2456 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2457 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2462 return MEDFileFields::New();
2465 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2467 return MEDFileFields::New(fileName,loadAll);
2470 std::string __str__() const throw(INTERP_KERNEL::Exception)
2472 return self->simpleRepr();
2475 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2477 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2478 std::size_t sz(tmp.size());
2479 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2480 for(std::size_t i=0;i<sz;i++)
2482 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2483 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2485 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2488 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2491 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2492 PyObject *ret=PyTuple_New(2);
2493 PyObject *ret_0=PyList_New(ret0.size());
2495 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2497 PyObject *elt=PyTuple_New(2);
2498 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2499 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2500 PyList_SetItem(ret_0,rk,elt);
2502 PyTuple_SetItem(ret,0,ret_0);
2503 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2504 PyTuple_SetItem(ret,1,ret_1);
2508 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2510 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2511 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2514 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2516 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2517 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2520 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2522 if(obj && PyList_Check(obj))
2524 int sz=PyList_Size(obj);
2525 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2526 int *pt=da->getPointer();
2527 for(int i=0;i<sz;i++,pt++)
2529 PyObject *elt1=PyList_GetItem(obj,i);
2530 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2532 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2535 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2538 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2540 self->setFieldAtPos(obj,field);
2544 int __len__() const throw(INTERP_KERNEL::Exception)
2546 return self->getNumberOfFields();
2549 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2551 return self->iterator();
2554 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2556 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2557 return self->changeMeshNames(modifTab);
2560 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2562 if(elt0 && PyInt_Check(elt0))
2564 return PyInt_AS_LONG(elt0);
2566 else if(elt0 && PyString_Check(elt0))
2567 return self->getPosFromFieldName(PyString_AsString(elt0));
2569 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2572 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2574 if(PyList_Check(elts))
2576 int sz=PyList_Size(elts);
2577 std::vector<int> ret(sz);
2578 for(int i=0;i<sz;i++)
2580 PyObject *elt=PyList_GetItem(elts,i);
2581 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2587 std::vector<int> ret(1);
2588 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2593 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2595 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2596 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2597 self->pushFields(tmp);
2600 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2602 if(elts && PySlice_Check(elts))
2604 Py_ssize_t strt=2,stp=2,step=2;
2605 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2606 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2607 self->destroyFieldsAtPos2(strt,stp,step);
2611 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2612 if(!idsToRemove.empty())
2613 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2619 class MEDFileParameter1TS : public RefCountObject
2622 void setIteration(int it);
2623 int getIteration() const;
2624 void setOrder(int order);
2625 int getOrder() const;
2626 void setTimeValue(double time);
2627 void setTime(int dt, int it, double time);
2628 double getTime(int& dt, int& it);
2629 double getTimeValue() const;
2632 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2635 void setValue(double val) throw(INTERP_KERNEL::Exception);
2636 double getValue() const throw(INTERP_KERNEL::Exception);
2637 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2640 std::string __str__() const throw(INTERP_KERNEL::Exception)
2642 return self->simpleRepr();
2647 class MEDFileParameterTinyInfo : public MEDFileWritable
2650 void setDescription(const std::string& name);
2651 std::string getDescription() const;
2652 void setTimeUnit(const std::string& unit);
2653 std::string getTimeUnit() const;
2656 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2659 static MEDFileParameterDouble1TS *New();
2660 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2661 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2662 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2663 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2664 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2665 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2666 std::string getName() const throw(INTERP_KERNEL::Exception);
2667 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2670 MEDFileParameterDouble1TS()
2672 return MEDFileParameterDouble1TS::New();
2675 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2677 return MEDFileParameterDouble1TS::New(fileName);
2680 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2682 return MEDFileParameterDouble1TS::New(fileName,paramName);
2685 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2687 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2690 std::string __str__() const throw(INTERP_KERNEL::Exception)
2692 return self->simpleRepr();
2695 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2698 bool ret0=self->isEqual(other,eps,what);
2699 PyObject *res=PyList_New(2);
2700 PyObject *ret0Py=ret0?Py_True:Py_False;
2702 PyList_SetItem(res,0,ret0Py);
2703 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2709 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2712 static MEDFileParameterMultiTS *New();
2713 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2714 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2715 std::string getName() const;
2716 void setName(const std::string& name);
2717 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2718 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2719 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2720 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2721 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2722 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2723 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2724 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2727 MEDFileParameterMultiTS()
2729 return MEDFileParameterMultiTS::New();
2732 MEDFileParameterMultiTS(const std::string& fileName)
2734 return MEDFileParameterMultiTS::New(fileName);
2737 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2739 return MEDFileParameterMultiTS::New(fileName,paramName);
2742 std::string __str__() const throw(INTERP_KERNEL::Exception)
2744 return self->simpleRepr();
2747 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2750 bool ret0=self->isEqual(other,eps,what);
2751 PyObject *res=PyList_New(2);
2752 PyObject *ret0Py=ret0?Py_True:Py_False;
2754 PyList_SetItem(res,0,ret0Py);
2755 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2759 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2763 std::vector<int> pos2;
2764 DataArrayInt *pos3=0;
2765 DataArrayIntTuple *pos4=0;
2766 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2771 self->eraseTimeStepIds(&pos1,&pos1+1);
2778 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2783 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2787 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2791 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2793 if(elt0 && PyInt_Check(elt0))
2795 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2798 else if(elt0 && PyTuple_Check(elt0))
2800 if(PyTuple_Size(elt0)==2)
2802 PyObject *o0=PyTuple_GetItem(elt0,0);
2803 PyObject *o1=PyTuple_GetItem(elt0,1);
2804 if(PyInt_Check(o0) && PyInt_Check(o1))
2806 int iter=PyInt_AS_LONG(o0);
2807 int order=PyInt_AS_LONG(o1);
2808 return self->getPosOfTimeStep(iter,order);
2811 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 !");
2814 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 !");
2816 else if(elt0 && PyFloat_Check(elt0))
2818 double val=PyFloat_AS_DOUBLE(elt0);
2819 return self->getPosGivenTime(val);
2822 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2825 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2827 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2833 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2835 if(PyList_Check(elts))
2837 int sz=PyList_Size(elts);
2838 std::vector<int> ret(sz);
2839 for(int i=0;i<sz;i++)
2841 PyObject *elt=PyList_GetItem(elts,i);
2842 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2848 std::vector<int> ret(1);
2849 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2854 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2856 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2857 if(!idsToRemove.empty())
2858 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2861 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2863 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2869 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2871 std::vector< std::pair<int,int> > res=self->getIterations();
2872 PyObject *ret=PyList_New(res.size());
2874 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2876 PyObject *elt=PyTuple_New(2);
2877 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2878 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2879 PyList_SetItem(ret,rk,elt);
2884 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2886 std::vector<double> res2;
2887 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2888 PyObject *ret=PyList_New(res.size());
2890 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2892 PyObject *elt=PyTuple_New(3);
2893 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2894 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2895 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2896 PyList_SetItem(ret,rk,elt);
2903 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2906 static MEDFileParameters *New();
2907 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2908 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2909 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2910 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2911 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2912 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2913 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2914 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2915 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2916 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2917 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2922 return MEDFileParameters::New();
2925 MEDFileParameters(const std::string& fileName)
2927 return MEDFileParameters::New(fileName);
2930 std::string __str__() const throw(INTERP_KERNEL::Exception)
2932 return self->simpleRepr();
2935 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2937 if(PyInt_Check(obj))
2939 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2944 else if(PyString_Check(obj))
2946 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2952 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2955 int __len__() const throw(INTERP_KERNEL::Exception)
2957 return self->getNumberOfParams();
2960 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2962 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2968 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2970 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2976 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2979 bool ret0=self->isEqual(other,eps,what);
2980 PyObject *res=PyList_New(2);
2981 PyObject *ret0Py=ret0?Py_True:Py_False;
2983 PyList_SetItem(res,0,ret0Py);
2984 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2990 class MEDFileData : public RefCountObject, public MEDFileWritable
2993 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2994 static MEDFileData *New();
2995 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2996 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2997 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2998 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2999 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3000 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3001 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3003 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3004 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3006 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3009 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3011 return MEDFileData::New(fileName);
3016 return MEDFileData::New();
3019 std::string __str__() const throw(INTERP_KERNEL::Exception)
3021 return self->simpleRepr();
3024 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3026 MEDFileMeshes *ret=self->getMeshes();
3032 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3034 MEDFileParameters *ret=self->getParams();
3040 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3042 MEDFileFields *ret=self->getFields();
3048 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3050 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3051 return self->changeMeshNames(modifTab);
3056 class SauvReader : public RefCountObject
3059 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3060 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3063 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3065 return SauvReader::New(fileName);
3070 class SauvWriter : public RefCountObject
3073 static SauvWriter * New();
3074 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3075 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3076 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3077 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3080 SauvWriter() throw(INTERP_KERNEL::Exception)
3082 return SauvWriter::New();
3089 class MEDFileMeshStruct;
3091 class MEDFileField1TSStructItem
3094 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3097 class MEDFileMeshStruct : public RefCountObject
3100 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3102 ~MEDFileMeshStruct();
3105 class MEDMeshMultiLev : public RefCountObject
3108 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3109 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3115 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3117 DataArrayInt *famIds(0);
3118 bool isWithoutCopy(false);
3119 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3120 PyObject *ret=PyTuple_New(2);
3121 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3123 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3124 PyTuple_SetItem(ret,1,ret1Py);
3128 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3130 DataArrayInt *numIds(0);
3131 bool isWithoutCopy(false);
3132 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3133 PyObject *ret=PyTuple_New(2);
3134 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3136 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3137 PyTuple_SetItem(ret,1,ret1Py);
3141 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3143 DataArrayInt *famIds(0);
3144 bool isWithoutCopy(false);
3145 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3146 PyObject *ret=PyTuple_New(2);
3147 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3149 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3150 PyTuple_SetItem(ret,1,ret1Py);
3154 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3156 DataArrayInt *numIds(0);
3157 bool isWithoutCopy(false);
3158 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3159 PyObject *ret=PyTuple_New(2);
3160 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3162 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3163 PyTuple_SetItem(ret,1,ret1Py);
3167 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3169 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3170 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3171 PyObject *res(PyList_New(result.size()));
3172 for(int i=0;iL!=result.end(); i++, iL++)
3173 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3179 class MEDUMeshMultiLev : public MEDMeshMultiLev
3182 ~MEDUMeshMultiLev();
3186 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3188 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3189 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3190 PyObject *ret0Py=ncc?Py_True:Py_False;
3192 PyObject *ret=PyTuple_New(7);
3193 PyTuple_SetItem(ret,0,ret0Py);
3194 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3195 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3196 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3197 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3198 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3199 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3205 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3208 ~MEDStructuredMeshMultiLev();
3211 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3214 ~MEDCMeshMultiLev();
3218 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3221 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3222 std::size_t sz(objs.size());
3223 PyObject *ret(PyTuple_New(2));
3224 PyObject *ret0=PyList_New(sz);
3225 for(std::size_t i=0;i<sz;i++)
3226 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3227 PyTuple_SetItem(ret,0,ret0);
3228 PyObject *ret1Py(isInternal?Py_True:Py_False);
3230 PyTuple_SetItem(ret,1,ret1Py);
3236 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3239 ~MEDCurveLinearMeshMultiLev();
3243 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3245 DataArrayDouble *ret0(0);
3246 std::vector<int> ret1;
3248 self->buildVTUArrays(ret0,ret1,ret2);
3249 std::size_t sz(ret1.size());
3250 PyObject *ret=PyTuple_New(3);
3251 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3252 PyObject *ret1Py=PyList_New(sz);
3253 for(std::size_t i=0;i<sz;i++)
3254 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3255 PyTuple_SetItem(ret,1,ret1Py);
3256 PyObject *ret2Py(ret2?Py_True:Py_False);
3258 PyTuple_SetItem(ret,2,ret2Py);
3264 class MEDFileFastCellSupportComparator : public RefCountObject
3267 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3268 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3269 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3270 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3272 ~MEDFileFastCellSupportComparator();
3276 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3278 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3279 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3280 PyObject *res(PyList_New(result.size()));
3281 for(int i=0;iL!=result.end(); i++, iL++)
3282 PyList_SetItem(res,i,PyInt_FromLong(*iL));