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::MEDFileUMesh::linearToQuadratic;
117 %newobject ParaMEDMEM::MEDFileUMesh::quadraticToLinear;
118 %newobject ParaMEDMEM::MEDFileCMesh::New;
119 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
120 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
121 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
122 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
123 %newobject ParaMEDMEM::MEDFileMeshes::New;
124 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
125 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
126 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
127 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
128 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
130 %newobject ParaMEDMEM::MEDFileFields::New;
131 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
132 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
133 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
134 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
135 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
136 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
137 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
138 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
139 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
140 %newobject ParaMEDMEM::MEDFileFields::__iter__;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
143 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
144 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
145 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
146 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
147 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
148 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
152 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
153 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
154 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
155 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
156 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
157 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
158 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
159 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
160 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
162 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
163 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
164 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
165 %newobject ParaMEDMEM::MEDFileField1TS::New;
166 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
167 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
168 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
169 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
170 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
171 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
172 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
173 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
174 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
176 %newobject ParaMEDMEM::MEDFileData::New;
177 %newobject ParaMEDMEM::MEDFileData::deepCpy;
178 %newobject ParaMEDMEM::MEDFileData::getMeshes;
179 %newobject ParaMEDMEM::MEDFileData::getFields;
180 %newobject ParaMEDMEM::MEDFileData::getParams;
182 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
183 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
184 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
185 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
186 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
187 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
188 %newobject ParaMEDMEM::MEDFileParameters::New;
189 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
190 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
191 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
192 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
194 %newobject ParaMEDMEM::SauvWriter::New;
195 %newobject ParaMEDMEM::SauvReader::New;
196 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
198 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
199 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
200 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
201 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
202 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
204 %feature("unref") MEDFileMesh "$this->decrRef();"
205 %feature("unref") MEDFileUMesh "$this->decrRef();"
206 %feature("unref") MEDFileCMesh "$this->decrRef();"
207 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
208 %feature("unref") MEDFileMeshes "$this->decrRef();"
209 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
210 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
211 %feature("unref") MEDFileField1TS "$this->decrRef();"
212 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
213 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
214 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
215 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
216 %feature("unref") MEDFileFields "$this->decrRef();"
217 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
218 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
219 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
220 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
221 %feature("unref") MEDFileParameters "$this->decrRef();"
222 %feature("unref") MEDFileData "$this->decrRef();"
223 %feature("unref") SauvReader "$this->decrRef();"
224 %feature("unref") SauvWriter "$this->decrRef();"
225 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
226 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
227 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
228 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
229 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
230 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
235 static bool HasXDR();
236 static std::string MEDFileVersionStr();
237 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
238 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
239 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
240 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
245 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
246 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
247 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
248 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
249 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
250 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
251 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
252 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
253 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
256 static PyObject *MEDFileVersion()
258 int major,minor,release;
259 MEDLoader::MEDFileVersion(major,minor,release);
260 PyObject *ret(PyTuple_New(3));
261 PyTuple_SetItem(ret,0,SWIG_From_int(major));
262 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
263 PyTuple_SetItem(ret,2,SWIG_From_int(release));
267 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
269 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
270 PyObject *ret=PyList_New(res.size());
272 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
274 PyObject *elt=PyTuple_New(2);
275 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
276 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
277 PyList_SetItem(ret,rk,elt);
282 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
284 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
285 PyObject *ret=PyList_New(res.size());
287 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
289 PyObject *elt=PyTuple_New(3);
290 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
291 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
292 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
293 PyList_SetItem(ret,rk,elt);
298 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
300 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
301 PyObject *ret=PyList_New(res.size());
303 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
305 PyObject *elt=PyTuple_New(2);
306 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
307 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
308 PyList_SetItem(ret,rk,elt);
312 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
314 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
315 PyObject *ret=PyList_New(res.size());
317 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
319 PyObject *elt=PyTuple_New(2);
320 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
321 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
322 PyList_SetItem(ret,rk,elt);
326 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
328 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
329 PyObject *ret=PyList_New(res.size());
331 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
333 PyObject *elt=PyTuple_New(2);
334 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
335 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
336 PyList_SetItem(ret,rk,elt);
340 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
342 int meshDim,spaceDim,numberOfNodes;
343 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
344 PyObject *ret=PyTuple_New(4);
345 PyObject *elt0=PyList_New(res.size());
347 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
349 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
351 PyObject *elt1=PyList_New(obj2.size());
352 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
354 PyObject *elt2=PyTuple_New(2);
355 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
356 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
357 PyList_SetItem(elt1,j,elt2);
359 PyList_SetItem(elt0,i,elt1);
361 PyTuple_SetItem(ret,0,elt0);
362 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
363 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
364 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
367 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
368 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
370 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
371 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
372 return convertFieldDoubleVecToPy(res);
374 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
376 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
377 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
378 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
380 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
382 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
383 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
384 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
386 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
388 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
389 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
390 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
392 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
394 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
396 PyObject *ret=PyList_New(size);
397 for(int i=0;i<size;i++)
398 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
401 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
403 std::vector<std::string> grps;
404 converPyListToVecString(li,grps);
405 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
407 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
409 std::vector<std::string> fams;
410 converPyListToVecString(li,fams);
411 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
414 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
415 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
416 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
417 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
418 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
419 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);
420 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);
421 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);
422 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);
423 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);
424 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
425 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
426 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
427 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
428 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
429 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
434 class MEDFileWritable
437 void copyOptionsFrom(const MEDFileWritable& other) const;
438 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
439 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
440 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
441 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
444 class MEDFileMeshReadSelector
447 MEDFileMeshReadSelector();
448 MEDFileMeshReadSelector(unsigned int code);
449 unsigned int getCode() const;
450 void setCode(unsigned int newCode);
451 bool isCellFamilyFieldReading() const;
452 bool isNodeFamilyFieldReading() const;
453 bool isCellNameFieldReading() const;
454 bool isNodeNameFieldReading() const;
455 bool isCellNumFieldReading() const;
456 bool isNodeNumFieldReading() const;
457 void setCellFamilyFieldReading(bool b);
458 void setNodeFamilyFieldReading(bool b);
459 void setCellNameFieldReading(bool b);
460 void setNodeNameFieldReading(bool b);
461 void setCellNumFieldReading(bool b);
462 void setNodeNumFieldReading(bool b);
465 std::string __str__() const throw(INTERP_KERNEL::Exception)
467 std::ostringstream oss;
472 std::string __repr__() const throw(INTERP_KERNEL::Exception)
474 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
480 class MEDFileMesh : public RefCountObject, public MEDFileWritable
483 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
484 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
485 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
486 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
487 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
488 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
489 void setName(const std::string& name);
490 std::string getName();
491 std::string getUnivName() const;
492 bool getUnivNameWrStatus() const;
493 void setUnivNameWrStatus(bool newStatus);
494 void setDescription(const std::string& name);
495 std::string getDescription() const;
496 void setOrder(int order);
497 int getOrder() const;
498 void setIteration(int it);
500 void setTimeValue(double time);
501 void setTime(int dt, int it, double time);
502 double getTimeValue() const;
503 void setTimeUnit(const std::string& unit);
504 std::string getTimeUnit() const;
505 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
506 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
507 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
508 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
509 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
510 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
511 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
512 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
513 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
514 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
515 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
516 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
517 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
519 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
520 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
521 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
522 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
523 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
524 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
525 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
526 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
527 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
528 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
529 void clearGrpMap() throw(INTERP_KERNEL::Exception);
530 void clearFamMap() throw(INTERP_KERNEL::Exception);
531 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
532 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
533 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
534 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
535 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
536 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
537 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
538 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
539 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
540 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
541 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
542 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
543 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
544 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
545 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
546 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
547 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
548 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
549 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
550 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
551 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
552 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
553 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
554 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
555 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
556 void setFamilyInfo(const std::map<std::string,int>& info);
557 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
558 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
559 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
560 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
561 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
562 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
563 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
564 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
565 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
566 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
567 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
568 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
569 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
570 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
571 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
572 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
573 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
574 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
575 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
576 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
577 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
579 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
580 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
581 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
582 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
583 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
584 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
590 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
591 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
592 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
595 std::string __str__() const throw(INTERP_KERNEL::Exception)
597 return self->simpleRepr();
600 PyObject *getTime() throw(INTERP_KERNEL::Exception)
603 double tmp0=self->getTime(tmp1,tmp2);
604 PyObject *res = PyList_New(3);
605 PyList_SetItem(res,0,SWIG_From_int(tmp1));
606 PyList_SetItem(res,1,SWIG_From_int(tmp2));
607 PyList_SetItem(res,2,SWIG_From_double(tmp0));
611 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
614 bool ret0=self->isEqual(other,eps,what);
615 PyObject *res=PyList_New(2);
616 PyObject *ret0Py=ret0?Py_True:Py_False;
618 PyList_SetItem(res,0,ret0Py);
619 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
623 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
625 std::vector<const DataArrayInt *> grps;
626 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
627 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
630 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
633 bool ret0=self->areFamsEqual(other,what);
634 PyObject *res=PyList_New(2);
635 PyObject *ret0Py=ret0?Py_True:Py_False;
637 PyList_SetItem(res,0,ret0Py);
638 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
642 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
645 bool ret0=self->areGrpsEqual(other,what);
646 PyObject *res=PyList_New(2);
647 PyObject *ret0Py=ret0?Py_True:Py_False;
649 PyList_SetItem(res,0,ret0Py);
650 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
654 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
656 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
657 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
658 PyObject *res=PyList_New(result.size());
659 for(int i=0;iL!=result.end(); i++, iL++)
660 PyList_SetItem(res,i,PyInt_FromLong(*iL));
664 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
666 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
667 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
668 PyObject *res=PyList_New(result.size());
669 for(int i=0;iL!=result.end(); i++, iL++)
670 PyList_SetItem(res,i,PyInt_FromLong(*iL));
674 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
676 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
679 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
682 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
684 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
687 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
690 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
692 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
695 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
698 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
700 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
703 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
706 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
708 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
711 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
714 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
717 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
718 PyObject *ret=PyTuple_New(2);
719 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
720 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
724 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
726 DataArrayInt *ret3=0;
727 std::vector<int> ret1,ret2;
728 bool ret0=self->unPolyze(ret1,ret2,ret3);
729 PyObject *ret=PyTuple_New(4);
730 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
732 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
733 for(int j=0;j<(int)ret1.size()/3;j++)
735 PyObject *retLev2=PyList_New(3);
736 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
737 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
738 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
739 PyList_SetItem(retLev1_0,j,retLev2);
741 PyTuple_SetItem(ret,1,retLev1_0);
743 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
744 for(int j=0;j<(int)ret2.size()/3;j++)
746 PyObject *retLev2=PyList_New(3);
747 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
748 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
749 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
750 PyList_SetItem(retLev1_1,j,retLev2);
752 PyTuple_SetItem(ret,2,retLev1_1);
754 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
760 class MEDFileUMesh : public MEDFileMesh
763 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
764 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
765 static MEDFileUMesh *New();
767 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
768 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
770 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
771 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
772 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
773 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
774 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
775 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
776 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
777 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
778 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
779 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
780 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
781 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
782 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
783 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
784 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
785 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
786 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
787 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
788 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
789 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
791 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
792 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
793 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
794 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
795 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
796 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
797 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
798 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
799 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
800 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
801 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
802 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
803 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
806 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
808 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
811 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
813 return MEDFileUMesh::New(fileName,mrs);
818 return MEDFileUMesh::New();
822 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
824 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
827 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)
829 std::vector<int> typesCpp1;
830 convertPyToNewIntArr3(types,typesCpp1);
831 std::size_t sz(typesCpp1.size());
832 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
833 for(std::size_t ii=0;ii<sz;ii++)
834 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
835 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
838 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
839 {// put an empty dict in input to say to __new__ to call __init__...
840 PyObject *ret(PyTuple_New(1));
841 PyObject *ret0(PyDict_New());
842 PyTuple_SetItem(ret,0,ret0);
846 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
848 std::vector<double> a0;
850 std::vector<std::string> a2;
851 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
852 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
853 self->serialize(a0,a1,a2,a3,a4);
854 PyObject *ret(PyTuple_New(5));
855 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
856 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
858 PyObject *ret2(PyList_New(sz));
859 for(int i=0;i<sz;i++)
860 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
861 PyTuple_SetItem(ret,2,ret2);
863 PyObject *ret3(PyList_New(sz));
864 for(int i=0;i<sz;i++)
866 DataArrayInt *elt(a3[i]);
869 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
871 PyTuple_SetItem(ret,3,ret3);
872 DataArrayDouble *ret4(a4);
875 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
879 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
881 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
882 if(!PyTuple_Check(inp))
883 throw INTERP_KERNEL::Exception(MSG);
884 int sz(PyTuple_Size(inp));
886 throw INTERP_KERNEL::Exception(MSG);
887 std::vector<double> a0;
889 std::vector<std::string> a2;
890 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
891 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
893 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
895 fillArrayWithPyListDbl3(a0py,tmp,a0);
896 convertPyToNewIntArr3(a1py,a1);
897 fillStringVector(a2py,a2);
899 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
901 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
902 if(!SWIG_IsOK(status))
903 throw INTERP_KERNEL::Exception(MSG);
904 a4=reinterpret_cast<DataArrayDouble *>(argp);
905 if((DataArrayDouble *)a4)
908 std::vector< DataArrayInt * > a3Tmp;
909 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
910 std::size_t sz(a3Tmp.size());
912 for(std::size_t i=0;i<sz;i++)
918 self->unserialize(a0,a1,a2,a3,a4);
922 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
924 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
927 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
930 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
931 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
934 self->setMeshAtLevel(meshDimRelToMax,m0,false);
937 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
940 self->setMeshAtLevel(meshDimRelToMax,m1);
943 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
946 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
948 self->removeMeshAtLevel(meshDimRelToMax);
951 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
953 std::vector<const MEDCouplingUMesh *> ms;
954 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
955 self->setMeshes(ms,renum);
958 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
960 std::vector<const MEDCouplingUMesh *> ms;
961 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
962 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
965 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
967 std::vector<const MEDCouplingUMesh *> ms;
968 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
969 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
972 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
974 DataArrayDouble *ret=self->getCoords();
980 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
982 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
985 return const_cast<PartDefinition *>(ret);
988 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
990 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
991 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
992 PyObject *ret=PyTuple_New(3);
993 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
994 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
995 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
999 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1001 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1007 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1009 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1010 std::size_t sz(tmp.size());
1011 PyObject *ret=PyList_New(sz);
1012 for(std::size_t i=0;i<sz;i++)
1016 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1023 class MEDFileStructuredMesh : public MEDFileMesh
1028 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1030 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1038 class MEDFileCMesh : public MEDFileStructuredMesh
1041 static MEDFileCMesh *New();
1042 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1043 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1044 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1045 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1050 return MEDFileCMesh::New();
1053 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1055 return MEDFileCMesh::New(fileName,mrs);
1058 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1060 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1063 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1065 const MEDCouplingCMesh *tmp=self->getMesh();
1068 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1073 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1076 static MEDFileCurveLinearMesh *New();
1077 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1078 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1079 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1082 MEDFileCurveLinearMesh()
1084 return MEDFileCurveLinearMesh::New();
1087 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1089 return MEDFileCurveLinearMesh::New(fileName,mrs);
1092 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1094 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1097 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1099 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1102 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1107 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1110 static MEDFileMeshMultiTS *New();
1111 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1112 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1113 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1114 std::string getName() const throw(INTERP_KERNEL::Exception);
1115 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1116 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1119 MEDFileMeshMultiTS()
1121 return MEDFileMeshMultiTS::New();
1124 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1126 return MEDFileMeshMultiTS::New(fileName);
1129 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1131 return MEDFileMeshMultiTS::New(fileName,mName);
1134 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1136 MEDFileMesh *ret=self->getOneTimeStep();
1144 class MEDFileMeshesIterator
1149 PyObject *next() throw(INTERP_KERNEL::Exception)
1151 MEDFileMesh *ret=self->nextt();
1155 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1159 PyErr_SetString(PyExc_StopIteration,"No more data.");
1166 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1169 static MEDFileMeshes *New();
1170 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1171 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1172 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1173 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1174 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1176 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1177 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1178 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1179 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1184 return MEDFileMeshes::New();
1187 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1189 return MEDFileMeshes::New(fileName);
1192 std::string __str__() const throw(INTERP_KERNEL::Exception)
1194 return self->simpleRepr();
1197 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1199 if(PyInt_Check(obj))
1201 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1206 else if(PyString_Check(obj))
1208 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1214 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1217 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1219 self->setMeshAtPos(obj,mesh);
1223 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1225 return self->iterator();
1228 int __len__() const throw(INTERP_KERNEL::Exception)
1230 return self->getNumberOfMeshes();
1233 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1235 MEDFileMesh *ret=self->getMeshAtPos(i);
1240 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1242 MEDFileMesh *ret=self->getMeshWithName(mname);
1250 class MEDFileFieldLoc : public RefCountObject
1253 std::string getName() const;
1254 int getDimension() const;
1255 int getNumberOfGaussPoints() const;
1256 int getNumberOfPointsInCells() const;
1257 const std::vector<double>& getRefCoords() const;
1258 const std::vector<double>& getGaussCoords() const;
1259 const std::vector<double>& getGaussWeights() const;
1260 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1263 std::string __str__() const throw(INTERP_KERNEL::Exception)
1265 return self->repr();
1270 class MEDFileFieldGlobsReal
1273 void resetContent();
1274 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1275 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1276 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1277 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1278 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1279 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1280 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1281 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1282 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1283 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1284 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1285 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1286 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1287 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1288 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1289 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1290 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1291 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1292 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1293 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1294 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1295 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1296 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1297 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1298 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1299 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1302 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1304 const DataArrayInt *ret=self->getProfile(pflName);
1307 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1310 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1312 const DataArrayInt *ret=self->getProfileFromId(pflId);
1315 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1318 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1320 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1323 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1326 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1328 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1331 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1334 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1336 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1337 return convertVecPairVecStToPy(ret);
1340 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1342 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1343 return convertVecPairVecStToPy(ret);
1346 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1348 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1349 self->changePflsNames(v);
1352 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1354 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1355 self->changePflsRefsNamesGen(v);
1358 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1360 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1361 self->changePflsNamesInStruct(v);
1364 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1366 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1367 self->changeLocsNames(v);
1370 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1372 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1373 self->changeLocsRefsNamesGen(v);
1376 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1378 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1379 self->changeLocsNamesInStruct(v);
1382 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1384 std::ostringstream oss;
1385 self->simpleReprGlobs(oss);
1391 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1394 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1395 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1396 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1397 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1398 void loadArrays() throw(INTERP_KERNEL::Exception);
1399 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1400 void unloadArrays() throw(INTERP_KERNEL::Exception);
1401 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1402 int getDimension() const throw(INTERP_KERNEL::Exception);
1403 int getIteration() const throw(INTERP_KERNEL::Exception);
1404 int getOrder() const throw(INTERP_KERNEL::Exception);
1405 std::string getName() throw(INTERP_KERNEL::Exception);
1406 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1407 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1408 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1409 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1410 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1411 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1412 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1413 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1414 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1415 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1416 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1417 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1418 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1419 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1420 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1423 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1426 double tmp0=self->getTime(tmp1,tmp2);
1427 PyObject *res = PyList_New(3);
1428 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1429 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1430 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1434 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1436 std::pair<int,int> res=self->getDtIt();
1437 PyObject *elt=PyTuple_New(2);
1438 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1439 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1443 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1445 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1448 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1450 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1453 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1455 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1456 return self->changeMeshNames(modifTab);
1459 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1461 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1462 PyObject *ret2=PyList_New(ret.size());
1463 for(int i=0;i<(int)ret.size();i++)
1464 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1468 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1470 std::vector<int> ret1;
1471 int ret0=self->getNonEmptyLevels(mname,ret1);
1472 PyObject *elt=PyTuple_New(2);
1473 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1474 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1478 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1480 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1481 std::vector< std::vector<TypeOfField> > typesF;
1482 std::vector< std::vector<std::string> > pfls;
1483 std::vector< std::vector<std::string> > locs;
1484 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1486 PyObject *ret2=PyList_New(sz);
1487 for(int i=0;i<sz;i++)
1489 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1490 const std::vector<TypeOfField>& typesFI=typesF[i];
1491 const std::vector<std::string>& pflsI=pfls[i];
1492 const std::vector<std::string>& locsI=locs[i];
1493 PyObject *elt=PyTuple_New(2);
1494 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1495 int sz2=ret[i].size();
1496 PyObject *elt2=PyList_New(sz2);
1497 for(int j=0;j<sz2;j++)
1499 PyObject *elt3=PyTuple_New(4);
1500 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1501 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));
1502 PyTuple_SetItem(elt3,1,elt4);
1503 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1504 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1505 PyList_SetItem(elt2,j,elt3);
1507 PyTuple_SetItem(elt,1,elt2);
1508 PyList_SetItem(ret2,i,elt);
1513 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1515 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1516 std::size_t sz=ret.size();
1517 PyObject *retPy=PyList_New(sz);
1518 for(std::size_t i=0;i<sz;i++)
1519 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1523 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1525 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1526 std::size_t sz=ret.size();
1527 PyObject *retPy=PyList_New(sz);
1528 for(std::size_t i=0;i<sz;i++)
1529 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1533 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1535 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1536 std::size_t sz=ret.size();
1537 PyObject *retPy=PyList_New(sz);
1538 for(std::size_t i=0;i<sz;i++)
1539 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1545 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1548 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1549 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1550 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1551 static MEDFileField1TS *New();
1552 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1553 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1554 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1555 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1556 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1557 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1559 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1560 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1561 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1562 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1565 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1567 return MEDFileField1TS::New(fileName,loadAll);
1570 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1572 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1575 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1577 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1582 return MEDFileField1TS::New();
1585 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1587 const DataArrayDouble *arr=0;
1589 arr=field->getArray();
1590 self->copyTinyInfoFrom(field,arr);
1593 std::string __str__() const throw(INTERP_KERNEL::Exception)
1595 return self->simpleRepr();
1598 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1600 DataArrayInt *ret1=0;
1601 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1602 PyObject *ret=PyTuple_New(2);
1603 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1604 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1608 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1610 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1611 std::vector< std::vector<TypeOfField> > typesF;
1612 std::vector< std::vector<std::string> > pfls;
1613 std::vector< std::vector<std::string> > locs;
1614 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1616 PyObject *ret2=PyList_New(sz);
1617 for(int i=0;i<sz;i++)
1619 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1620 const std::vector<TypeOfField>& typesFI=typesF[i];
1621 const std::vector<std::string>& pflsI=pfls[i];
1622 const std::vector<std::string>& locsI=locs[i];
1623 PyObject *elt=PyTuple_New(2);
1624 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1625 int sz2=ret[i].size();
1626 PyObject *elt2=PyList_New(sz2);
1627 for(int j=0;j<sz2;j++)
1629 PyObject *elt3=PyTuple_New(4);
1630 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1631 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1632 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1633 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1634 PyList_SetItem(elt2,j,elt3);
1636 PyTuple_SetItem(elt,1,elt2);
1637 PyList_SetItem(ret2,i,elt);
1642 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1644 DataArrayDouble *ret=self->getUndergroundDataArray();
1650 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1652 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1653 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1656 PyObject *ret=PyTuple_New(2);
1657 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1658 std::size_t sz=elt1Cpp.size();
1659 PyObject *elt=PyList_New(sz);
1660 for(std::size_t i=0;i<sz;i++)
1662 PyObject *elt1=PyTuple_New(2);
1663 PyObject *elt2=PyTuple_New(2);
1664 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1665 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1666 PyObject *elt3=PyTuple_New(2);
1667 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1668 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1669 PyTuple_SetItem(elt1,0,elt2);
1670 PyTuple_SetItem(elt1,1,elt3);
1671 PyList_SetItem(elt,i,elt1);
1673 PyTuple_SetItem(ret,1,elt);
1679 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1682 static MEDFileIntField1TS *New();
1683 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1684 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1685 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1686 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1688 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1689 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1692 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1694 return MEDFileIntField1TS::New();
1697 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1699 return MEDFileIntField1TS::New(fileName,loadAll);
1702 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1704 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1707 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1709 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1712 std::string __str__() const throw(INTERP_KERNEL::Exception)
1714 return self->simpleRepr();
1717 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1719 DataArrayInt *ret1=0;
1720 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1721 PyObject *ret=PyTuple_New(2);
1722 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1723 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1727 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1729 DataArrayInt *ret1=0;
1730 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1731 PyObject *ret=PyTuple_New(2);
1732 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1733 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1737 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1739 DataArrayInt *ret1=0;
1740 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1741 PyObject *ret=PyTuple_New(2);
1742 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1743 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1747 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1749 DataArrayInt *ret1=0;
1750 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1751 PyObject *ret=PyTuple_New(2);
1752 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1753 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1757 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1759 DataArrayInt *ret1=0;
1760 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1761 PyObject *ret=PyTuple_New(2);
1762 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1763 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1767 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1769 DataArrayInt *ret1=0;
1770 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1771 PyObject *ret=PyTuple_New(2);
1772 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1773 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1777 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1779 DataArrayInt *ret=self->getUndergroundDataArray();
1787 class MEDFileAnyTypeFieldMultiTSIterator
1792 PyObject *next() throw(INTERP_KERNEL::Exception)
1794 MEDFileAnyTypeField1TS *ret=self->nextt();
1796 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1799 PyErr_SetString(PyExc_StopIteration,"No more data.");
1806 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1809 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1810 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1811 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1812 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1813 std::string getName() const throw(INTERP_KERNEL::Exception);
1814 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1815 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1816 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1817 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1818 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1819 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1820 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1821 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1822 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1823 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1824 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1825 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1826 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1827 void loadArrays() throw(INTERP_KERNEL::Exception);
1828 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1829 void unloadArrays() throw(INTERP_KERNEL::Exception);
1830 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1832 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1833 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1834 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1835 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1836 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1839 int __len__() const throw(INTERP_KERNEL::Exception)
1841 return self->getNumberOfTS();
1844 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1846 if(elt0 && PyInt_Check(elt0))
1848 int pos=PyInt_AS_LONG(elt0);
1851 else if(elt0 && PyTuple_Check(elt0))
1853 if(PyTuple_Size(elt0)==2)
1855 PyObject *o0=PyTuple_GetItem(elt0,0);
1856 PyObject *o1=PyTuple_GetItem(elt0,1);
1857 if(PyInt_Check(o0) && PyInt_Check(o1))
1859 int iter=PyInt_AS_LONG(o0);
1860 int order=PyInt_AS_LONG(o1);
1861 return self->getPosOfTimeStep(iter,order);
1864 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 !");
1867 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 !");
1869 else if(elt0 && PyFloat_Check(elt0))
1871 double val=PyFloat_AS_DOUBLE(elt0);
1872 return self->getPosGivenTime(val);
1875 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1878 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1880 std::vector< std::pair<int,int> > res=self->getIterations();
1881 PyObject *ret=PyList_New(res.size());
1883 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1885 PyObject *elt=PyTuple_New(2);
1886 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1887 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1888 PyList_SetItem(ret,rk,elt);
1893 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1895 std::vector<double> ret1;
1896 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1897 std::size_t sz=ret.size();
1898 PyObject *ret2=PyList_New(sz);
1899 for(std::size_t i=0;i<sz;i++)
1901 PyObject *elt=PyTuple_New(3);
1902 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1903 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1904 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1905 PyList_SetItem(ret2,i,elt);
1910 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1912 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1913 PyObject *ret2=PyList_New(ret.size());
1914 for(int i=0;i<(int)ret.size();i++)
1916 const std::vector<TypeOfField>& rett=ret[i];
1917 PyObject *ret3=PyList_New(rett.size());
1918 for(int j=0;j<(int)rett.size();j++)
1919 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1920 PyList_SetItem(ret2,i,ret3);
1925 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1927 std::vector<int> ret1;
1928 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1929 PyObject *elt=PyTuple_New(2);
1930 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1931 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1935 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1937 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1938 std::vector< std::vector<TypeOfField> > typesF;
1939 std::vector< std::vector<std::string> > pfls;
1940 std::vector< std::vector<std::string> > locs;
1941 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1943 PyObject *ret2=PyList_New(sz);
1944 for(int i=0;i<sz;i++)
1946 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1947 const std::vector<TypeOfField>& typesFI=typesF[i];
1948 const std::vector<std::string>& pflsI=pfls[i];
1949 const std::vector<std::string>& locsI=locs[i];
1950 PyObject *elt=PyTuple_New(2);
1951 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1952 int sz2=ret[i].size();
1953 PyObject *elt2=PyList_New(sz2);
1954 for(int j=0;j<sz2;j++)
1956 PyObject *elt3=PyTuple_New(4);
1957 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1958 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));
1959 PyTuple_SetItem(elt3,1,elt4);
1960 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1961 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1962 PyList_SetItem(elt2,j,elt3);
1964 PyTuple_SetItem(elt,1,elt2);
1965 PyList_SetItem(ret2,i,elt);
1970 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1972 if(PyList_Check(elts))
1974 int sz=PyList_Size(elts);
1975 std::vector<int> ret(sz);
1976 for(int i=0;i<sz;i++)
1978 PyObject *elt=PyList_GetItem(elts,i);
1979 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1985 std::vector<int> ret(1);
1986 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1991 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1993 if(PySlice_Check(elts))
1995 Py_ssize_t strt=2,stp=2,step=2;
1996 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1997 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1998 self->eraseTimeStepIds2(strt,stp,step);
2002 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2003 if(!idsToRemove.empty())
2004 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2008 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2012 std::vector<int> pos2;
2013 DataArrayInt *pos3=0;
2014 DataArrayIntTuple *pos4=0;
2015 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2020 self->eraseTimeStepIds(&pos1,&pos1+1);
2027 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2032 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2036 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2040 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2042 return self->iterator();
2045 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2047 if(elt0 && PyList_Check(elt0))
2049 int sz=PyList_Size(elt0);
2050 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2051 int *pt=da->getPointer();
2052 for(int i=0;i<sz;i++,pt++)
2054 PyObject *elt1=PyList_GetItem(elt0,i);
2055 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2057 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2059 else if(elt0 && PySlice_Check(elt0))
2061 Py_ssize_t strt=2,stp=2,step=2;
2062 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2063 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2064 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2067 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2070 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2072 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2073 return self->changeMeshNames(modifTab);
2076 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2078 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2079 std::size_t sz=ret.size();
2080 PyObject *retPy=PyList_New(sz);
2081 for(std::size_t i=0;i<sz;i++)
2082 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2086 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2088 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2089 std::size_t sz=ret.size();
2090 PyObject *retPy=PyList_New(sz);
2091 for(std::size_t i=0;i<sz;i++)
2092 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2096 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2098 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2099 std::size_t sz=ret.size();
2100 PyObject *retPy=PyList_New(sz);
2101 for(std::size_t i=0;i<sz;i++)
2102 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2106 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2109 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2110 if(SWIG_IsOK(status))
2112 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2116 std::vector<MEDFileAnyTypeField1TS *> tmp;
2117 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2118 self->pushBackTimeSteps(tmp);
2122 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2124 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2125 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2126 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2127 std::size_t sz=ret.size();
2128 PyObject *retPy=PyList_New(sz);
2129 for(std::size_t i=0;i<sz;i++)
2131 std::size_t sz2=ret[i].size();
2132 PyObject *ret1Py=PyList_New(sz2);
2133 for(std::size_t j=0;j<sz2;j++)
2135 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2138 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2140 PyList_SetItem(retPy,i,ret1Py);
2145 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2147 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2148 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2149 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2150 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2151 if(ret2.size()!=ret.size())
2153 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2154 throw INTERP_KERNEL::Exception(oss.str().c_str());
2156 std::size_t sz=ret.size();
2157 PyObject *retPy=PyList_New(sz);
2158 for(std::size_t i=0;i<sz;i++)
2160 std::size_t sz2=ret[i].size();
2161 PyObject *ret0Py=PyTuple_New(2);
2162 PyObject *ret1Py=PyList_New(sz2);
2163 for(std::size_t j=0;j<sz2;j++)
2165 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2168 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2170 PyTuple_SetItem(ret0Py,0,ret1Py);
2171 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2172 PyList_SetItem(retPy,i,ret0Py);
2179 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2182 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2183 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2184 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2186 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2187 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2188 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2189 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2190 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2192 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2193 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2194 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2197 MEDFileFieldMultiTS()
2199 return MEDFileFieldMultiTS::New();
2202 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2204 return MEDFileFieldMultiTS::New(fileName,loadAll);
2207 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2209 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2212 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2214 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2215 std::size_t sz(tmp.size());
2216 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2217 for(std::size_t i=0;i<sz;i++)
2219 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2220 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2222 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2225 std::string __str__() const throw(INTERP_KERNEL::Exception)
2227 return self->simpleRepr();
2230 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2232 DataArrayInt *ret1=0;
2233 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2234 PyObject *ret=PyTuple_New(2);
2235 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2236 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2240 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2242 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2243 std::vector< std::vector<TypeOfField> > typesF;
2244 std::vector< std::vector<std::string> > pfls;
2245 std::vector< std::vector<std::string> > locs;
2246 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2248 PyObject *ret2=PyList_New(sz);
2249 for(int i=0;i<sz;i++)
2251 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2252 const std::vector<TypeOfField>& typesFI=typesF[i];
2253 const std::vector<std::string>& pflsI=pfls[i];
2254 const std::vector<std::string>& locsI=locs[i];
2255 PyObject *elt=PyTuple_New(2);
2256 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2257 int sz2=ret[i].size();
2258 PyObject *elt2=PyList_New(sz2);
2259 for(int j=0;j<sz2;j++)
2261 PyObject *elt3=PyTuple_New(4);
2262 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2263 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2264 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2265 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2266 PyList_SetItem(elt2,j,elt3);
2268 PyTuple_SetItem(elt,1,elt2);
2269 PyList_SetItem(ret2,i,elt);
2273 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2275 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2281 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2283 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2284 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2287 PyObject *ret=PyTuple_New(2);
2288 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2289 std::size_t sz=elt1Cpp.size();
2290 PyObject *elt=PyList_New(sz);
2291 for(std::size_t i=0;i<sz;i++)
2293 PyObject *elt1=PyTuple_New(2);
2294 PyObject *elt2=PyTuple_New(2);
2295 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2296 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2297 PyObject *elt3=PyTuple_New(2);
2298 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2299 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2300 PyTuple_SetItem(elt1,0,elt2);
2301 PyTuple_SetItem(elt1,1,elt3);
2302 PyList_SetItem(elt,i,elt1);
2304 PyTuple_SetItem(ret,1,elt);
2310 class MEDFileFieldsIterator
2315 PyObject *next() throw(INTERP_KERNEL::Exception)
2317 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2319 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2322 PyErr_SetString(PyExc_StopIteration,"No more data.");
2329 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2332 static MEDFileIntFieldMultiTS *New();
2333 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2334 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2336 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2337 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2338 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2341 MEDFileIntFieldMultiTS()
2343 return MEDFileIntFieldMultiTS::New();
2346 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2348 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2351 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2353 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2356 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2358 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2359 std::size_t sz(tmp.size());
2360 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2361 for(std::size_t i=0;i<sz;i++)
2363 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2364 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2366 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2369 std::string __str__() const throw(INTERP_KERNEL::Exception)
2371 return self->simpleRepr();
2374 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2376 DataArrayInt *ret1=0;
2377 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2378 PyObject *ret=PyTuple_New(2);
2379 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2380 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2384 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2386 DataArrayInt *ret1=0;
2387 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2388 PyObject *ret=PyTuple_New(2);
2389 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2390 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2394 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2396 DataArrayInt *ret1=0;
2397 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2398 PyObject *ret=PyTuple_New(2);
2399 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2400 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2404 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2406 DataArrayInt *ret1=0;
2407 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2408 PyObject *ret=PyTuple_New(2);
2409 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2410 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2414 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2416 DataArrayInt *ret1=0;
2417 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2418 PyObject *ret=PyTuple_New(2);
2419 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2420 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2424 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2426 DataArrayInt *ret1=0;
2427 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2428 PyObject *ret=PyTuple_New(2);
2429 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2430 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2434 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2436 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2444 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2447 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2448 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2449 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2450 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2451 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2452 void loadArrays() throw(INTERP_KERNEL::Exception);
2453 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2454 void unloadArrays() throw(INTERP_KERNEL::Exception);
2455 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2456 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2457 int getNumberOfFields() const;
2458 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2459 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2461 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2462 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2463 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2464 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2465 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2466 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2467 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2468 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2469 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2474 return MEDFileFields::New();
2477 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2479 return MEDFileFields::New(fileName,loadAll);
2482 std::string __str__() const throw(INTERP_KERNEL::Exception)
2484 return self->simpleRepr();
2487 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2489 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2490 std::size_t sz(tmp.size());
2491 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2492 for(std::size_t i=0;i<sz;i++)
2494 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2495 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2497 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2500 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2503 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2504 PyObject *ret=PyTuple_New(2);
2505 PyObject *ret_0=PyList_New(ret0.size());
2507 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2509 PyObject *elt=PyTuple_New(2);
2510 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2511 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2512 PyList_SetItem(ret_0,rk,elt);
2514 PyTuple_SetItem(ret,0,ret_0);
2515 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2516 PyTuple_SetItem(ret,1,ret_1);
2520 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2522 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2523 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2526 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2528 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2529 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2532 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2534 if(obj && PyList_Check(obj))
2536 int sz=PyList_Size(obj);
2537 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2538 int *pt=da->getPointer();
2539 for(int i=0;i<sz;i++,pt++)
2541 PyObject *elt1=PyList_GetItem(obj,i);
2542 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2544 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2547 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2550 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2552 self->setFieldAtPos(obj,field);
2556 int __len__() const throw(INTERP_KERNEL::Exception)
2558 return self->getNumberOfFields();
2561 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2563 return self->iterator();
2566 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2568 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2569 return self->changeMeshNames(modifTab);
2572 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2574 if(elt0 && PyInt_Check(elt0))
2576 return PyInt_AS_LONG(elt0);
2578 else if(elt0 && PyString_Check(elt0))
2579 return self->getPosFromFieldName(PyString_AsString(elt0));
2581 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2584 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2586 if(PyList_Check(elts))
2588 int sz=PyList_Size(elts);
2589 std::vector<int> ret(sz);
2590 for(int i=0;i<sz;i++)
2592 PyObject *elt=PyList_GetItem(elts,i);
2593 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2599 std::vector<int> ret(1);
2600 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2605 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2607 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2608 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2609 self->pushFields(tmp);
2612 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2614 if(elts && PySlice_Check(elts))
2616 Py_ssize_t strt=2,stp=2,step=2;
2617 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2618 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2619 self->destroyFieldsAtPos2(strt,stp,step);
2623 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2624 if(!idsToRemove.empty())
2625 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2631 class MEDFileParameter1TS : public RefCountObject
2634 void setIteration(int it);
2635 int getIteration() const;
2636 void setOrder(int order);
2637 int getOrder() const;
2638 void setTimeValue(double time);
2639 void setTime(int dt, int it, double time);
2640 double getTime(int& dt, int& it);
2641 double getTimeValue() const;
2644 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2647 void setValue(double val) throw(INTERP_KERNEL::Exception);
2648 double getValue() const throw(INTERP_KERNEL::Exception);
2649 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2652 std::string __str__() const throw(INTERP_KERNEL::Exception)
2654 return self->simpleRepr();
2659 class MEDFileParameterTinyInfo : public MEDFileWritable
2662 void setDescription(const std::string& name);
2663 std::string getDescription() const;
2664 void setTimeUnit(const std::string& unit);
2665 std::string getTimeUnit() const;
2668 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2671 static MEDFileParameterDouble1TS *New();
2672 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2673 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2674 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2675 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2676 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2677 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2678 std::string getName() const throw(INTERP_KERNEL::Exception);
2679 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2682 MEDFileParameterDouble1TS()
2684 return MEDFileParameterDouble1TS::New();
2687 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2689 return MEDFileParameterDouble1TS::New(fileName);
2692 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2694 return MEDFileParameterDouble1TS::New(fileName,paramName);
2697 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2699 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2702 std::string __str__() const throw(INTERP_KERNEL::Exception)
2704 return self->simpleRepr();
2707 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2710 bool ret0=self->isEqual(other,eps,what);
2711 PyObject *res=PyList_New(2);
2712 PyObject *ret0Py=ret0?Py_True:Py_False;
2714 PyList_SetItem(res,0,ret0Py);
2715 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2721 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2724 static MEDFileParameterMultiTS *New();
2725 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2726 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2727 std::string getName() const;
2728 void setName(const std::string& name);
2729 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2730 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2731 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2732 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2733 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2734 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2735 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2736 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2739 MEDFileParameterMultiTS()
2741 return MEDFileParameterMultiTS::New();
2744 MEDFileParameterMultiTS(const std::string& fileName)
2746 return MEDFileParameterMultiTS::New(fileName);
2749 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2751 return MEDFileParameterMultiTS::New(fileName,paramName);
2754 std::string __str__() const throw(INTERP_KERNEL::Exception)
2756 return self->simpleRepr();
2759 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2762 bool ret0=self->isEqual(other,eps,what);
2763 PyObject *res=PyList_New(2);
2764 PyObject *ret0Py=ret0?Py_True:Py_False;
2766 PyList_SetItem(res,0,ret0Py);
2767 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2771 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2775 std::vector<int> pos2;
2776 DataArrayInt *pos3=0;
2777 DataArrayIntTuple *pos4=0;
2778 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2783 self->eraseTimeStepIds(&pos1,&pos1+1);
2790 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2795 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2799 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2803 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2805 if(elt0 && PyInt_Check(elt0))
2807 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2810 else if(elt0 && PyTuple_Check(elt0))
2812 if(PyTuple_Size(elt0)==2)
2814 PyObject *o0=PyTuple_GetItem(elt0,0);
2815 PyObject *o1=PyTuple_GetItem(elt0,1);
2816 if(PyInt_Check(o0) && PyInt_Check(o1))
2818 int iter=PyInt_AS_LONG(o0);
2819 int order=PyInt_AS_LONG(o1);
2820 return self->getPosOfTimeStep(iter,order);
2823 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 !");
2826 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 !");
2828 else if(elt0 && PyFloat_Check(elt0))
2830 double val=PyFloat_AS_DOUBLE(elt0);
2831 return self->getPosGivenTime(val);
2834 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2837 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2839 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2845 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2847 if(PyList_Check(elts))
2849 int sz=PyList_Size(elts);
2850 std::vector<int> ret(sz);
2851 for(int i=0;i<sz;i++)
2853 PyObject *elt=PyList_GetItem(elts,i);
2854 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2860 std::vector<int> ret(1);
2861 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2866 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2868 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2869 if(!idsToRemove.empty())
2870 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2873 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2875 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2881 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2883 std::vector< std::pair<int,int> > res=self->getIterations();
2884 PyObject *ret=PyList_New(res.size());
2886 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2888 PyObject *elt=PyTuple_New(2);
2889 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2890 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2891 PyList_SetItem(ret,rk,elt);
2896 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2898 std::vector<double> res2;
2899 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2900 PyObject *ret=PyList_New(res.size());
2902 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2904 PyObject *elt=PyTuple_New(3);
2905 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2906 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2907 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2908 PyList_SetItem(ret,rk,elt);
2915 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2918 static MEDFileParameters *New();
2919 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2920 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2921 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2922 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2923 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2924 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2925 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2926 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2927 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2928 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2929 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2934 return MEDFileParameters::New();
2937 MEDFileParameters(const std::string& fileName)
2939 return MEDFileParameters::New(fileName);
2942 std::string __str__() const throw(INTERP_KERNEL::Exception)
2944 return self->simpleRepr();
2947 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2949 if(PyInt_Check(obj))
2951 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2956 else if(PyString_Check(obj))
2958 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2964 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2967 int __len__() const throw(INTERP_KERNEL::Exception)
2969 return self->getNumberOfParams();
2972 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2974 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2980 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2982 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2988 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2991 bool ret0=self->isEqual(other,eps,what);
2992 PyObject *res=PyList_New(2);
2993 PyObject *ret0Py=ret0?Py_True:Py_False;
2995 PyList_SetItem(res,0,ret0Py);
2996 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3002 class MEDFileData : public RefCountObject, public MEDFileWritable
3005 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3006 static MEDFileData *New();
3007 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3008 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3009 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3010 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3011 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3012 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3013 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3015 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3016 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3018 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3021 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3023 return MEDFileData::New(fileName);
3028 return MEDFileData::New();
3031 std::string __str__() const throw(INTERP_KERNEL::Exception)
3033 return self->simpleRepr();
3036 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3038 MEDFileMeshes *ret=self->getMeshes();
3044 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3046 MEDFileParameters *ret=self->getParams();
3052 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3054 MEDFileFields *ret=self->getFields();
3060 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3062 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3063 return self->changeMeshNames(modifTab);
3068 class SauvReader : public RefCountObject
3071 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3072 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3075 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3077 return SauvReader::New(fileName);
3082 class SauvWriter : public RefCountObject
3085 static SauvWriter * New();
3086 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3087 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3088 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3089 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3092 SauvWriter() throw(INTERP_KERNEL::Exception)
3094 return SauvWriter::New();
3101 class MEDFileMeshStruct;
3103 class MEDFileField1TSStructItem
3106 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3109 class MEDFileMeshStruct : public RefCountObject
3112 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3114 ~MEDFileMeshStruct();
3117 class MEDMeshMultiLev : public RefCountObject
3120 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3121 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3127 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3129 DataArrayInt *famIds(0);
3130 bool isWithoutCopy(false);
3131 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3132 PyObject *ret=PyTuple_New(2);
3133 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3135 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3136 PyTuple_SetItem(ret,1,ret1Py);
3140 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3142 DataArrayInt *numIds(0);
3143 bool isWithoutCopy(false);
3144 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3145 PyObject *ret=PyTuple_New(2);
3146 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3148 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3149 PyTuple_SetItem(ret,1,ret1Py);
3153 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3155 DataArrayInt *famIds(0);
3156 bool isWithoutCopy(false);
3157 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3158 PyObject *ret=PyTuple_New(2);
3159 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3161 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3162 PyTuple_SetItem(ret,1,ret1Py);
3166 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3168 DataArrayInt *numIds(0);
3169 bool isWithoutCopy(false);
3170 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3171 PyObject *ret=PyTuple_New(2);
3172 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3174 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3175 PyTuple_SetItem(ret,1,ret1Py);
3179 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3181 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3182 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3183 PyObject *res(PyList_New(result.size()));
3184 for(int i=0;iL!=result.end(); i++, iL++)
3185 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3191 class MEDUMeshMultiLev : public MEDMeshMultiLev
3194 ~MEDUMeshMultiLev();
3198 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3200 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3201 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3202 PyObject *ret0Py=ncc?Py_True:Py_False;
3204 PyObject *ret=PyTuple_New(7);
3205 PyTuple_SetItem(ret,0,ret0Py);
3206 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3207 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3208 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3209 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3210 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3211 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3217 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3220 ~MEDStructuredMeshMultiLev();
3223 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3226 ~MEDCMeshMultiLev();
3230 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3233 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3234 std::size_t sz(objs.size());
3235 PyObject *ret(PyTuple_New(2));
3236 PyObject *ret0=PyList_New(sz);
3237 for(std::size_t i=0;i<sz;i++)
3238 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3239 PyTuple_SetItem(ret,0,ret0);
3240 PyObject *ret1Py(isInternal?Py_True:Py_False);
3242 PyTuple_SetItem(ret,1,ret1Py);
3248 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3251 ~MEDCurveLinearMeshMultiLev();
3255 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3257 DataArrayDouble *ret0(0);
3258 std::vector<int> ret1;
3260 self->buildVTUArrays(ret0,ret1,ret2);
3261 std::size_t sz(ret1.size());
3262 PyObject *ret=PyTuple_New(3);
3263 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3264 PyObject *ret1Py=PyList_New(sz);
3265 for(std::size_t i=0;i<sz;i++)
3266 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3267 PyTuple_SetItem(ret,1,ret1Py);
3268 PyObject *ret2Py(ret2?Py_True:Py_False);
3270 PyTuple_SetItem(ret,2,ret2Py);
3276 class MEDFileFastCellSupportComparator : public RefCountObject
3279 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3280 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3281 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3282 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3284 ~MEDFileFastCellSupportComparator();
3288 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3290 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3291 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3292 PyObject *res(PyList_New(result.size()));
3293 for(int i=0;iL!=result.end(); i++, iL++)
3294 PyList_SetItem(res,i,PyInt_FromLong(*iL));