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 bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
507 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
508 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
509 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
510 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
511 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
512 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
513 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
514 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
515 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
516 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
518 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
519 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
520 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
521 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
522 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
523 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
524 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
525 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
526 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
527 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
528 void clearGrpMap() throw(INTERP_KERNEL::Exception);
529 void clearFamMap() throw(INTERP_KERNEL::Exception);
530 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
531 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
532 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
533 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
534 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
535 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
536 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
537 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
538 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
539 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
540 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
541 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
542 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
543 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
544 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
545 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
546 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
547 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
548 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
549 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
550 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
551 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
552 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
553 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
554 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
555 void setFamilyInfo(const std::map<std::string,int>& info);
556 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
557 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
558 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
559 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
560 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
561 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
562 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
563 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
564 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
565 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
566 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
567 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
568 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
569 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
570 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
571 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
572 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
573 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
574 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
575 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
576 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
578 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
580 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
581 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
582 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
583 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
584 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
585 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
586 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
587 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
588 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
589 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
592 std::string __str__() const throw(INTERP_KERNEL::Exception)
594 return self->simpleRepr();
597 PyObject *getTime() throw(INTERP_KERNEL::Exception)
600 double tmp0=self->getTime(tmp1,tmp2);
601 PyObject *res = PyList_New(3);
602 PyList_SetItem(res,0,SWIG_From_int(tmp1));
603 PyList_SetItem(res,1,SWIG_From_int(tmp2));
604 PyList_SetItem(res,2,SWIG_From_double(tmp0));
608 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
611 bool ret0=self->isEqual(other,eps,what);
612 PyObject *res=PyList_New(2);
613 PyObject *ret0Py=ret0?Py_True:Py_False;
615 PyList_SetItem(res,0,ret0Py);
616 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
620 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
622 std::vector<const DataArrayInt *> grps;
623 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
624 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
627 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
630 bool ret0=self->areFamsEqual(other,what);
631 PyObject *res=PyList_New(2);
632 PyObject *ret0Py=ret0?Py_True:Py_False;
634 PyList_SetItem(res,0,ret0Py);
635 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
639 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
642 bool ret0=self->areGrpsEqual(other,what);
643 PyObject *res=PyList_New(2);
644 PyObject *ret0Py=ret0?Py_True:Py_False;
646 PyList_SetItem(res,0,ret0Py);
647 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
651 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
653 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
654 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
655 PyObject *res=PyList_New(result.size());
656 for(int i=0;iL!=result.end(); i++, iL++)
657 PyList_SetItem(res,i,PyInt_FromLong(*iL));
661 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
663 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
664 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
665 PyObject *res=PyList_New(result.size());
666 for(int i=0;iL!=result.end(); i++, iL++)
667 PyList_SetItem(res,i,PyInt_FromLong(*iL));
671 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
673 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
676 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
679 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
681 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
684 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
687 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
689 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
692 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
695 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
697 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
700 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
703 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
706 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
707 PyObject *ret=PyTuple_New(2);
708 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
709 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
713 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
715 DataArrayInt *ret3=0;
716 std::vector<int> ret1,ret2;
717 bool ret0=self->unPolyze(ret1,ret2,ret3);
718 PyObject *ret=PyTuple_New(4);
719 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
721 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
722 for(int j=0;j<(int)ret1.size()/3;j++)
724 PyObject *retLev2=PyList_New(3);
725 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
726 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
727 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
728 PyList_SetItem(retLev1_0,j,retLev2);
730 PyTuple_SetItem(ret,1,retLev1_0);
732 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
733 for(int j=0;j<(int)ret2.size()/3;j++)
735 PyObject *retLev2=PyList_New(3);
736 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
737 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
738 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
739 PyList_SetItem(retLev1_1,j,retLev2);
741 PyTuple_SetItem(ret,2,retLev1_1);
743 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
749 class MEDFileUMesh : public MEDFileMesh
752 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
753 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
754 static MEDFileUMesh *New();
756 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
757 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
759 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
760 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
761 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
762 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
763 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
764 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
765 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
766 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
767 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
768 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
769 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
770 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
771 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
772 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
773 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
774 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
775 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
776 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
777 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
778 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
780 int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
781 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
782 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
783 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
784 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
785 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
786 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
787 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
788 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
789 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
790 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
791 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
792 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
793 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
794 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
795 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
798 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
800 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
803 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
805 return MEDFileUMesh::New(fileName,mrs);
810 return MEDFileUMesh::New();
814 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
816 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
819 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)
821 std::vector<int> typesCpp1;
822 convertPyToNewIntArr3(types,typesCpp1);
823 std::size_t sz(typesCpp1.size());
824 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
825 for(std::size_t ii=0;ii<sz;ii++)
826 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
827 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
830 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
831 {// put an empty dict in input to say to __new__ to call __init__...
832 PyObject *ret(PyTuple_New(1));
833 PyObject *ret0(PyDict_New());
834 PyTuple_SetItem(ret,0,ret0);
838 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
840 std::vector<double> a0;
842 std::vector<std::string> a2;
843 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
844 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
845 self->serialize(a0,a1,a2,a3,a4);
846 PyObject *ret(PyTuple_New(5));
847 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
848 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
850 PyObject *ret2(PyList_New(sz));
851 for(int i=0;i<sz;i++)
852 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
853 PyTuple_SetItem(ret,2,ret2);
855 PyObject *ret3(PyList_New(sz));
856 for(int i=0;i<sz;i++)
858 DataArrayInt *elt(a3[i]);
861 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
863 PyTuple_SetItem(ret,3,ret3);
864 DataArrayDouble *ret4(a4);
867 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
871 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
873 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
874 if(!PyTuple_Check(inp))
875 throw INTERP_KERNEL::Exception(MSG);
876 int sz(PyTuple_Size(inp));
878 throw INTERP_KERNEL::Exception(MSG);
879 std::vector<double> a0;
881 std::vector<std::string> a2;
882 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
883 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
885 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
887 fillArrayWithPyListDbl3(a0py,tmp,a0);
888 convertPyToNewIntArr3(a1py,a1);
889 fillStringVector(a2py,a2);
891 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
893 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
894 if(!SWIG_IsOK(status))
895 throw INTERP_KERNEL::Exception(MSG);
896 a4=reinterpret_cast<DataArrayDouble *>(argp);
897 if((DataArrayDouble *)a4)
900 std::vector< DataArrayInt * > a3Tmp;
901 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
902 std::size_t sz(a3Tmp.size());
904 for(std::size_t i=0;i<sz;i++)
910 self->unserialize(a0,a1,a2,a3,a4);
914 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
916 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
919 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
922 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
923 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
926 self->setMeshAtLevel(meshDimRelToMax,m0,false);
929 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
932 self->setMeshAtLevel(meshDimRelToMax,m1);
935 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
938 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
940 self->removeMeshAtLevel(meshDimRelToMax);
943 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
945 std::vector<const MEDCouplingUMesh *> ms;
946 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
947 self->setMeshes(ms,renum);
950 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
952 std::vector<const MEDCouplingUMesh *> ms;
953 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
954 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
957 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
959 std::vector<const MEDCouplingUMesh *> ms;
960 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
961 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
964 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
966 DataArrayDouble *ret=self->getCoords();
972 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
974 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
977 return const_cast<PartDefinition *>(ret);
980 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
982 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
983 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
984 PyObject *ret=PyTuple_New(3);
985 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
986 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
987 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
991 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
993 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
999 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1001 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1002 std::size_t sz(tmp.size());
1003 PyObject *ret=PyList_New(sz);
1004 for(std::size_t i=0;i<sz;i++)
1008 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1015 class MEDFileStructuredMesh : public MEDFileMesh
1020 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1022 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1030 class MEDFileCMesh : public MEDFileStructuredMesh
1033 static MEDFileCMesh *New();
1034 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1035 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1036 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1037 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1042 return MEDFileCMesh::New();
1045 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1047 return MEDFileCMesh::New(fileName,mrs);
1050 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1052 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1055 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1057 const MEDCouplingCMesh *tmp=self->getMesh();
1060 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1065 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1068 static MEDFileCurveLinearMesh *New();
1069 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1070 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1071 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1074 MEDFileCurveLinearMesh()
1076 return MEDFileCurveLinearMesh::New();
1079 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1081 return MEDFileCurveLinearMesh::New(fileName,mrs);
1084 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1086 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1089 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1091 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1094 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1099 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1102 static MEDFileMeshMultiTS *New();
1103 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1104 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1105 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1106 std::string getName() const throw(INTERP_KERNEL::Exception);
1107 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1108 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1111 MEDFileMeshMultiTS()
1113 return MEDFileMeshMultiTS::New();
1116 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1118 return MEDFileMeshMultiTS::New(fileName);
1121 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1123 return MEDFileMeshMultiTS::New(fileName,mName);
1126 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1128 MEDFileMesh *ret=self->getOneTimeStep();
1136 class MEDFileMeshesIterator
1141 PyObject *next() throw(INTERP_KERNEL::Exception)
1143 MEDFileMesh *ret=self->nextt();
1147 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1151 PyErr_SetString(PyExc_StopIteration,"No more data.");
1158 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1161 static MEDFileMeshes *New();
1162 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1163 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1164 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1165 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1166 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1168 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1169 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1170 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1171 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1176 return MEDFileMeshes::New();
1179 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1181 return MEDFileMeshes::New(fileName);
1184 std::string __str__() const throw(INTERP_KERNEL::Exception)
1186 return self->simpleRepr();
1189 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1191 if(PyInt_Check(obj))
1193 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1198 else if(PyString_Check(obj))
1200 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1206 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1209 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1211 self->setMeshAtPos(obj,mesh);
1215 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1217 return self->iterator();
1220 int __len__() const throw(INTERP_KERNEL::Exception)
1222 return self->getNumberOfMeshes();
1225 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1227 MEDFileMesh *ret=self->getMeshAtPos(i);
1232 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1234 MEDFileMesh *ret=self->getMeshWithName(mname);
1242 class MEDFileFieldLoc : public RefCountObject
1245 std::string getName() const;
1246 int getDimension() const;
1247 int getNumberOfGaussPoints() const;
1248 int getNumberOfPointsInCells() const;
1249 const std::vector<double>& getRefCoords() const;
1250 const std::vector<double>& getGaussCoords() const;
1251 const std::vector<double>& getGaussWeights() const;
1252 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1255 std::string __str__() const throw(INTERP_KERNEL::Exception)
1257 return self->repr();
1262 class MEDFileFieldGlobsReal
1265 void resetContent();
1266 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1267 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1268 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1269 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1270 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1271 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1272 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1273 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1274 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1275 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1276 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1277 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1278 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1279 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1280 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1281 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1282 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1283 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1284 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1285 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1286 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1287 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1288 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1289 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1290 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1291 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1294 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1296 const DataArrayInt *ret=self->getProfile(pflName);
1299 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1302 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1304 const DataArrayInt *ret=self->getProfileFromId(pflId);
1307 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1310 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1312 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1315 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1318 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1320 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1323 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1326 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1328 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1329 return convertVecPairVecStToPy(ret);
1332 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1334 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1335 return convertVecPairVecStToPy(ret);
1338 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1340 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1341 self->changePflsNames(v);
1344 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1346 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1347 self->changePflsRefsNamesGen(v);
1350 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1352 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1353 self->changePflsNamesInStruct(v);
1356 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1358 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1359 self->changeLocsNames(v);
1362 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1364 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1365 self->changeLocsRefsNamesGen(v);
1368 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1370 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1371 self->changeLocsNamesInStruct(v);
1374 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1376 std::ostringstream oss;
1377 self->simpleReprGlobs(oss);
1383 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1386 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1387 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1388 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1389 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1390 void loadArrays() throw(INTERP_KERNEL::Exception);
1391 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1392 void unloadArrays() throw(INTERP_KERNEL::Exception);
1393 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1394 int getDimension() const throw(INTERP_KERNEL::Exception);
1395 int getIteration() const throw(INTERP_KERNEL::Exception);
1396 int getOrder() const throw(INTERP_KERNEL::Exception);
1397 std::string getName() throw(INTERP_KERNEL::Exception);
1398 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1399 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1400 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1401 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1402 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1403 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1404 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1405 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1406 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1407 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1408 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1409 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1410 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1411 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1412 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1415 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1418 double tmp0=self->getTime(tmp1,tmp2);
1419 PyObject *res = PyList_New(3);
1420 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1421 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1422 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1426 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1428 std::pair<int,int> res=self->getDtIt();
1429 PyObject *elt=PyTuple_New(2);
1430 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1431 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1435 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1437 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1440 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1442 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1445 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1447 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1448 return self->changeMeshNames(modifTab);
1451 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1453 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1454 PyObject *ret2=PyList_New(ret.size());
1455 for(int i=0;i<(int)ret.size();i++)
1456 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1460 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1462 std::vector<int> ret1;
1463 int ret0=self->getNonEmptyLevels(mname,ret1);
1464 PyObject *elt=PyTuple_New(2);
1465 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1466 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1470 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1472 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1473 std::vector< std::vector<TypeOfField> > typesF;
1474 std::vector< std::vector<std::string> > pfls;
1475 std::vector< std::vector<std::string> > locs;
1476 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1478 PyObject *ret2=PyList_New(sz);
1479 for(int i=0;i<sz;i++)
1481 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1482 const std::vector<TypeOfField>& typesFI=typesF[i];
1483 const std::vector<std::string>& pflsI=pfls[i];
1484 const std::vector<std::string>& locsI=locs[i];
1485 PyObject *elt=PyTuple_New(2);
1486 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1487 int sz2=ret[i].size();
1488 PyObject *elt2=PyList_New(sz2);
1489 for(int j=0;j<sz2;j++)
1491 PyObject *elt3=PyTuple_New(4);
1492 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1493 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));
1494 PyTuple_SetItem(elt3,1,elt4);
1495 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1496 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1497 PyList_SetItem(elt2,j,elt3);
1499 PyTuple_SetItem(elt,1,elt2);
1500 PyList_SetItem(ret2,i,elt);
1505 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1507 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1508 std::size_t sz=ret.size();
1509 PyObject *retPy=PyList_New(sz);
1510 for(std::size_t i=0;i<sz;i++)
1511 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1515 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1517 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1518 std::size_t sz=ret.size();
1519 PyObject *retPy=PyList_New(sz);
1520 for(std::size_t i=0;i<sz;i++)
1521 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1525 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1527 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1528 std::size_t sz=ret.size();
1529 PyObject *retPy=PyList_New(sz);
1530 for(std::size_t i=0;i<sz;i++)
1531 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1537 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1540 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1541 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1542 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1543 static MEDFileField1TS *New();
1544 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1545 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1546 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1547 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1548 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1549 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1551 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1552 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1553 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1554 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1557 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1559 return MEDFileField1TS::New(fileName,loadAll);
1562 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1564 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1567 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1569 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1574 return MEDFileField1TS::New();
1577 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1579 const DataArrayDouble *arr=0;
1581 arr=field->getArray();
1582 self->copyTinyInfoFrom(field,arr);
1585 std::string __str__() const throw(INTERP_KERNEL::Exception)
1587 return self->simpleRepr();
1590 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1592 DataArrayInt *ret1=0;
1593 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1594 PyObject *ret=PyTuple_New(2);
1595 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1596 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1600 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1602 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1603 std::vector< std::vector<TypeOfField> > typesF;
1604 std::vector< std::vector<std::string> > pfls;
1605 std::vector< std::vector<std::string> > locs;
1606 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1608 PyObject *ret2=PyList_New(sz);
1609 for(int i=0;i<sz;i++)
1611 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1612 const std::vector<TypeOfField>& typesFI=typesF[i];
1613 const std::vector<std::string>& pflsI=pfls[i];
1614 const std::vector<std::string>& locsI=locs[i];
1615 PyObject *elt=PyTuple_New(2);
1616 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1617 int sz2=ret[i].size();
1618 PyObject *elt2=PyList_New(sz2);
1619 for(int j=0;j<sz2;j++)
1621 PyObject *elt3=PyTuple_New(4);
1622 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1623 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1624 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1625 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1626 PyList_SetItem(elt2,j,elt3);
1628 PyTuple_SetItem(elt,1,elt2);
1629 PyList_SetItem(ret2,i,elt);
1634 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1636 DataArrayDouble *ret=self->getUndergroundDataArray();
1642 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1644 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1645 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1648 PyObject *ret=PyTuple_New(2);
1649 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1650 std::size_t sz=elt1Cpp.size();
1651 PyObject *elt=PyList_New(sz);
1652 for(std::size_t i=0;i<sz;i++)
1654 PyObject *elt1=PyTuple_New(2);
1655 PyObject *elt2=PyTuple_New(2);
1656 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1657 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1658 PyObject *elt3=PyTuple_New(2);
1659 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1660 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1661 PyTuple_SetItem(elt1,0,elt2);
1662 PyTuple_SetItem(elt1,1,elt3);
1663 PyList_SetItem(elt,i,elt1);
1665 PyTuple_SetItem(ret,1,elt);
1671 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1674 static MEDFileIntField1TS *New();
1675 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1676 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1677 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1678 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1680 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1681 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1684 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1686 return MEDFileIntField1TS::New();
1689 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1691 return MEDFileIntField1TS::New(fileName,loadAll);
1694 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1696 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1699 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1701 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1704 std::string __str__() const throw(INTERP_KERNEL::Exception)
1706 return self->simpleRepr();
1709 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1711 DataArrayInt *ret1=0;
1712 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1713 PyObject *ret=PyTuple_New(2);
1714 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1715 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1719 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1721 DataArrayInt *ret1=0;
1722 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1723 PyObject *ret=PyTuple_New(2);
1724 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1725 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1729 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1731 DataArrayInt *ret1=0;
1732 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1733 PyObject *ret=PyTuple_New(2);
1734 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1735 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1739 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1741 DataArrayInt *ret1=0;
1742 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1743 PyObject *ret=PyTuple_New(2);
1744 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1745 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1749 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1751 DataArrayInt *ret1=0;
1752 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1753 PyObject *ret=PyTuple_New(2);
1754 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1755 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1759 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1761 DataArrayInt *ret1=0;
1762 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1763 PyObject *ret=PyTuple_New(2);
1764 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1765 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1769 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1771 DataArrayInt *ret=self->getUndergroundDataArray();
1779 class MEDFileAnyTypeFieldMultiTSIterator
1784 PyObject *next() throw(INTERP_KERNEL::Exception)
1786 MEDFileAnyTypeField1TS *ret=self->nextt();
1788 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1791 PyErr_SetString(PyExc_StopIteration,"No more data.");
1798 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1801 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1802 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1803 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1804 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1805 std::string getName() const throw(INTERP_KERNEL::Exception);
1806 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1807 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1808 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1809 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1810 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1811 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1812 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1813 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1814 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1815 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1816 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1817 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1818 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1819 void loadArrays() throw(INTERP_KERNEL::Exception);
1820 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1821 void unloadArrays() throw(INTERP_KERNEL::Exception);
1822 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1824 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1825 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1826 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1827 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1828 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1831 int __len__() const throw(INTERP_KERNEL::Exception)
1833 return self->getNumberOfTS();
1836 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1838 if(elt0 && PyInt_Check(elt0))
1840 int pos=PyInt_AS_LONG(elt0);
1843 else if(elt0 && PyTuple_Check(elt0))
1845 if(PyTuple_Size(elt0)==2)
1847 PyObject *o0=PyTuple_GetItem(elt0,0);
1848 PyObject *o1=PyTuple_GetItem(elt0,1);
1849 if(PyInt_Check(o0) && PyInt_Check(o1))
1851 int iter=PyInt_AS_LONG(o0);
1852 int order=PyInt_AS_LONG(o1);
1853 return self->getPosOfTimeStep(iter,order);
1856 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 !");
1859 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 !");
1861 else if(elt0 && PyFloat_Check(elt0))
1863 double val=PyFloat_AS_DOUBLE(elt0);
1864 return self->getPosGivenTime(val);
1867 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1870 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1872 std::vector< std::pair<int,int> > res=self->getIterations();
1873 PyObject *ret=PyList_New(res.size());
1875 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1877 PyObject *elt=PyTuple_New(2);
1878 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1879 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1880 PyList_SetItem(ret,rk,elt);
1885 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1887 std::vector<double> ret1;
1888 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1889 std::size_t sz=ret.size();
1890 PyObject *ret2=PyList_New(sz);
1891 for(std::size_t i=0;i<sz;i++)
1893 PyObject *elt=PyTuple_New(3);
1894 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1895 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1896 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1897 PyList_SetItem(ret2,i,elt);
1902 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1904 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1905 PyObject *ret2=PyList_New(ret.size());
1906 for(int i=0;i<(int)ret.size();i++)
1908 const std::vector<TypeOfField>& rett=ret[i];
1909 PyObject *ret3=PyList_New(rett.size());
1910 for(int j=0;j<(int)rett.size();j++)
1911 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1912 PyList_SetItem(ret2,i,ret3);
1917 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1919 std::vector<int> ret1;
1920 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1921 PyObject *elt=PyTuple_New(2);
1922 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1923 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1927 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1929 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1930 std::vector< std::vector<TypeOfField> > typesF;
1931 std::vector< std::vector<std::string> > pfls;
1932 std::vector< std::vector<std::string> > locs;
1933 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1935 PyObject *ret2=PyList_New(sz);
1936 for(int i=0;i<sz;i++)
1938 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1939 const std::vector<TypeOfField>& typesFI=typesF[i];
1940 const std::vector<std::string>& pflsI=pfls[i];
1941 const std::vector<std::string>& locsI=locs[i];
1942 PyObject *elt=PyTuple_New(2);
1943 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1944 int sz2=ret[i].size();
1945 PyObject *elt2=PyList_New(sz2);
1946 for(int j=0;j<sz2;j++)
1948 PyObject *elt3=PyTuple_New(4);
1949 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1950 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));
1951 PyTuple_SetItem(elt3,1,elt4);
1952 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1953 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1954 PyList_SetItem(elt2,j,elt3);
1956 PyTuple_SetItem(elt,1,elt2);
1957 PyList_SetItem(ret2,i,elt);
1962 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1964 if(PyList_Check(elts))
1966 int sz=PyList_Size(elts);
1967 std::vector<int> ret(sz);
1968 for(int i=0;i<sz;i++)
1970 PyObject *elt=PyList_GetItem(elts,i);
1971 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1977 std::vector<int> ret(1);
1978 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1983 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1985 if(PySlice_Check(elts))
1987 Py_ssize_t strt=2,stp=2,step=2;
1988 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1989 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1990 self->eraseTimeStepIds2(strt,stp,step);
1994 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1995 if(!idsToRemove.empty())
1996 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2000 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2004 std::vector<int> pos2;
2005 DataArrayInt *pos3=0;
2006 DataArrayIntTuple *pos4=0;
2007 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2012 self->eraseTimeStepIds(&pos1,&pos1+1);
2019 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2024 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2028 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2032 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2034 return self->iterator();
2037 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2039 if(elt0 && PyList_Check(elt0))
2041 int sz=PyList_Size(elt0);
2042 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2043 int *pt=da->getPointer();
2044 for(int i=0;i<sz;i++,pt++)
2046 PyObject *elt1=PyList_GetItem(elt0,i);
2047 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2049 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2051 else if(elt0 && PySlice_Check(elt0))
2053 Py_ssize_t strt=2,stp=2,step=2;
2054 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2055 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2056 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2059 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2062 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2064 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2065 return self->changeMeshNames(modifTab);
2068 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2070 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2071 std::size_t sz=ret.size();
2072 PyObject *retPy=PyList_New(sz);
2073 for(std::size_t i=0;i<sz;i++)
2074 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2078 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2080 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2081 std::size_t sz=ret.size();
2082 PyObject *retPy=PyList_New(sz);
2083 for(std::size_t i=0;i<sz;i++)
2084 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2088 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2090 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2091 std::size_t sz=ret.size();
2092 PyObject *retPy=PyList_New(sz);
2093 for(std::size_t i=0;i<sz;i++)
2094 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2098 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2101 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2102 if(SWIG_IsOK(status))
2104 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2108 std::vector<MEDFileAnyTypeField1TS *> tmp;
2109 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2110 self->pushBackTimeSteps(tmp);
2114 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2116 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2117 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2118 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2119 std::size_t sz=ret.size();
2120 PyObject *retPy=PyList_New(sz);
2121 for(std::size_t i=0;i<sz;i++)
2123 std::size_t sz2=ret[i].size();
2124 PyObject *ret1Py=PyList_New(sz2);
2125 for(std::size_t j=0;j<sz2;j++)
2127 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2130 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2132 PyList_SetItem(retPy,i,ret1Py);
2137 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2139 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2140 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2141 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2142 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2143 if(ret2.size()!=ret.size())
2145 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2146 throw INTERP_KERNEL::Exception(oss.str().c_str());
2148 std::size_t sz=ret.size();
2149 PyObject *retPy=PyList_New(sz);
2150 for(std::size_t i=0;i<sz;i++)
2152 std::size_t sz2=ret[i].size();
2153 PyObject *ret0Py=PyTuple_New(2);
2154 PyObject *ret1Py=PyList_New(sz2);
2155 for(std::size_t j=0;j<sz2;j++)
2157 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2160 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2162 PyTuple_SetItem(ret0Py,0,ret1Py);
2163 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2164 PyList_SetItem(retPy,i,ret0Py);
2171 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2174 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2175 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2176 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2178 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2179 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2180 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2181 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2182 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2184 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2185 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2186 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2189 MEDFileFieldMultiTS()
2191 return MEDFileFieldMultiTS::New();
2194 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2196 return MEDFileFieldMultiTS::New(fileName,loadAll);
2199 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2201 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2204 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2206 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2207 std::size_t sz(tmp.size());
2208 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2209 for(std::size_t i=0;i<sz;i++)
2211 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2212 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2214 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2217 std::string __str__() const throw(INTERP_KERNEL::Exception)
2219 return self->simpleRepr();
2222 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2224 DataArrayInt *ret1=0;
2225 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2226 PyObject *ret=PyTuple_New(2);
2227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2234 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2235 std::vector< std::vector<TypeOfField> > typesF;
2236 std::vector< std::vector<std::string> > pfls;
2237 std::vector< std::vector<std::string> > locs;
2238 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2240 PyObject *ret2=PyList_New(sz);
2241 for(int i=0;i<sz;i++)
2243 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2244 const std::vector<TypeOfField>& typesFI=typesF[i];
2245 const std::vector<std::string>& pflsI=pfls[i];
2246 const std::vector<std::string>& locsI=locs[i];
2247 PyObject *elt=PyTuple_New(2);
2248 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2249 int sz2=ret[i].size();
2250 PyObject *elt2=PyList_New(sz2);
2251 for(int j=0;j<sz2;j++)
2253 PyObject *elt3=PyTuple_New(4);
2254 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2255 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2256 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2257 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2258 PyList_SetItem(elt2,j,elt3);
2260 PyTuple_SetItem(elt,1,elt2);
2261 PyList_SetItem(ret2,i,elt);
2265 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2267 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2273 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2275 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2276 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2279 PyObject *ret=PyTuple_New(2);
2280 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2281 std::size_t sz=elt1Cpp.size();
2282 PyObject *elt=PyList_New(sz);
2283 for(std::size_t i=0;i<sz;i++)
2285 PyObject *elt1=PyTuple_New(2);
2286 PyObject *elt2=PyTuple_New(2);
2287 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2288 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2289 PyObject *elt3=PyTuple_New(2);
2290 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2291 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2292 PyTuple_SetItem(elt1,0,elt2);
2293 PyTuple_SetItem(elt1,1,elt3);
2294 PyList_SetItem(elt,i,elt1);
2296 PyTuple_SetItem(ret,1,elt);
2302 class MEDFileFieldsIterator
2307 PyObject *next() throw(INTERP_KERNEL::Exception)
2309 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2311 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2314 PyErr_SetString(PyExc_StopIteration,"No more data.");
2321 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2324 static MEDFileIntFieldMultiTS *New();
2325 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2326 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2328 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2329 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2330 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2333 MEDFileIntFieldMultiTS()
2335 return MEDFileIntFieldMultiTS::New();
2338 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2340 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2343 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2345 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2348 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2350 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2351 std::size_t sz(tmp.size());
2352 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2353 for(std::size_t i=0;i<sz;i++)
2355 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2356 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2358 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2361 std::string __str__() const throw(INTERP_KERNEL::Exception)
2363 return self->simpleRepr();
2366 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2368 DataArrayInt *ret1=0;
2369 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2370 PyObject *ret=PyTuple_New(2);
2371 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2372 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2376 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2378 DataArrayInt *ret1=0;
2379 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2380 PyObject *ret=PyTuple_New(2);
2381 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2382 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2386 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2388 DataArrayInt *ret1=0;
2389 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2390 PyObject *ret=PyTuple_New(2);
2391 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2392 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2396 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2398 DataArrayInt *ret1=0;
2399 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2400 PyObject *ret=PyTuple_New(2);
2401 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2402 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2406 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2408 DataArrayInt *ret1=0;
2409 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2410 PyObject *ret=PyTuple_New(2);
2411 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2412 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2416 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2418 DataArrayInt *ret1=0;
2419 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2420 PyObject *ret=PyTuple_New(2);
2421 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2422 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2426 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2428 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2436 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2439 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2440 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2441 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2442 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2443 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2444 void loadArrays() throw(INTERP_KERNEL::Exception);
2445 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2446 void unloadArrays() throw(INTERP_KERNEL::Exception);
2447 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2448 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2449 int getNumberOfFields() const;
2450 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2451 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2453 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2454 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2455 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2456 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2457 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2458 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2459 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2460 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2461 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2466 return MEDFileFields::New();
2469 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2471 return MEDFileFields::New(fileName,loadAll);
2474 std::string __str__() const throw(INTERP_KERNEL::Exception)
2476 return self->simpleRepr();
2479 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2481 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2482 std::size_t sz(tmp.size());
2483 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2484 for(std::size_t i=0;i<sz;i++)
2486 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2487 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2489 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2492 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2495 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2496 PyObject *ret=PyTuple_New(2);
2497 PyObject *ret_0=PyList_New(ret0.size());
2499 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2501 PyObject *elt=PyTuple_New(2);
2502 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2503 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2504 PyList_SetItem(ret_0,rk,elt);
2506 PyTuple_SetItem(ret,0,ret_0);
2507 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2508 PyTuple_SetItem(ret,1,ret_1);
2512 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2514 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2515 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2518 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2520 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2521 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2524 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2526 if(obj && PyList_Check(obj))
2528 int sz=PyList_Size(obj);
2529 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2530 int *pt=da->getPointer();
2531 for(int i=0;i<sz;i++,pt++)
2533 PyObject *elt1=PyList_GetItem(obj,i);
2534 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2536 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2539 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2542 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2544 self->setFieldAtPos(obj,field);
2548 int __len__() const throw(INTERP_KERNEL::Exception)
2550 return self->getNumberOfFields();
2553 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2555 return self->iterator();
2558 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2560 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2561 return self->changeMeshNames(modifTab);
2564 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2566 if(elt0 && PyInt_Check(elt0))
2568 return PyInt_AS_LONG(elt0);
2570 else if(elt0 && PyString_Check(elt0))
2571 return self->getPosFromFieldName(PyString_AsString(elt0));
2573 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2576 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2578 if(PyList_Check(elts))
2580 int sz=PyList_Size(elts);
2581 std::vector<int> ret(sz);
2582 for(int i=0;i<sz;i++)
2584 PyObject *elt=PyList_GetItem(elts,i);
2585 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2591 std::vector<int> ret(1);
2592 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2597 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2599 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2600 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2601 self->pushFields(tmp);
2604 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2606 if(elts && PySlice_Check(elts))
2608 Py_ssize_t strt=2,stp=2,step=2;
2609 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2610 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2611 self->destroyFieldsAtPos2(strt,stp,step);
2615 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2616 if(!idsToRemove.empty())
2617 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2623 class MEDFileParameter1TS : public RefCountObject
2626 void setIteration(int it);
2627 int getIteration() const;
2628 void setOrder(int order);
2629 int getOrder() const;
2630 void setTimeValue(double time);
2631 void setTime(int dt, int it, double time);
2632 double getTime(int& dt, int& it);
2633 double getTimeValue() const;
2636 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2639 void setValue(double val) throw(INTERP_KERNEL::Exception);
2640 double getValue() const throw(INTERP_KERNEL::Exception);
2641 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2644 std::string __str__() const throw(INTERP_KERNEL::Exception)
2646 return self->simpleRepr();
2651 class MEDFileParameterTinyInfo : public MEDFileWritable
2654 void setDescription(const std::string& name);
2655 std::string getDescription() const;
2656 void setTimeUnit(const std::string& unit);
2657 std::string getTimeUnit() const;
2660 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2663 static MEDFileParameterDouble1TS *New();
2664 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2665 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2666 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2667 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2668 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2669 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2670 std::string getName() const throw(INTERP_KERNEL::Exception);
2671 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2674 MEDFileParameterDouble1TS()
2676 return MEDFileParameterDouble1TS::New();
2679 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2681 return MEDFileParameterDouble1TS::New(fileName);
2684 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2686 return MEDFileParameterDouble1TS::New(fileName,paramName);
2689 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2691 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2694 std::string __str__() const throw(INTERP_KERNEL::Exception)
2696 return self->simpleRepr();
2699 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2702 bool ret0=self->isEqual(other,eps,what);
2703 PyObject *res=PyList_New(2);
2704 PyObject *ret0Py=ret0?Py_True:Py_False;
2706 PyList_SetItem(res,0,ret0Py);
2707 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2713 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2716 static MEDFileParameterMultiTS *New();
2717 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2718 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2719 std::string getName() const;
2720 void setName(const std::string& name);
2721 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2722 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2723 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2724 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2725 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2726 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2727 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2728 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2731 MEDFileParameterMultiTS()
2733 return MEDFileParameterMultiTS::New();
2736 MEDFileParameterMultiTS(const std::string& fileName)
2738 return MEDFileParameterMultiTS::New(fileName);
2741 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2743 return MEDFileParameterMultiTS::New(fileName,paramName);
2746 std::string __str__() const throw(INTERP_KERNEL::Exception)
2748 return self->simpleRepr();
2751 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2754 bool ret0=self->isEqual(other,eps,what);
2755 PyObject *res=PyList_New(2);
2756 PyObject *ret0Py=ret0?Py_True:Py_False;
2758 PyList_SetItem(res,0,ret0Py);
2759 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2763 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2767 std::vector<int> pos2;
2768 DataArrayInt *pos3=0;
2769 DataArrayIntTuple *pos4=0;
2770 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2775 self->eraseTimeStepIds(&pos1,&pos1+1);
2782 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2787 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2791 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2795 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2797 if(elt0 && PyInt_Check(elt0))
2799 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2802 else if(elt0 && PyTuple_Check(elt0))
2804 if(PyTuple_Size(elt0)==2)
2806 PyObject *o0=PyTuple_GetItem(elt0,0);
2807 PyObject *o1=PyTuple_GetItem(elt0,1);
2808 if(PyInt_Check(o0) && PyInt_Check(o1))
2810 int iter=PyInt_AS_LONG(o0);
2811 int order=PyInt_AS_LONG(o1);
2812 return self->getPosOfTimeStep(iter,order);
2815 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 !");
2818 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 !");
2820 else if(elt0 && PyFloat_Check(elt0))
2822 double val=PyFloat_AS_DOUBLE(elt0);
2823 return self->getPosGivenTime(val);
2826 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2829 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2831 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2837 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2839 if(PyList_Check(elts))
2841 int sz=PyList_Size(elts);
2842 std::vector<int> ret(sz);
2843 for(int i=0;i<sz;i++)
2845 PyObject *elt=PyList_GetItem(elts,i);
2846 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2852 std::vector<int> ret(1);
2853 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2858 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2860 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2861 if(!idsToRemove.empty())
2862 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2865 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2867 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2873 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2875 std::vector< std::pair<int,int> > res=self->getIterations();
2876 PyObject *ret=PyList_New(res.size());
2878 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2880 PyObject *elt=PyTuple_New(2);
2881 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2882 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2883 PyList_SetItem(ret,rk,elt);
2888 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2890 std::vector<double> res2;
2891 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2892 PyObject *ret=PyList_New(res.size());
2894 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2896 PyObject *elt=PyTuple_New(3);
2897 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2898 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2899 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2900 PyList_SetItem(ret,rk,elt);
2907 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2910 static MEDFileParameters *New();
2911 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2912 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2913 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2914 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2915 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2916 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2917 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2918 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2919 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2920 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2921 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2926 return MEDFileParameters::New();
2929 MEDFileParameters(const std::string& fileName)
2931 return MEDFileParameters::New(fileName);
2934 std::string __str__() const throw(INTERP_KERNEL::Exception)
2936 return self->simpleRepr();
2939 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2941 if(PyInt_Check(obj))
2943 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2948 else if(PyString_Check(obj))
2950 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2956 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2959 int __len__() const throw(INTERP_KERNEL::Exception)
2961 return self->getNumberOfParams();
2964 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2966 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2972 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2974 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2980 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2983 bool ret0=self->isEqual(other,eps,what);
2984 PyObject *res=PyList_New(2);
2985 PyObject *ret0Py=ret0?Py_True:Py_False;
2987 PyList_SetItem(res,0,ret0Py);
2988 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2994 class MEDFileData : public RefCountObject, public MEDFileWritable
2997 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2998 static MEDFileData *New();
2999 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3000 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3001 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3002 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3003 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3004 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3005 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3007 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3008 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3010 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3013 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3015 return MEDFileData::New(fileName);
3020 return MEDFileData::New();
3023 std::string __str__() const throw(INTERP_KERNEL::Exception)
3025 return self->simpleRepr();
3028 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3030 MEDFileMeshes *ret=self->getMeshes();
3036 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3038 MEDFileParameters *ret=self->getParams();
3044 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3046 MEDFileFields *ret=self->getFields();
3052 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3054 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3055 return self->changeMeshNames(modifTab);
3060 class SauvReader : public RefCountObject
3063 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3064 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3067 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3069 return SauvReader::New(fileName);
3074 class SauvWriter : public RefCountObject
3077 static SauvWriter * New();
3078 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3079 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3080 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3081 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3084 SauvWriter() throw(INTERP_KERNEL::Exception)
3086 return SauvWriter::New();
3093 class MEDFileMeshStruct;
3095 class MEDFileField1TSStructItem
3098 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3101 class MEDFileMeshStruct : public RefCountObject
3104 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3106 ~MEDFileMeshStruct();
3109 class MEDMeshMultiLev : public RefCountObject
3112 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3113 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3119 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3121 DataArrayInt *famIds(0);
3122 bool isWithoutCopy(false);
3123 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3124 PyObject *ret=PyTuple_New(2);
3125 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3127 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3128 PyTuple_SetItem(ret,1,ret1Py);
3132 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3134 DataArrayInt *numIds(0);
3135 bool isWithoutCopy(false);
3136 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3137 PyObject *ret=PyTuple_New(2);
3138 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3140 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3141 PyTuple_SetItem(ret,1,ret1Py);
3145 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3147 DataArrayInt *famIds(0);
3148 bool isWithoutCopy(false);
3149 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3150 PyObject *ret=PyTuple_New(2);
3151 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3153 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3154 PyTuple_SetItem(ret,1,ret1Py);
3158 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3160 DataArrayInt *numIds(0);
3161 bool isWithoutCopy(false);
3162 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3163 PyObject *ret=PyTuple_New(2);
3164 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3166 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3167 PyTuple_SetItem(ret,1,ret1Py);
3171 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3173 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3174 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3175 PyObject *res(PyList_New(result.size()));
3176 for(int i=0;iL!=result.end(); i++, iL++)
3177 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3183 class MEDUMeshMultiLev : public MEDMeshMultiLev
3186 ~MEDUMeshMultiLev();
3190 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3192 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3193 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3194 PyObject *ret0Py=ncc?Py_True:Py_False;
3196 PyObject *ret=PyTuple_New(7);
3197 PyTuple_SetItem(ret,0,ret0Py);
3198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3199 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3200 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3201 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3202 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3203 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3209 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3212 ~MEDStructuredMeshMultiLev();
3215 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3218 ~MEDCMeshMultiLev();
3222 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3225 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3226 std::size_t sz(objs.size());
3227 PyObject *ret(PyTuple_New(2));
3228 PyObject *ret0=PyList_New(sz);
3229 for(std::size_t i=0;i<sz;i++)
3230 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3231 PyTuple_SetItem(ret,0,ret0);
3232 PyObject *ret1Py(isInternal?Py_True:Py_False);
3234 PyTuple_SetItem(ret,1,ret1Py);
3240 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3243 ~MEDCurveLinearMeshMultiLev();
3247 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3249 DataArrayDouble *ret0(0);
3250 std::vector<int> ret1;
3252 self->buildVTUArrays(ret0,ret1,ret2);
3253 std::size_t sz(ret1.size());
3254 PyObject *ret=PyTuple_New(3);
3255 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3256 PyObject *ret1Py=PyList_New(sz);
3257 for(std::size_t i=0;i<sz;i++)
3258 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3259 PyTuple_SetItem(ret,1,ret1Py);
3260 PyObject *ret2Py(ret2?Py_True:Py_False);
3262 PyTuple_SetItem(ret,2,ret2Py);
3268 class MEDFileFastCellSupportComparator : public RefCountObject
3271 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3272 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3273 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3274 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3276 ~MEDFileFastCellSupportComparator();
3280 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3282 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3283 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3284 PyObject *res(PyList_New(result.size()));
3285 for(int i=0;iL!=result.end(); i++, iL++)
3286 PyList_SetItem(res,i,PyInt_FromLong(*iL));