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 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileMeshReadSelector.hxx"
40 #include "MEDFileFieldOverView.hxx"
41 #include "MEDLoaderTypemaps.i"
42 #include "SauvReader.hxx"
43 #include "SauvWriter.hxx"
45 using namespace ParaMEDMEM;
48 #if SWIG_VERSION >= 0x010329
49 %template() std::vector<std::string>;
52 %typemap(out) ParaMEDMEM::MEDFileMesh*
54 $result=convertMEDFileMesh($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
59 $result=convertMEDFileParameter1TS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
64 $result=convertMEDFileFieldMultiTS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
69 $result=convertMEDFileField1TS($1,$owner);
72 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
74 $result=convertMEDMeshMultiLev($1,$owner);
77 %newobject MEDLoader::ReadUMeshFromFamilies;
78 %newobject MEDLoader::ReadUMeshFromGroups;
79 %newobject MEDLoader::ReadUMeshFromFile;
80 %newobject MEDLoader::ReadMeshFromFile;
81 %newobject MEDLoader::ReadField;
82 %newobject MEDLoader::ReadFieldCell;
83 %newobject MEDLoader::ReadFieldNode;
84 %newobject MEDLoader::ReadFieldGauss;
85 %newobject MEDLoader::ReadFieldGaussNE;
86 %newobject ParaMEDMEM::MEDFileMesh::New;
87 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
88 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
89 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
90 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
91 %newobject ParaMEDMEM::MEDFileMesh::__getitem__;
92 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
95 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
96 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
97 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
98 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
99 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
100 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
101 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
102 %newobject ParaMEDMEM::MEDFileData::getJoints;
103 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
104 %newobject ParaMEDMEM::MEDFileUMesh::New;
105 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
106 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
107 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
108 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
109 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
110 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
111 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
112 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
113 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
114 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
115 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
116 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
117 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
118 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
119 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
120 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
121 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
122 %newobject ParaMEDMEM::MEDFileUMesh::linearToQuadratic;
123 %newobject ParaMEDMEM::MEDFileUMesh::quadraticToLinear;
124 %newobject ParaMEDMEM::MEDFileCMesh::New;
125 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
126 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
127 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
128 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
129 %newobject ParaMEDMEM::MEDFileMeshes::New;
130 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
131 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
132 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
133 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
134 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
136 %newobject ParaMEDMEM::MEDFileFields::New;
137 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
138 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
139 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
140 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
141 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
142 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
143 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
144 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
145 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
146 %newobject ParaMEDMEM::MEDFileFields::__iter__;
148 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
149 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
150 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
151 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
152 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
153 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
154 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
155 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
156 %newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
157 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
158 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
159 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
160 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
161 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
162 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
163 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
164 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
165 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
166 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
168 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
169 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
170 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
171 %newobject ParaMEDMEM::MEDFileField1TS::New;
172 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
173 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
174 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
175 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
176 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
177 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
178 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
179 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
180 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
182 %newobject ParaMEDMEM::MEDFileData::New;
183 %newobject ParaMEDMEM::MEDFileData::deepCpy;
184 %newobject ParaMEDMEM::MEDFileData::getMeshes;
185 %newobject ParaMEDMEM::MEDFileData::getFields;
186 %newobject ParaMEDMEM::MEDFileData::getParams;
188 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
189 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
190 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
191 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
192 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
193 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
194 %newobject ParaMEDMEM::MEDFileParameters::New;
195 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
196 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
197 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
198 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
200 %newobject ParaMEDMEM::MEDFileJointCorrespondence::New;
201 %newobject ParaMEDMEM::MEDFileJointCorrespondence::deepCpy;
202 %newobject ParaMEDMEM::MEDFileJointCorrespondence::shallowCpy;
203 %newobject ParaMEDMEM::MEDFileJointOneStep::New;
204 %newobject ParaMEDMEM::MEDFileJointOneStep::deepCpy;
205 %newobject ParaMEDMEM::MEDFileJointOneStep::shallowCpy;
206 %newobject ParaMEDMEM::MEDFileJoint::New;
207 %newobject ParaMEDMEM::MEDFileJoint::deepCpy;
208 %newobject ParaMEDMEM::MEDFileJoint::shallowCpy;
209 %newobject ParaMEDMEM::MEDFileJoints::New;
210 %newobject ParaMEDMEM::MEDFileJoints::deepCpy;
211 %newobject ParaMEDMEM::MEDFileJoints::getJointAtPos;
212 %newobject ParaMEDMEM::MEDFileJoints::getJointWithName;
213 %newobject ParaMEDMEM::MEDFileJoints::__getitem__;
215 %newobject ParaMEDMEM::SauvWriter::New;
216 %newobject ParaMEDMEM::SauvReader::New;
217 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
219 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
220 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
221 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
222 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
223 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
225 %feature("unref") MEDFileMesh "$this->decrRef();"
226 %feature("unref") MEDFileUMesh "$this->decrRef();"
227 %feature("unref") MEDFileCMesh "$this->decrRef();"
228 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
229 %feature("unref") MEDFileMeshes "$this->decrRef();"
230 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
231 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
232 %feature("unref") MEDFileField1TS "$this->decrRef();"
233 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
234 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
235 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
236 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
237 %feature("unref") MEDFileFields "$this->decrRef();"
238 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
239 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
240 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
241 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
242 %feature("unref") MEDFileParameters "$this->decrRef();"
243 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
244 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
245 %feature("unref") MEDFileJoint "$this->decrRef();"
246 %feature("unref") MEDFileJoints "$this->decrRef();"
247 %feature("unref") MEDFileData "$this->decrRef();"
248 %feature("unref") SauvReader "$this->decrRef();"
249 %feature("unref") SauvWriter "$this->decrRef();"
250 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
251 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
252 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
253 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
254 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
255 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
260 static bool HasXDR();
261 static std::string MEDFileVersionStr();
262 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
263 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
264 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
265 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
266 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
267 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
268 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
269 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
270 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
271 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
272 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
273 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
274 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
275 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
276 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
277 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
278 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
281 static PyObject *MEDFileVersion()
283 int major,minor,release;
284 MEDLoader::MEDFileVersion(major,minor,release);
285 PyObject *ret(PyTuple_New(3));
286 PyTuple_SetItem(ret,0,SWIG_From_int(major));
287 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
288 PyTuple_SetItem(ret,2,SWIG_From_int(release));
292 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
294 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
295 PyObject *ret=PyList_New(res.size());
297 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
299 PyObject *elt=PyTuple_New(2);
300 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
301 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
302 PyList_SetItem(ret,rk,elt);
307 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
309 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
310 PyObject *ret=PyList_New(res.size());
312 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
314 PyObject *elt=PyTuple_New(3);
315 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
316 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
317 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
318 PyList_SetItem(ret,rk,elt);
323 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
325 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
326 PyObject *ret=PyList_New(res.size());
328 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
330 PyObject *elt=PyTuple_New(2);
331 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
332 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
333 PyList_SetItem(ret,rk,elt);
337 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
339 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
340 PyObject *ret=PyList_New(res.size());
342 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
344 PyObject *elt=PyTuple_New(2);
345 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
346 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
347 PyList_SetItem(ret,rk,elt);
351 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
353 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
354 PyObject *ret=PyList_New(res.size());
356 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
358 PyObject *elt=PyTuple_New(2);
359 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
360 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
361 PyList_SetItem(ret,rk,elt);
365 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
367 int meshDim,spaceDim,numberOfNodes;
368 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
369 PyObject *ret=PyTuple_New(4);
370 PyObject *elt0=PyList_New(res.size());
372 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
374 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
376 PyObject *elt1=PyList_New(obj2.size());
377 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
379 PyObject *elt2=PyTuple_New(2);
380 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
381 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
382 PyList_SetItem(elt1,j,elt2);
384 PyList_SetItem(elt0,i,elt1);
386 PyTuple_SetItem(ret,0,elt0);
387 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
388 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
389 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
392 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
393 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
395 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
396 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
397 return convertFieldDoubleVecToPy(res);
399 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
401 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
402 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
403 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
405 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
407 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
408 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
409 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
411 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
413 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
414 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
415 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
417 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
419 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
421 PyObject *ret=PyList_New(size);
422 for(int i=0;i<size;i++)
423 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
426 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
428 std::vector<std::string> grps;
429 converPyListToVecString(li,grps);
430 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
432 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
434 std::vector<std::string> fams;
435 converPyListToVecString(li,fams);
436 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
439 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
440 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
441 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
442 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
443 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
444 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);
445 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);
446 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);
447 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);
448 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);
449 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
450 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
451 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
452 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
453 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
454 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
459 class MEDFileWritable
462 void copyOptionsFrom(const MEDFileWritable& other) const;
463 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
464 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
465 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
466 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
469 class MEDFileMeshReadSelector
472 MEDFileMeshReadSelector();
473 MEDFileMeshReadSelector(unsigned int code);
474 unsigned int getCode() const;
475 void setCode(unsigned int newCode);
476 bool isCellFamilyFieldReading() const;
477 bool isNodeFamilyFieldReading() const;
478 bool isCellNameFieldReading() const;
479 bool isNodeNameFieldReading() const;
480 bool isCellNumFieldReading() const;
481 bool isNodeNumFieldReading() const;
482 void setCellFamilyFieldReading(bool b);
483 void setNodeFamilyFieldReading(bool b);
484 void setCellNameFieldReading(bool b);
485 void setNodeNameFieldReading(bool b);
486 void setCellNumFieldReading(bool b);
487 void setNodeNumFieldReading(bool b);
490 std::string __str__() const throw(INTERP_KERNEL::Exception)
492 std::ostringstream oss;
497 std::string __repr__() const throw(INTERP_KERNEL::Exception)
499 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
504 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
507 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
508 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
509 throw(INTERP_KERNEL::Exception);
510 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
511 INTERP_KERNEL::NormalizedCellType loc_geo_type,
512 INTERP_KERNEL::NormalizedCellType rem_geo_type)
513 throw(INTERP_KERNEL::Exception);
514 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
515 MEDFileJointCorrespondence *deepCpy() const;
516 MEDFileJointCorrespondence *shallowCpy() const;
517 void setIsNodal(bool isNodal);
518 bool getIsNodal() const;
519 bool isEqual(const MEDFileJointCorrespondence *other) const;
520 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
521 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
522 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
523 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
524 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
525 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
526 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const throw(INTERP_KERNEL::Exception);
527 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
530 MEDFileJointCorrespondence()
532 return MEDFileJointCorrespondence::New();
534 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
536 return MEDFileJointCorrespondence::New(correspondence);
538 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
539 INTERP_KERNEL::NormalizedCellType loc_geo_type,
540 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
542 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
545 std::string __str__() const throw(INTERP_KERNEL::Exception)
547 return self->simpleRepr();
552 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
555 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
556 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
557 MEDFileJointOneStep *deepCpy() const;
558 MEDFileJointOneStep *shallowCpy() const;
559 bool isEqual(const MEDFileJointOneStep *other) const;
560 void setOrder(int order);
561 int getOrder() const;
562 void setIteration(int it);
563 int getIteration() const;
564 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
565 int getNumberOfCorrespondences() const;
566 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
567 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
568 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
571 MEDFileJointOneStep()
573 return MEDFileJointOneStep::New();
576 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
578 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
581 std::string __str__() const throw(INTERP_KERNEL::Exception)
583 return self->simpleRepr();
587 class MEDFileJoint : public RefCountObject, public MEDFileWritable
590 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
591 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
592 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
593 MEDFileJoint *deepCpy() const;
594 MEDFileJoint *shallowCpy() const;
595 bool isEqual(const MEDFileJoint *other) const;
596 void setLocalMeshName(const std::string& name);
597 std::string getLocalMeshName() const;
598 void setRemoteMeshName(const std::string& name);
599 std::string getRemoteMeshName() const;
600 void setDescription(const std::string& name);
601 std::string getDescription() const;
602 void setJointName(const std::string& name);
603 std::string getJointName() const;
604 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
605 void setDomainNumber(const int& number);
606 int getDomainNumber() const;
607 void pushStep(MEDFileJointOneStep* step);
608 int getNumberOfSteps() const;
609 MEDFileJointOneStep *getStepAtPos(int i) const;
610 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
611 std::string simpleRepr() const;
616 return MEDFileJoint::New();
619 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
621 return MEDFileJoint::New(fileName,mName,num);
624 std::string __str__() const throw(INTERP_KERNEL::Exception)
626 return self->simpleRepr();
631 class MEDFileJoints : public RefCountObject, public MEDFileWritable
634 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
635 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
636 MEDFileJoints *deepCpy() const;
637 std::string simpleRepr() const;
638 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
639 std::string getMeshName() const;
640 int getNumberOfJoints() const;
641 std::vector<std::string> getJointsNames() const;
642 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
643 void resize(int newSize) throw(INTERP_KERNEL::Exception);
644 void pushJoint(MEDFileJoint *joint);
645 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
646 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
651 return MEDFileJoints::New();
654 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
656 return MEDFileJoints::New(fileName,meshName);
659 std::string __str__() const throw(INTERP_KERNEL::Exception)
661 return self->simpleRepr();
664 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
668 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
673 else if(PyString_Check(obj))
675 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
681 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
684 int __len__() const throw(INTERP_KERNEL::Exception)
686 return self->getNumberOfJoints();
689 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
691 MEDFileJoint *ret=self->getJointAtPos(i);
697 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
699 MEDFileJoint *ret=self->getJointWithName(paramName);
707 class MEDFileMesh : public RefCountObject, public MEDFileWritable
710 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
711 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
712 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
713 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
714 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
715 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
716 void setName(const std::string& name);
717 std::string getName();
718 std::string getUnivName() const;
719 bool getUnivNameWrStatus() const;
720 void setUnivNameWrStatus(bool newStatus);
721 void setDescription(const std::string& name);
722 std::string getDescription() const;
723 void setOrder(int order);
724 int getOrder() const;
725 void setIteration(int it);
727 void setTimeValue(double time);
728 void setTime(int dt, int it, double time);
729 double getTimeValue() const;
730 void setTimeUnit(const std::string& unit);
731 std::string getTimeUnit() const;
732 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
733 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
734 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
735 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
736 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
737 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
738 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
739 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
740 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
741 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
742 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
743 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
744 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
746 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
747 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
748 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
749 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
750 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
751 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
752 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
753 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
754 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
755 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
756 void clearGrpMap() throw(INTERP_KERNEL::Exception);
757 void clearFamMap() throw(INTERP_KERNEL::Exception);
758 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
759 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
760 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
761 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
762 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
763 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
764 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
765 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
766 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
767 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
768 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
769 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
770 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
771 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
772 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
773 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
774 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
775 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
776 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
777 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
778 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
779 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
780 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
781 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
782 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
783 void setFamilyInfo(const std::map<std::string,int>& info);
784 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
785 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
786 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
787 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
788 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
789 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
790 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
791 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
792 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
793 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
794 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
795 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
796 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
797 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
798 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
799 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
800 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
801 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
802 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
803 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
804 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
806 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
807 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
808 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
809 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
810 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
811 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
812 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
813 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
814 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
815 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
816 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
817 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
818 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
819 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
820 int getNumberOfJoints();
821 MEDFileJoints *getJoints();
822 void setJoints( MEDFileJoints* joints );
825 std::string __str__() const throw(INTERP_KERNEL::Exception)
827 return self->simpleRepr();
830 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
832 return self->getGenMeshAtLevel(meshDimRelToMaxExt,false);
835 PyObject *getTime() throw(INTERP_KERNEL::Exception)
838 double tmp0=self->getTime(tmp1,tmp2);
839 PyObject *res = PyList_New(3);
840 PyList_SetItem(res,0,SWIG_From_int(tmp1));
841 PyList_SetItem(res,1,SWIG_From_int(tmp2));
842 PyList_SetItem(res,2,SWIG_From_double(tmp0));
846 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
849 bool ret0=self->isEqual(other,eps,what);
850 PyObject *res=PyList_New(2);
851 PyObject *ret0Py=ret0?Py_True:Py_False;
853 PyList_SetItem(res,0,ret0Py);
854 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
858 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
860 std::vector<const DataArrayInt *> grps;
861 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
862 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
865 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
868 bool ret0=self->areFamsEqual(other,what);
869 PyObject *res=PyList_New(2);
870 PyObject *ret0Py=ret0?Py_True:Py_False;
872 PyList_SetItem(res,0,ret0Py);
873 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
877 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
880 bool ret0=self->areGrpsEqual(other,what);
881 PyObject *res=PyList_New(2);
882 PyObject *ret0Py=ret0?Py_True:Py_False;
884 PyList_SetItem(res,0,ret0Py);
885 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
889 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
891 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
892 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
893 PyObject *res=PyList_New(result.size());
894 for(int i=0;iL!=result.end(); i++, iL++)
895 PyList_SetItem(res,i,PyInt_FromLong(*iL));
899 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
901 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
902 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
903 PyObject *res=PyList_New(result.size());
904 for(int i=0;iL!=result.end(); i++, iL++)
905 PyList_SetItem(res,i,PyInt_FromLong(*iL));
909 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
911 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
914 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
917 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
919 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
922 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
925 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
927 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
930 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
933 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
935 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
938 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
941 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
943 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
946 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
949 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
952 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
953 PyObject *ret=PyTuple_New(2);
954 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
955 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
959 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
961 DataArrayInt *ret3=0;
962 std::vector<int> ret1,ret2;
963 bool ret0=self->unPolyze(ret1,ret2,ret3);
964 PyObject *ret=PyTuple_New(4);
965 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
967 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
968 for(int j=0;j<(int)ret1.size()/3;j++)
970 PyObject *retLev2=PyList_New(3);
971 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
972 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
973 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
974 PyList_SetItem(retLev1_0,j,retLev2);
976 PyTuple_SetItem(ret,1,retLev1_0);
978 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
979 for(int j=0;j<(int)ret2.size()/3;j++)
981 PyObject *retLev2=PyList_New(3);
982 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
983 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
984 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
985 PyList_SetItem(retLev1_1,j,retLev2);
987 PyTuple_SetItem(ret,2,retLev1_1);
989 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
995 class MEDFileUMesh : public MEDFileMesh
998 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
999 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1000 static MEDFileUMesh *New();
1002 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1003 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1005 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1006 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1007 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1008 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1009 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1010 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1011 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1012 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1013 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1014 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1015 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1016 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1017 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1018 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1019 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
1020 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1021 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1022 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1023 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1024 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1026 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1027 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1028 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1029 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1030 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1031 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1032 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1033 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1034 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1035 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1036 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1037 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1038 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1041 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1043 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1046 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1048 return MEDFileUMesh::New(fileName,mrs);
1053 return MEDFileUMesh::New();
1057 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1059 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1062 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)
1064 std::vector<int> typesCpp1;
1065 convertPyToNewIntArr3(types,typesCpp1);
1066 std::size_t sz(typesCpp1.size());
1067 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1068 for(std::size_t ii=0;ii<sz;ii++)
1069 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1070 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1073 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1074 {// put an empty dict in input to say to __new__ to call __init__...
1075 PyObject *ret(PyTuple_New(1));
1076 PyObject *ret0(PyDict_New());
1077 PyTuple_SetItem(ret,0,ret0);
1081 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1083 std::vector<double> a0;
1084 std::vector<int> a1;
1085 std::vector<std::string> a2;
1086 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1087 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1088 self->serialize(a0,a1,a2,a3,a4);
1089 PyObject *ret(PyTuple_New(5));
1090 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1091 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1093 PyObject *ret2(PyList_New(sz));
1094 for(int i=0;i<sz;i++)
1095 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1096 PyTuple_SetItem(ret,2,ret2);
1098 PyObject *ret3(PyList_New(sz));
1099 for(int i=0;i<sz;i++)
1101 DataArrayInt *elt(a3[i]);
1104 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1106 PyTuple_SetItem(ret,3,ret3);
1107 DataArrayDouble *ret4(a4);
1110 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1114 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1116 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1117 if(!PyTuple_Check(inp))
1118 throw INTERP_KERNEL::Exception(MSG);
1119 int sz(PyTuple_Size(inp));
1121 throw INTERP_KERNEL::Exception(MSG);
1122 std::vector<double> a0;
1123 std::vector<int> a1;
1124 std::vector<std::string> a2;
1125 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1126 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1128 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1130 fillArrayWithPyListDbl3(a0py,tmp,a0);
1131 convertPyToNewIntArr3(a1py,a1);
1132 fillStringVector(a2py,a2);
1134 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1136 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1137 if(!SWIG_IsOK(status))
1138 throw INTERP_KERNEL::Exception(MSG);
1139 a4=reinterpret_cast<DataArrayDouble *>(argp);
1140 if((DataArrayDouble *)a4)
1143 std::vector< DataArrayInt * > a3Tmp;
1144 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1145 std::size_t sz(a3Tmp.size());
1147 for(std::size_t i=0;i<sz;i++)
1151 a3Tmp[i]->incrRef();
1153 self->unserialize(a0,a1,a2,a3,a4);
1157 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1160 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1161 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1164 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1167 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1170 self->setMeshAtLevel(meshDimRelToMax,m1);
1173 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1176 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1178 self->removeMeshAtLevel(meshDimRelToMax);
1181 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1183 std::vector<const MEDCouplingUMesh *> ms;
1184 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1185 self->setMeshes(ms,renum);
1188 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1190 std::vector<const MEDCouplingUMesh *> ms;
1191 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1192 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1195 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1197 std::vector<const MEDCouplingUMesh *> ms;
1198 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1199 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1202 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1204 DataArrayDouble *ret=self->getCoords();
1210 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1212 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1215 return const_cast<PartDefinition *>(ret);
1218 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1220 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1221 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1222 PyObject *ret=PyTuple_New(3);
1223 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1224 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1225 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1229 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1231 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1237 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1239 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1240 std::size_t sz(tmp.size());
1241 PyObject *ret=PyList_New(sz);
1242 for(std::size_t i=0;i<sz;i++)
1246 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1253 class MEDFileStructuredMesh : public MEDFileMesh
1258 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1260 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1268 class MEDFileCMesh : public MEDFileStructuredMesh
1271 static MEDFileCMesh *New();
1272 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1273 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1274 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1275 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1280 return MEDFileCMesh::New();
1283 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1285 return MEDFileCMesh::New(fileName,mrs);
1288 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1290 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1293 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1295 const MEDCouplingCMesh *tmp=self->getMesh();
1298 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1303 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1306 static MEDFileCurveLinearMesh *New();
1307 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1308 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1309 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1312 MEDFileCurveLinearMesh()
1314 return MEDFileCurveLinearMesh::New();
1317 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1319 return MEDFileCurveLinearMesh::New(fileName,mrs);
1322 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1324 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1327 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1329 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1332 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1337 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1340 static MEDFileMeshMultiTS *New();
1341 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1342 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1343 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1344 std::string getName() const throw(INTERP_KERNEL::Exception);
1345 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1346 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1349 MEDFileMeshMultiTS()
1351 return MEDFileMeshMultiTS::New();
1354 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1356 return MEDFileMeshMultiTS::New(fileName);
1359 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1361 return MEDFileMeshMultiTS::New(fileName,mName);
1364 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1366 MEDFileMesh *ret=self->getOneTimeStep();
1374 class MEDFileMeshesIterator
1379 PyObject *next() throw(INTERP_KERNEL::Exception)
1381 MEDFileMesh *ret=self->nextt();
1385 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1389 PyErr_SetString(PyExc_StopIteration,"No more data.");
1396 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1399 static MEDFileMeshes *New();
1400 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1401 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1402 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1403 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1404 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1406 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1407 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1408 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1409 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1414 return MEDFileMeshes::New();
1417 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1419 return MEDFileMeshes::New(fileName);
1422 std::string __str__() const throw(INTERP_KERNEL::Exception)
1424 return self->simpleRepr();
1427 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1429 if(PyInt_Check(obj))
1431 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1436 else if(PyString_Check(obj))
1438 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1444 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1447 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1449 self->setMeshAtPos(obj,mesh);
1453 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1455 return self->iterator();
1458 int __len__() const throw(INTERP_KERNEL::Exception)
1460 return self->getNumberOfMeshes();
1463 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1465 MEDFileMesh *ret=self->getMeshAtPos(i);
1470 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1472 MEDFileMesh *ret=self->getMeshWithName(mname);
1480 class MEDFileFieldLoc : public RefCountObject
1483 std::string getName() const;
1484 int getDimension() const;
1485 int getNumberOfGaussPoints() const;
1486 int getNumberOfPointsInCells() const;
1487 const std::vector<double>& getRefCoords() const;
1488 const std::vector<double>& getGaussCoords() const;
1489 const std::vector<double>& getGaussWeights() const;
1490 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1493 std::string __str__() const throw(INTERP_KERNEL::Exception)
1495 return self->repr();
1500 class MEDFileFieldGlobsReal
1503 void resetContent();
1504 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1505 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1506 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1507 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1508 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1509 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1510 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1511 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1512 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1513 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1514 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1515 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1516 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1517 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1518 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1519 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1520 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1521 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1522 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1523 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1524 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1525 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1526 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1527 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1528 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1529 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1532 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1534 const DataArrayInt *ret=self->getProfile(pflName);
1537 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1540 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1542 const DataArrayInt *ret=self->getProfileFromId(pflId);
1545 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1548 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1550 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1553 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1556 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1558 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1561 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1564 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1566 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1567 return convertVecPairVecStToPy(ret);
1570 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1572 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1573 return convertVecPairVecStToPy(ret);
1576 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1578 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1579 self->changePflsNames(v);
1582 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1584 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1585 self->changePflsRefsNamesGen(v);
1588 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1590 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1591 self->changePflsNamesInStruct(v);
1594 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1596 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1597 self->changeLocsNames(v);
1600 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1602 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1603 self->changeLocsRefsNamesGen(v);
1606 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1608 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1609 self->changeLocsNamesInStruct(v);
1612 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1614 std::ostringstream oss;
1615 self->simpleReprGlobs(oss);
1621 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1624 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1625 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1626 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1627 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1628 void loadArrays() throw(INTERP_KERNEL::Exception);
1629 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1630 void unloadArrays() throw(INTERP_KERNEL::Exception);
1631 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1632 int getDimension() const throw(INTERP_KERNEL::Exception);
1633 int getIteration() const throw(INTERP_KERNEL::Exception);
1634 int getOrder() const throw(INTERP_KERNEL::Exception);
1635 std::string getName() throw(INTERP_KERNEL::Exception);
1636 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1637 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1638 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1639 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1640 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1641 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1642 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1643 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1644 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1645 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1646 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1647 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1648 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1649 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1650 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1653 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1656 double tmp0=self->getTime(tmp1,tmp2);
1657 PyObject *res = PyList_New(3);
1658 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1659 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1660 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1664 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1666 std::pair<int,int> res=self->getDtIt();
1667 PyObject *elt=PyTuple_New(2);
1668 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1669 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1673 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1675 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1678 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1680 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1683 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1685 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1686 return self->changeMeshNames(modifTab);
1689 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1691 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1692 PyObject *ret2=PyList_New(ret.size());
1693 for(int i=0;i<(int)ret.size();i++)
1694 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1698 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1700 std::vector<int> ret1;
1701 int ret0=self->getNonEmptyLevels(mname,ret1);
1702 PyObject *elt=PyTuple_New(2);
1703 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1704 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1708 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1710 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1711 std::vector< std::vector<TypeOfField> > typesF;
1712 std::vector< std::vector<std::string> > pfls;
1713 std::vector< std::vector<std::string> > locs;
1714 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1716 PyObject *ret2=PyList_New(sz);
1717 for(int i=0;i<sz;i++)
1719 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1720 const std::vector<TypeOfField>& typesFI=typesF[i];
1721 const std::vector<std::string>& pflsI=pfls[i];
1722 const std::vector<std::string>& locsI=locs[i];
1723 PyObject *elt=PyTuple_New(2);
1724 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1725 int sz2=ret[i].size();
1726 PyObject *elt2=PyList_New(sz2);
1727 for(int j=0;j<sz2;j++)
1729 PyObject *elt3=PyTuple_New(4);
1730 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1731 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));
1732 PyTuple_SetItem(elt3,1,elt4);
1733 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1734 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1735 PyList_SetItem(elt2,j,elt3);
1737 PyTuple_SetItem(elt,1,elt2);
1738 PyList_SetItem(ret2,i,elt);
1743 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1745 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1746 std::size_t sz=ret.size();
1747 PyObject *retPy=PyList_New(sz);
1748 for(std::size_t i=0;i<sz;i++)
1749 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1753 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1755 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1756 std::size_t sz=ret.size();
1757 PyObject *retPy=PyList_New(sz);
1758 for(std::size_t i=0;i<sz;i++)
1759 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1763 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1765 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1766 std::size_t sz=ret.size();
1767 PyObject *retPy=PyList_New(sz);
1768 for(std::size_t i=0;i<sz;i++)
1769 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1775 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1778 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1779 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1780 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1781 static MEDFileField1TS *New();
1782 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1783 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1784 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1785 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1786 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1787 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1789 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1790 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1791 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1792 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1795 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1797 return MEDFileField1TS::New(fileName,loadAll);
1800 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1802 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1805 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1807 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1812 return MEDFileField1TS::New();
1815 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1817 const DataArrayDouble *arr=0;
1819 arr=field->getArray();
1820 self->copyTinyInfoFrom(field,arr);
1823 std::string __str__() const throw(INTERP_KERNEL::Exception)
1825 return self->simpleRepr();
1828 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1830 DataArrayInt *ret1=0;
1831 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1832 PyObject *ret=PyTuple_New(2);
1833 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1834 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1838 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1840 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1841 std::vector< std::vector<TypeOfField> > typesF;
1842 std::vector< std::vector<std::string> > pfls;
1843 std::vector< std::vector<std::string> > locs;
1844 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1846 PyObject *ret2=PyList_New(sz);
1847 for(int i=0;i<sz;i++)
1849 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1850 const std::vector<TypeOfField>& typesFI=typesF[i];
1851 const std::vector<std::string>& pflsI=pfls[i];
1852 const std::vector<std::string>& locsI=locs[i];
1853 PyObject *elt=PyTuple_New(2);
1854 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1855 int sz2=ret[i].size();
1856 PyObject *elt2=PyList_New(sz2);
1857 for(int j=0;j<sz2;j++)
1859 PyObject *elt3=PyTuple_New(4);
1860 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1861 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1862 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1863 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1864 PyList_SetItem(elt2,j,elt3);
1866 PyTuple_SetItem(elt,1,elt2);
1867 PyList_SetItem(ret2,i,elt);
1872 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1874 DataArrayDouble *ret=self->getUndergroundDataArray();
1880 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1882 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1883 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1886 PyObject *ret=PyTuple_New(2);
1887 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1888 std::size_t sz=elt1Cpp.size();
1889 PyObject *elt=PyList_New(sz);
1890 for(std::size_t i=0;i<sz;i++)
1892 PyObject *elt1=PyTuple_New(2);
1893 PyObject *elt2=PyTuple_New(2);
1894 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1895 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1896 PyObject *elt3=PyTuple_New(2);
1897 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1898 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1899 PyTuple_SetItem(elt1,0,elt2);
1900 PyTuple_SetItem(elt1,1,elt3);
1901 PyList_SetItem(elt,i,elt1);
1903 PyTuple_SetItem(ret,1,elt);
1909 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1912 static MEDFileIntField1TS *New();
1913 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1914 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1915 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1916 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1918 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1919 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1922 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1924 return MEDFileIntField1TS::New();
1927 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1929 return MEDFileIntField1TS::New(fileName,loadAll);
1932 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1934 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1937 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1939 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1942 std::string __str__() const throw(INTERP_KERNEL::Exception)
1944 return self->simpleRepr();
1947 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1949 DataArrayInt *ret1=0;
1950 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1951 PyObject *ret=PyTuple_New(2);
1952 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1953 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1957 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1959 DataArrayInt *ret1=0;
1960 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1961 PyObject *ret=PyTuple_New(2);
1962 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1963 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1967 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1969 DataArrayInt *ret1=0;
1970 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1971 PyObject *ret=PyTuple_New(2);
1972 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1973 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1977 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1979 DataArrayInt *ret1=0;
1980 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1981 PyObject *ret=PyTuple_New(2);
1982 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1983 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1987 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1989 DataArrayInt *ret1=0;
1990 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1991 PyObject *ret=PyTuple_New(2);
1992 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1993 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1997 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1999 DataArrayInt *ret1=0;
2000 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2001 PyObject *ret=PyTuple_New(2);
2002 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2003 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2007 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2009 DataArrayInt *ret=self->getUndergroundDataArray();
2017 class MEDFileAnyTypeFieldMultiTSIterator
2022 PyObject *next() throw(INTERP_KERNEL::Exception)
2024 MEDFileAnyTypeField1TS *ret=self->nextt();
2026 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2029 PyErr_SetString(PyExc_StopIteration,"No more data.");
2036 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2039 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2040 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2041 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2042 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2043 std::string getName() const throw(INTERP_KERNEL::Exception);
2044 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2045 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2046 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2047 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2048 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2049 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2050 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2051 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2052 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2053 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2054 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2055 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2056 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2057 void loadArrays() throw(INTERP_KERNEL::Exception);
2058 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2059 void unloadArrays() throw(INTERP_KERNEL::Exception);
2060 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2062 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2063 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2064 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2065 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2066 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2069 int __len__() const throw(INTERP_KERNEL::Exception)
2071 return self->getNumberOfTS();
2074 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2076 if(elt0 && PyInt_Check(elt0))
2078 int pos=PyInt_AS_LONG(elt0);
2081 else if(elt0 && PyTuple_Check(elt0))
2083 if(PyTuple_Size(elt0)==2)
2085 PyObject *o0=PyTuple_GetItem(elt0,0);
2086 PyObject *o1=PyTuple_GetItem(elt0,1);
2087 if(PyInt_Check(o0) && PyInt_Check(o1))
2089 int iter=PyInt_AS_LONG(o0);
2090 int order=PyInt_AS_LONG(o1);
2091 return self->getPosOfTimeStep(iter,order);
2094 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 !");
2097 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 !");
2099 else if(elt0 && PyFloat_Check(elt0))
2101 double val=PyFloat_AS_DOUBLE(elt0);
2102 return self->getPosGivenTime(val);
2105 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2108 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2110 std::vector< std::pair<int,int> > res=self->getIterations();
2111 PyObject *ret=PyList_New(res.size());
2113 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2115 PyObject *elt=PyTuple_New(2);
2116 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2117 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2118 PyList_SetItem(ret,rk,elt);
2123 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2125 std::vector<double> ret1;
2126 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2127 std::size_t sz=ret.size();
2128 PyObject *ret2=PyList_New(sz);
2129 for(std::size_t i=0;i<sz;i++)
2131 PyObject *elt=PyTuple_New(3);
2132 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2133 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2134 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2135 PyList_SetItem(ret2,i,elt);
2140 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2142 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2143 PyObject *ret2=PyList_New(ret.size());
2144 for(int i=0;i<(int)ret.size();i++)
2146 const std::vector<TypeOfField>& rett=ret[i];
2147 PyObject *ret3=PyList_New(rett.size());
2148 for(int j=0;j<(int)rett.size();j++)
2149 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2150 PyList_SetItem(ret2,i,ret3);
2155 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2157 std::vector<int> ret1;
2158 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2159 PyObject *elt=PyTuple_New(2);
2160 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2161 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2165 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2167 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2168 std::vector< std::vector<TypeOfField> > typesF;
2169 std::vector< std::vector<std::string> > pfls;
2170 std::vector< std::vector<std::string> > locs;
2171 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2173 PyObject *ret2=PyList_New(sz);
2174 for(int i=0;i<sz;i++)
2176 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2177 const std::vector<TypeOfField>& typesFI=typesF[i];
2178 const std::vector<std::string>& pflsI=pfls[i];
2179 const std::vector<std::string>& locsI=locs[i];
2180 PyObject *elt=PyTuple_New(2);
2181 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2182 int sz2=ret[i].size();
2183 PyObject *elt2=PyList_New(sz2);
2184 for(int j=0;j<sz2;j++)
2186 PyObject *elt3=PyTuple_New(4);
2187 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2188 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));
2189 PyTuple_SetItem(elt3,1,elt4);
2190 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2191 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2192 PyList_SetItem(elt2,j,elt3);
2194 PyTuple_SetItem(elt,1,elt2);
2195 PyList_SetItem(ret2,i,elt);
2200 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2202 if(PyList_Check(elts))
2204 int sz=PyList_Size(elts);
2205 std::vector<int> ret(sz);
2206 for(int i=0;i<sz;i++)
2208 PyObject *elt=PyList_GetItem(elts,i);
2209 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2215 std::vector<int> ret(1);
2216 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2221 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2223 if(PySlice_Check(elts))
2225 Py_ssize_t strt=2,stp=2,step=2;
2226 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2227 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2228 self->eraseTimeStepIds2(strt,stp,step);
2232 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2233 if(!idsToRemove.empty())
2234 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2238 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2242 std::vector<int> pos2;
2243 DataArrayInt *pos3=0;
2244 DataArrayIntTuple *pos4=0;
2245 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2250 self->eraseTimeStepIds(&pos1,&pos1+1);
2257 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2262 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2266 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2270 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2272 return self->iterator();
2275 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2277 if(elt0 && PyList_Check(elt0))
2279 int sz=PyList_Size(elt0);
2280 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2281 int *pt=da->getPointer();
2282 for(int i=0;i<sz;i++,pt++)
2284 PyObject *elt1=PyList_GetItem(elt0,i);
2285 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2287 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2289 else if(elt0 && PySlice_Check(elt0))
2291 Py_ssize_t strt=2,stp=2,step=2;
2292 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2293 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2294 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2297 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2300 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2302 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2303 return self->changeMeshNames(modifTab);
2306 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2308 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2309 std::size_t sz=ret.size();
2310 PyObject *retPy=PyList_New(sz);
2311 for(std::size_t i=0;i<sz;i++)
2312 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2316 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2318 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2319 std::size_t sz=ret.size();
2320 PyObject *retPy=PyList_New(sz);
2321 for(std::size_t i=0;i<sz;i++)
2322 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2326 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2328 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2329 std::size_t sz=ret.size();
2330 PyObject *retPy=PyList_New(sz);
2331 for(std::size_t i=0;i<sz;i++)
2332 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2336 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2339 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2340 if(SWIG_IsOK(status))
2342 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2346 std::vector<MEDFileAnyTypeField1TS *> tmp;
2347 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2348 self->pushBackTimeSteps(tmp);
2352 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2354 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2355 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2356 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2357 std::size_t sz=ret.size();
2358 PyObject *retPy=PyList_New(sz);
2359 for(std::size_t i=0;i<sz;i++)
2361 std::size_t sz2=ret[i].size();
2362 PyObject *ret1Py=PyList_New(sz2);
2363 for(std::size_t j=0;j<sz2;j++)
2365 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2368 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2370 PyList_SetItem(retPy,i,ret1Py);
2375 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2377 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2378 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2379 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2380 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2381 if(ret2.size()!=ret.size())
2383 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2384 throw INTERP_KERNEL::Exception(oss.str().c_str());
2386 std::size_t sz=ret.size();
2387 PyObject *retPy=PyList_New(sz);
2388 for(std::size_t i=0;i<sz;i++)
2390 std::size_t sz2=ret[i].size();
2391 PyObject *ret0Py=PyTuple_New(2);
2392 PyObject *ret1Py=PyList_New(sz2);
2393 for(std::size_t j=0;j<sz2;j++)
2395 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2398 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2400 PyTuple_SetItem(ret0Py,0,ret1Py);
2401 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2402 PyList_SetItem(retPy,i,ret0Py);
2409 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2412 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2413 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2414 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2416 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2417 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2418 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2419 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2420 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2422 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2423 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2424 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2427 MEDFileFieldMultiTS()
2429 return MEDFileFieldMultiTS::New();
2432 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2434 return MEDFileFieldMultiTS::New(fileName,loadAll);
2437 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2439 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2442 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2444 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2445 std::size_t sz(tmp.size());
2446 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2447 for(std::size_t i=0;i<sz;i++)
2449 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2450 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2452 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2455 std::string __str__() const throw(INTERP_KERNEL::Exception)
2457 return self->simpleRepr();
2460 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2462 DataArrayInt *ret1=0;
2463 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2464 PyObject *ret=PyTuple_New(2);
2465 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2466 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2470 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2472 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2473 std::vector< std::vector<TypeOfField> > typesF;
2474 std::vector< std::vector<std::string> > pfls;
2475 std::vector< std::vector<std::string> > locs;
2476 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2478 PyObject *ret2=PyList_New(sz);
2479 for(int i=0;i<sz;i++)
2481 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2482 const std::vector<TypeOfField>& typesFI=typesF[i];
2483 const std::vector<std::string>& pflsI=pfls[i];
2484 const std::vector<std::string>& locsI=locs[i];
2485 PyObject *elt=PyTuple_New(2);
2486 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2487 int sz2=ret[i].size();
2488 PyObject *elt2=PyList_New(sz2);
2489 for(int j=0;j<sz2;j++)
2491 PyObject *elt3=PyTuple_New(4);
2492 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2493 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2494 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2495 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2496 PyList_SetItem(elt2,j,elt3);
2498 PyTuple_SetItem(elt,1,elt2);
2499 PyList_SetItem(ret2,i,elt);
2503 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2505 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2511 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2513 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2514 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2517 PyObject *ret=PyTuple_New(2);
2518 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2519 std::size_t sz=elt1Cpp.size();
2520 PyObject *elt=PyList_New(sz);
2521 for(std::size_t i=0;i<sz;i++)
2523 PyObject *elt1=PyTuple_New(2);
2524 PyObject *elt2=PyTuple_New(2);
2525 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2526 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2527 PyObject *elt3=PyTuple_New(2);
2528 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2529 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2530 PyTuple_SetItem(elt1,0,elt2);
2531 PyTuple_SetItem(elt1,1,elt3);
2532 PyList_SetItem(elt,i,elt1);
2534 PyTuple_SetItem(ret,1,elt);
2540 class MEDFileFieldsIterator
2545 PyObject *next() throw(INTERP_KERNEL::Exception)
2547 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2549 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2552 PyErr_SetString(PyExc_StopIteration,"No more data.");
2559 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2562 static MEDFileIntFieldMultiTS *New();
2563 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2564 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2566 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2567 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2568 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2571 MEDFileIntFieldMultiTS()
2573 return MEDFileIntFieldMultiTS::New();
2576 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2578 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2581 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2583 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2586 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2588 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2589 std::size_t sz(tmp.size());
2590 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2591 for(std::size_t i=0;i<sz;i++)
2593 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2594 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2596 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2599 std::string __str__() const throw(INTERP_KERNEL::Exception)
2601 return self->simpleRepr();
2604 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2606 DataArrayInt *ret1=0;
2607 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2608 PyObject *ret=PyTuple_New(2);
2609 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2610 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2614 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2616 DataArrayInt *ret1=0;
2617 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2618 PyObject *ret=PyTuple_New(2);
2619 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2620 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2624 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2626 DataArrayInt *ret1=0;
2627 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2628 PyObject *ret=PyTuple_New(2);
2629 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2630 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2634 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2636 DataArrayInt *ret1=0;
2637 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2638 PyObject *ret=PyTuple_New(2);
2639 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2640 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2644 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2646 DataArrayInt *ret1=0;
2647 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2648 PyObject *ret=PyTuple_New(2);
2649 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2650 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2654 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2656 DataArrayInt *ret1=0;
2657 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2658 PyObject *ret=PyTuple_New(2);
2659 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2660 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2664 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2666 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2674 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2677 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2678 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2679 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2680 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2681 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2682 void loadArrays() throw(INTERP_KERNEL::Exception);
2683 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2684 void unloadArrays() throw(INTERP_KERNEL::Exception);
2685 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2686 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2687 int getNumberOfFields() const;
2688 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2689 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2691 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2692 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2693 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2694 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2695 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2696 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2697 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2698 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2699 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2704 return MEDFileFields::New();
2707 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2709 return MEDFileFields::New(fileName,loadAll);
2712 std::string __str__() const throw(INTERP_KERNEL::Exception)
2714 return self->simpleRepr();
2717 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2719 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2720 std::size_t sz(tmp.size());
2721 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2722 for(std::size_t i=0;i<sz;i++)
2724 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2725 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2727 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2730 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2733 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2734 PyObject *ret=PyTuple_New(2);
2735 PyObject *ret_0=PyList_New(ret0.size());
2737 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2739 PyObject *elt=PyTuple_New(2);
2740 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2741 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2742 PyList_SetItem(ret_0,rk,elt);
2744 PyTuple_SetItem(ret,0,ret_0);
2745 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2746 PyTuple_SetItem(ret,1,ret_1);
2750 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2752 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2753 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2756 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2758 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2759 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2762 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2764 if(obj && PyList_Check(obj))
2766 int sz=PyList_Size(obj);
2767 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2768 int *pt=da->getPointer();
2769 for(int i=0;i<sz;i++,pt++)
2771 PyObject *elt1=PyList_GetItem(obj,i);
2772 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2774 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2777 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2780 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2782 self->setFieldAtPos(obj,field);
2786 int __len__() const throw(INTERP_KERNEL::Exception)
2788 return self->getNumberOfFields();
2791 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2793 return self->iterator();
2796 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2798 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2799 return self->changeMeshNames(modifTab);
2802 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2804 if(elt0 && PyInt_Check(elt0))
2806 return PyInt_AS_LONG(elt0);
2808 else if(elt0 && PyString_Check(elt0))
2809 return self->getPosFromFieldName(PyString_AsString(elt0));
2811 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2814 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2816 if(PyList_Check(elts))
2818 int sz=PyList_Size(elts);
2819 std::vector<int> ret(sz);
2820 for(int i=0;i<sz;i++)
2822 PyObject *elt=PyList_GetItem(elts,i);
2823 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2829 std::vector<int> ret(1);
2830 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2835 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2837 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2838 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2839 self->pushFields(tmp);
2842 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2844 if(elts && PySlice_Check(elts))
2846 Py_ssize_t strt=2,stp=2,step=2;
2847 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2848 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2849 self->destroyFieldsAtPos2(strt,stp,step);
2853 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2854 if(!idsToRemove.empty())
2855 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2861 class MEDFileParameter1TS : public RefCountObject
2864 void setIteration(int it);
2865 int getIteration() const;
2866 void setOrder(int order);
2867 int getOrder() const;
2868 void setTimeValue(double time);
2869 void setTime(int dt, int it, double time);
2870 double getTime(int& dt, int& it);
2871 double getTimeValue() const;
2874 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2877 void setValue(double val) throw(INTERP_KERNEL::Exception);
2878 double getValue() const throw(INTERP_KERNEL::Exception);
2879 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2882 std::string __str__() const throw(INTERP_KERNEL::Exception)
2884 return self->simpleRepr();
2889 class MEDFileParameterTinyInfo : public MEDFileWritable
2892 void setDescription(const std::string& name);
2893 std::string getDescription() const;
2894 void setTimeUnit(const std::string& unit);
2895 std::string getTimeUnit() const;
2898 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2901 static MEDFileParameterDouble1TS *New();
2902 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2903 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2904 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2905 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2906 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2907 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2908 std::string getName() const throw(INTERP_KERNEL::Exception);
2909 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2912 MEDFileParameterDouble1TS()
2914 return MEDFileParameterDouble1TS::New();
2917 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2919 return MEDFileParameterDouble1TS::New(fileName);
2922 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2924 return MEDFileParameterDouble1TS::New(fileName,paramName);
2927 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2929 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2932 std::string __str__() const throw(INTERP_KERNEL::Exception)
2934 return self->simpleRepr();
2937 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2940 bool ret0=self->isEqual(other,eps,what);
2941 PyObject *res=PyList_New(2);
2942 PyObject *ret0Py=ret0?Py_True:Py_False;
2944 PyList_SetItem(res,0,ret0Py);
2945 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2951 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2954 static MEDFileParameterMultiTS *New();
2955 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2956 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2957 std::string getName() const;
2958 void setName(const std::string& name);
2959 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2960 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2961 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2962 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2963 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2964 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2965 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2966 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2969 MEDFileParameterMultiTS()
2971 return MEDFileParameterMultiTS::New();
2974 MEDFileParameterMultiTS(const std::string& fileName)
2976 return MEDFileParameterMultiTS::New(fileName);
2979 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2981 return MEDFileParameterMultiTS::New(fileName,paramName);
2984 std::string __str__() const throw(INTERP_KERNEL::Exception)
2986 return self->simpleRepr();
2989 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2992 bool ret0=self->isEqual(other,eps,what);
2993 PyObject *res=PyList_New(2);
2994 PyObject *ret0Py=ret0?Py_True:Py_False;
2996 PyList_SetItem(res,0,ret0Py);
2997 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3001 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3005 std::vector<int> pos2;
3006 DataArrayInt *pos3=0;
3007 DataArrayIntTuple *pos4=0;
3008 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3013 self->eraseTimeStepIds(&pos1,&pos1+1);
3020 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3025 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3029 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3033 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3035 if(elt0 && PyInt_Check(elt0))
3037 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3040 else if(elt0 && PyTuple_Check(elt0))
3042 if(PyTuple_Size(elt0)==2)
3044 PyObject *o0=PyTuple_GetItem(elt0,0);
3045 PyObject *o1=PyTuple_GetItem(elt0,1);
3046 if(PyInt_Check(o0) && PyInt_Check(o1))
3048 int iter=PyInt_AS_LONG(o0);
3049 int order=PyInt_AS_LONG(o1);
3050 return self->getPosOfTimeStep(iter,order);
3053 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 !");
3056 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 !");
3058 else if(elt0 && PyFloat_Check(elt0))
3060 double val=PyFloat_AS_DOUBLE(elt0);
3061 return self->getPosGivenTime(val);
3064 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3067 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3069 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3075 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3077 if(PyList_Check(elts))
3079 int sz=PyList_Size(elts);
3080 std::vector<int> ret(sz);
3081 for(int i=0;i<sz;i++)
3083 PyObject *elt=PyList_GetItem(elts,i);
3084 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3090 std::vector<int> ret(1);
3091 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3096 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3098 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3099 if(!idsToRemove.empty())
3100 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3103 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3105 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3111 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3113 std::vector< std::pair<int,int> > res=self->getIterations();
3114 PyObject *ret=PyList_New(res.size());
3116 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3118 PyObject *elt=PyTuple_New(2);
3119 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3120 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3121 PyList_SetItem(ret,rk,elt);
3126 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3128 std::vector<double> res2;
3129 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3130 PyObject *ret=PyList_New(res.size());
3132 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3134 PyObject *elt=PyTuple_New(3);
3135 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3136 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3137 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3138 PyList_SetItem(ret,rk,elt);
3145 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3148 static MEDFileParameters *New();
3149 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3150 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3151 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3152 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3153 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3154 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3155 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3156 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3157 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3158 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3159 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3164 return MEDFileParameters::New();
3167 MEDFileParameters(const std::string& fileName)
3169 return MEDFileParameters::New(fileName);
3172 std::string __str__() const throw(INTERP_KERNEL::Exception)
3174 return self->simpleRepr();
3177 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3179 if(PyInt_Check(obj))
3181 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3186 else if(PyString_Check(obj))
3188 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3194 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3197 int __len__() const throw(INTERP_KERNEL::Exception)
3199 return self->getNumberOfParams();
3202 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3204 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3210 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3212 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3218 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3221 bool ret0=self->isEqual(other,eps,what);
3222 PyObject *res=PyList_New(2);
3223 PyObject *ret0Py=ret0?Py_True:Py_False;
3225 PyList_SetItem(res,0,ret0Py);
3226 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3232 class MEDFileData : public RefCountObject, public MEDFileWritable
3235 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3236 static MEDFileData *New();
3237 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3238 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3239 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3240 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3241 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3242 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3243 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3245 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3246 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3248 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3251 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3253 return MEDFileData::New(fileName);
3258 return MEDFileData::New();
3261 std::string __str__() const throw(INTERP_KERNEL::Exception)
3263 return self->simpleRepr();
3266 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3268 MEDFileMeshes *ret=self->getMeshes();
3274 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3276 MEDFileParameters *ret=self->getParams();
3282 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3284 MEDFileFields *ret=self->getFields();
3290 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3292 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3293 return self->changeMeshNames(modifTab);
3298 class SauvReader : public RefCountObject
3301 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3302 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3305 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3307 return SauvReader::New(fileName);
3312 class SauvWriter : public RefCountObject
3315 static SauvWriter * New();
3316 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3317 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3318 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3319 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3322 SauvWriter() throw(INTERP_KERNEL::Exception)
3324 return SauvWriter::New();
3331 class MEDFileMeshStruct;
3333 class MEDFileField1TSStructItem
3336 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3339 class MEDFileMeshStruct : public RefCountObject
3342 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3344 ~MEDFileMeshStruct();
3347 class MEDMeshMultiLev : public RefCountObject
3350 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3351 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3357 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3359 DataArrayInt *famIds(0);
3360 bool isWithoutCopy(false);
3361 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3362 PyObject *ret=PyTuple_New(2);
3363 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3365 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3366 PyTuple_SetItem(ret,1,ret1Py);
3370 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3372 DataArrayInt *numIds(0);
3373 bool isWithoutCopy(false);
3374 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3375 PyObject *ret=PyTuple_New(2);
3376 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3378 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3379 PyTuple_SetItem(ret,1,ret1Py);
3383 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3385 DataArrayInt *famIds(0);
3386 bool isWithoutCopy(false);
3387 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3388 PyObject *ret=PyTuple_New(2);
3389 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3391 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3392 PyTuple_SetItem(ret,1,ret1Py);
3396 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3398 DataArrayInt *numIds(0);
3399 bool isWithoutCopy(false);
3400 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3401 PyObject *ret=PyTuple_New(2);
3402 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3404 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3405 PyTuple_SetItem(ret,1,ret1Py);
3409 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3411 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3412 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3413 PyObject *res(PyList_New(result.size()));
3414 for(int i=0;iL!=result.end(); i++, iL++)
3415 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3421 class MEDUMeshMultiLev : public MEDMeshMultiLev
3424 ~MEDUMeshMultiLev();
3428 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3430 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3431 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3432 PyObject *ret0Py=ncc?Py_True:Py_False;
3434 PyObject *ret=PyTuple_New(7);
3435 PyTuple_SetItem(ret,0,ret0Py);
3436 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3437 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3438 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3439 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3440 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3441 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3447 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3450 ~MEDStructuredMeshMultiLev();
3453 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3456 ~MEDCMeshMultiLev();
3460 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3463 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3464 std::size_t sz(objs.size());
3465 PyObject *ret(PyTuple_New(2));
3466 PyObject *ret0=PyList_New(sz);
3467 for(std::size_t i=0;i<sz;i++)
3468 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3469 PyTuple_SetItem(ret,0,ret0);
3470 PyObject *ret1Py(isInternal?Py_True:Py_False);
3472 PyTuple_SetItem(ret,1,ret1Py);
3478 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3481 ~MEDCurveLinearMeshMultiLev();
3485 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3487 DataArrayDouble *ret0(0);
3488 std::vector<int> ret1;
3490 self->buildVTUArrays(ret0,ret1,ret2);
3491 std::size_t sz(ret1.size());
3492 PyObject *ret=PyTuple_New(3);
3493 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3494 PyObject *ret1Py=PyList_New(sz);
3495 for(std::size_t i=0;i<sz;i++)
3496 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3497 PyTuple_SetItem(ret,1,ret1Py);
3498 PyObject *ret2Py(ret2?Py_True:Py_False);
3500 PyTuple_SetItem(ret,2,ret2Py);
3506 class MEDFileFastCellSupportComparator : public RefCountObject
3509 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3510 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3511 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3512 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3514 ~MEDFileFastCellSupportComparator();
3518 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3520 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3521 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3522 PyObject *res(PyList_New(result.size()));
3523 for(int i=0;iL!=result.end(); i++, iL++)
3524 PyList_SetItem(res,i,PyInt_FromLong(*iL));