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 "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace ParaMEDMEM;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) ParaMEDMEM::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject MEDLoader::ReadUMeshFromFamilies;
79 %newobject MEDLoader::ReadUMeshFromGroups;
80 %newobject MEDLoader::ReadUMeshFromFile;
81 %newobject MEDLoader::ReadMeshFromFile;
82 %newobject MEDLoader::ReadField;
83 %newobject MEDLoader::ReadFieldCell;
84 %newobject MEDLoader::ReadFieldNode;
85 %newobject MEDLoader::ReadFieldGauss;
86 %newobject MEDLoader::ReadFieldGaussNE;
87 %newobject ParaMEDMEM::MEDFileMesh::New;
88 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
89 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
90 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
91 %newobject ParaMEDMEM::MEDFileMesh::getMeshAtLevel;
92 %newobject ParaMEDMEM::MEDFileMesh::__getitem__;
93 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
95 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
96 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
97 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
98 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
99 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
100 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
101 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject ParaMEDMEM::MEDFileMesh::getEquivalences;
104 %newobject ParaMEDMEM::MEDFileMesh::cartesianize;
105 %newobject ParaMEDMEM::MEDFileData::getJoints;
106 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::New;
108 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
109 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
110 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
111 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
112 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
113 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
114 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
115 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
116 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
117 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
118 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
119 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
123 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
124 %newobject ParaMEDMEM::MEDFileUMesh::linearToQuadratic;
125 %newobject ParaMEDMEM::MEDFileUMesh::quadraticToLinear;
126 %newobject ParaMEDMEM::MEDFileCMesh::New;
127 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
128 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
129 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
130 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
131 %newobject ParaMEDMEM::MEDFileMeshes::New;
132 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
133 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
134 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
135 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
136 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
138 %newobject ParaMEDMEM::MEDFileFields::New;
139 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
140 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
141 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
142 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
143 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
144 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
145 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
146 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
147 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
148 %newobject ParaMEDMEM::MEDFileFields::__iter__;
150 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
151 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
152 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
153 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
154 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
155 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
156 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
157 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
158 %newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
159 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
160 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
161 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
162 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
163 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
164 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
165 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
166 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
167 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
168 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
170 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
171 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
172 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
173 %newobject ParaMEDMEM::MEDFileField1TS::New;
174 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
175 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
176 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
177 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
178 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
179 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
180 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
181 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
182 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
184 %newobject ParaMEDMEM::MEDFileData::New;
185 %newobject ParaMEDMEM::MEDFileData::deepCpy;
186 %newobject ParaMEDMEM::MEDFileData::getMeshes;
187 %newobject ParaMEDMEM::MEDFileData::getFields;
188 %newobject ParaMEDMEM::MEDFileData::getParams;
190 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
191 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
192 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
193 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
194 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
195 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
196 %newobject ParaMEDMEM::MEDFileParameters::New;
197 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
198 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
199 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
200 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
202 %newobject ParaMEDMEM::MEDFileJointCorrespondence::New;
203 %newobject ParaMEDMEM::MEDFileJointCorrespondence::deepCpy;
204 %newobject ParaMEDMEM::MEDFileJointCorrespondence::shallowCpy;
205 %newobject ParaMEDMEM::MEDFileJointOneStep::New;
206 %newobject ParaMEDMEM::MEDFileJointOneStep::deepCpy;
207 %newobject ParaMEDMEM::MEDFileJointOneStep::shallowCpy;
208 %newobject ParaMEDMEM::MEDFileJoint::New;
209 %newobject ParaMEDMEM::MEDFileJoint::deepCpy;
210 %newobject ParaMEDMEM::MEDFileJoint::shallowCpy;
211 %newobject ParaMEDMEM::MEDFileJoints::New;
212 %newobject ParaMEDMEM::MEDFileJoints::deepCpy;
213 %newobject ParaMEDMEM::MEDFileJoints::getJointAtPos;
214 %newobject ParaMEDMEM::MEDFileJoints::getJointWithName;
215 %newobject ParaMEDMEM::MEDFileJoints::__getitem__;
216 %newobject ParaMEDMEM::MEDFileEquivalences::getEquivalence;
217 %newobject ParaMEDMEM::MEDFileEquivalences::getEquivalenceWithName;
218 %newobject ParaMEDMEM::MEDFileEquivalences::appendEmptyEquivalenceWithName;
219 %newobject ParaMEDMEM::MEDFileEquivalencePair::initCell;
220 %newobject ParaMEDMEM::MEDFileEquivalencePair::initNode;
221 %newobject ParaMEDMEM::MEDFileEquivalencePair::getCell;
222 %newobject ParaMEDMEM::MEDFileEquivalencePair::getNode;
223 %newobject ParaMEDMEM::MEDFileEquivalenceData::getArray;
224 %newobject ParaMEDMEM::MEDFileEquivalenceCell::getArray;
226 %newobject ParaMEDMEM::SauvWriter::New;
227 %newobject ParaMEDMEM::SauvReader::New;
228 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
230 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
231 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
232 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
233 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
234 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
236 %feature("unref") MEDFileMesh "$this->decrRef();"
237 %feature("unref") MEDFileUMesh "$this->decrRef();"
238 %feature("unref") MEDFileCMesh "$this->decrRef();"
239 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
240 %feature("unref") MEDFileMeshes "$this->decrRef();"
241 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
242 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
243 %feature("unref") MEDFileField1TS "$this->decrRef();"
244 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
245 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
246 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
247 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
248 %feature("unref") MEDFileFields "$this->decrRef();"
249 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
250 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
251 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
252 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
253 %feature("unref") MEDFileParameters "$this->decrRef();"
254 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
255 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
256 %feature("unref") MEDFileJoint "$this->decrRef();"
257 %feature("unref") MEDFileJoints "$this->decrRef();"
258 %feature("unref") MEDFileEquivalences "$this->decrRef();"
259 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
260 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
261 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
262 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
263 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
264 %feature("unref") MEDFileData "$this->decrRef();"
265 %feature("unref") SauvReader "$this->decrRef();"
266 %feature("unref") SauvWriter "$this->decrRef();"
267 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
268 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
269 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
270 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
271 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
272 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
277 static bool HasXDR();
278 static std::string MEDFileVersionStr();
279 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
280 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
281 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
282 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
283 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
284 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
285 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
286 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
287 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
288 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
289 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
290 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
291 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
292 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
293 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
294 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
295 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
298 static PyObject *MEDFileVersion()
300 int major,minor,release;
301 MEDLoader::MEDFileVersion(major,minor,release);
302 PyObject *ret(PyTuple_New(3));
303 PyTuple_SetItem(ret,0,SWIG_From_int(major));
304 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
305 PyTuple_SetItem(ret,2,SWIG_From_int(release));
309 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
311 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
312 PyObject *ret=PyList_New(res.size());
314 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
316 PyObject *elt=PyTuple_New(2);
317 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
318 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
319 PyList_SetItem(ret,rk,elt);
324 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
326 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
327 PyObject *ret=PyList_New(res.size());
329 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
331 PyObject *elt=PyTuple_New(3);
332 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
333 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
334 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
335 PyList_SetItem(ret,rk,elt);
340 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
342 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
343 PyObject *ret=PyList_New(res.size());
345 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
347 PyObject *elt=PyTuple_New(2);
348 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
349 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
350 PyList_SetItem(ret,rk,elt);
354 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
356 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
357 PyObject *ret=PyList_New(res.size());
359 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
361 PyObject *elt=PyTuple_New(2);
362 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
363 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
364 PyList_SetItem(ret,rk,elt);
368 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
370 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
371 PyObject *ret=PyList_New(res.size());
373 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
375 PyObject *elt=PyTuple_New(2);
376 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
377 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
378 PyList_SetItem(ret,rk,elt);
382 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
384 int meshDim,spaceDim,numberOfNodes;
385 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
386 PyObject *ret=PyTuple_New(4);
387 PyObject *elt0=PyList_New(res.size());
389 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
391 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
393 PyObject *elt1=PyList_New(obj2.size());
394 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
396 PyObject *elt2=PyTuple_New(2);
397 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
398 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
399 PyList_SetItem(elt1,j,elt2);
401 PyList_SetItem(elt0,i,elt1);
403 PyTuple_SetItem(ret,0,elt0);
404 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
405 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
406 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
409 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
410 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
412 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
413 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
414 return convertFieldDoubleVecToPy(res);
416 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
418 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
419 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
420 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
422 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
424 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
425 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
426 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
428 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
430 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
431 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
432 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
434 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
436 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
438 PyObject *ret=PyList_New(size);
439 for(int i=0;i<size;i++)
440 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
443 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
445 std::vector<std::string> grps;
446 converPyListToVecString(li,grps);
447 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
449 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
451 std::vector<std::string> fams;
452 converPyListToVecString(li,fams);
453 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
456 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
457 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
458 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
459 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
460 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
461 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);
462 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);
463 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);
464 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);
465 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);
466 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
467 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
468 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
469 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
470 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
471 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
476 class MEDFileWritable
479 void copyOptionsFrom(const MEDFileWritable& other) const;
480 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
481 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
482 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
483 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
486 class MEDFileMeshReadSelector
489 MEDFileMeshReadSelector();
490 MEDFileMeshReadSelector(unsigned int code);
491 unsigned int getCode() const;
492 void setCode(unsigned int newCode);
493 bool isCellFamilyFieldReading() const;
494 bool isNodeFamilyFieldReading() const;
495 bool isCellNameFieldReading() const;
496 bool isNodeNameFieldReading() const;
497 bool isCellNumFieldReading() const;
498 bool isNodeNumFieldReading() const;
499 void setCellFamilyFieldReading(bool b);
500 void setNodeFamilyFieldReading(bool b);
501 void setCellNameFieldReading(bool b);
502 void setNodeNameFieldReading(bool b);
503 void setCellNumFieldReading(bool b);
504 void setNodeNumFieldReading(bool b);
507 std::string __str__() const throw(INTERP_KERNEL::Exception)
509 std::ostringstream oss;
514 std::string __repr__() const throw(INTERP_KERNEL::Exception)
516 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
522 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
525 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
526 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
527 throw(INTERP_KERNEL::Exception);
528 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
529 INTERP_KERNEL::NormalizedCellType loc_geo_type,
530 INTERP_KERNEL::NormalizedCellType rem_geo_type)
531 throw(INTERP_KERNEL::Exception);
532 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
533 MEDFileJointCorrespondence *deepCpy() const;
534 MEDFileJointCorrespondence *shallowCpy() const;
535 void setIsNodal(bool isNodal);
536 bool getIsNodal() const;
537 bool isEqual(const MEDFileJointCorrespondence *other) const;
538 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
539 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
540 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
541 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
542 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
543 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
544 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);
545 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
548 MEDFileJointCorrespondence()
550 return MEDFileJointCorrespondence::New();
552 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
554 return MEDFileJointCorrespondence::New(correspondence);
556 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
557 INTERP_KERNEL::NormalizedCellType loc_geo_type,
558 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
560 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
563 std::string __str__() const throw(INTERP_KERNEL::Exception)
565 return self->simpleRepr();
570 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
573 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
574 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
575 MEDFileJointOneStep *deepCpy() const;
576 MEDFileJointOneStep *shallowCpy() const;
577 bool isEqual(const MEDFileJointOneStep *other) const;
578 void setOrder(int order);
579 int getOrder() const;
580 void setIteration(int it);
581 int getIteration() const;
582 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
583 int getNumberOfCorrespondences() const;
584 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
585 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
586 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
589 MEDFileJointOneStep()
591 return MEDFileJointOneStep::New();
594 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
596 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
599 std::string __str__() const throw(INTERP_KERNEL::Exception)
601 return self->simpleRepr();
606 class MEDFileJoint : public RefCountObject, public MEDFileWritable
609 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
610 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
611 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
612 MEDFileJoint *deepCpy() const;
613 MEDFileJoint *shallowCpy() const;
614 bool isEqual(const MEDFileJoint *other) const;
615 void setLocalMeshName(const std::string& name);
616 std::string getLocalMeshName() const;
617 void setRemoteMeshName(const std::string& name);
618 std::string getRemoteMeshName() const;
619 void setDescription(const std::string& name);
620 std::string getDescription() const;
621 void setJointName(const std::string& name);
622 std::string getJointName() const;
623 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
624 void setDomainNumber(const int& number);
625 int getDomainNumber() const;
626 void pushStep(MEDFileJointOneStep* step);
627 int getNumberOfSteps() const;
628 MEDFileJointOneStep *getStepAtPos(int i) const;
629 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
630 std::string simpleRepr() const;
635 return MEDFileJoint::New();
638 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
640 return MEDFileJoint::New(fileName,mName,num);
643 std::string __str__() const throw(INTERP_KERNEL::Exception)
645 return self->simpleRepr();
650 class MEDFileJoints : public RefCountObject, public MEDFileWritable
653 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
654 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
655 MEDFileJoints *deepCpy() const;
656 std::string simpleRepr() const;
657 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
658 std::string getMeshName() const;
659 int getNumberOfJoints() const;
660 std::vector<std::string> getJointsNames() const;
661 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
662 void resize(int newSize) throw(INTERP_KERNEL::Exception);
663 void pushJoint(MEDFileJoint *joint);
664 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
665 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
670 return MEDFileJoints::New();
673 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
675 return MEDFileJoints::New(fileName,meshName);
678 std::string __str__() const throw(INTERP_KERNEL::Exception)
680 return self->simpleRepr();
683 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
687 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
692 else if(PyString_Check(obj))
694 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
700 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
703 int __len__() const throw(INTERP_KERNEL::Exception)
705 return self->getNumberOfJoints();
708 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
710 MEDFileJoint *ret=self->getJointAtPos(i);
716 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
718 MEDFileJoint *ret=self->getJointWithName(paramName);
726 class MEDFileEquivalenceBase : public RefCountObject
729 MEDFileEquivalenceBase();
732 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
735 MEDFileEquivalenceData();
737 void setArray(DataArrayInt *data);
740 DataArrayInt *getArray()
742 DataArrayInt *ret(self->getArray());
743 if(ret) ret->incrRef();
749 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
752 MEDFileEquivalenceNode();
755 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
758 MEDFileEquivalenceCell();
761 std::size_t size() const;
762 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
763 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
766 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
768 DataArrayInt *ret(self->getArray(type));
769 if(ret) ret->incrRef();
773 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
775 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
776 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
777 PyObject *res=PyList_New(result.size());
778 for(int i=0;iL!=result.end(); i++, iL++)
779 PyList_SetItem(res,i,PyInt_FromLong(*iL));
785 class MEDFileEquivalencePair : public RefCountObject
788 MEDFileEquivalencePair();
790 std::string getName() const;
791 void setName(const std::string& name);
792 std::string getDescription() const;
793 void setDescription(const std::string& descr);
794 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
797 MEDFileEquivalenceCell *initCell()
799 MEDFileEquivalenceCell *ret(self->initCell());
800 if(ret) ret->incrRef();
804 MEDFileEquivalenceNode *initNode()
806 MEDFileEquivalenceNode *ret(self->initNode());
807 if(ret) ret->incrRef();
811 MEDFileEquivalenceCell *getCell()
813 MEDFileEquivalenceCell *ret(self->getCell());
814 if(ret) ret->incrRef();
818 MEDFileEquivalenceNode *getNode()
820 MEDFileEquivalenceNode *ret(self->getNode());
821 if(ret) ret->incrRef();
827 class MEDFileEquivalences : public RefCountObject
830 MEDFileEquivalences();
833 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
834 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
835 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
839 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
841 MEDFileEquivalencePair *ret(self->getEquivalence(i));
842 if(ret) ret->incrRef();
845 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
847 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
848 if(ret) ret->incrRef();
852 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
854 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
855 if(ret) ret->incrRef();
861 class MEDFileMesh : public RefCountObject, public MEDFileWritable
864 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
865 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
866 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
867 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
868 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
869 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
870 void setName(const std::string& name);
871 std::string getName();
872 std::string getUnivName() const;
873 bool getUnivNameWrStatus() const;
874 void setUnivNameWrStatus(bool newStatus);
875 void setDescription(const std::string& name);
876 std::string getDescription() const;
877 void setOrder(int order);
878 int getOrder() const;
879 void setIteration(int it);
881 void setTimeValue(double time);
882 void setTime(int dt, int it, double time);
883 double getTimeValue() const;
884 void setTimeUnit(const std::string& unit);
885 std::string getTimeUnit() const;
886 void setAxType(MEDCouplingAxisType at);
887 MEDCouplingAxisType getAxType() const;
888 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
889 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
890 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
891 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
892 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
893 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
894 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
895 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
896 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
897 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
898 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
899 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
900 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
901 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
902 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
904 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
905 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
906 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
907 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
908 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
909 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
910 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
911 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
912 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
913 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
914 void clearGrpMap() throw(INTERP_KERNEL::Exception);
915 void clearFamMap() throw(INTERP_KERNEL::Exception);
916 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
917 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
918 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
919 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
920 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
921 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
922 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
923 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
924 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
925 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
926 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
927 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
928 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
929 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
930 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
931 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
932 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
933 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
934 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
935 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
936 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
937 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
938 static std::string GetMagicFamilyStr();
939 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
940 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
941 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
942 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
943 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
944 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
945 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
946 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
947 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
948 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
949 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
950 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
951 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
952 void setFamilyInfo(const std::map<std::string,int>& info);
953 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
954 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
955 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
956 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
957 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
958 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
959 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
960 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
961 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
962 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
963 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
964 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
965 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
966 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
967 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
968 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
969 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
970 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
971 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
972 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
973 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
975 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
976 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
977 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
978 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
979 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
980 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
981 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
982 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
983 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
984 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
985 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
986 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
987 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
988 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
989 int getNumberOfJoints();
990 MEDFileJoints *getJoints();
991 void setJoints( MEDFileJoints* joints );
992 void initializeEquivalences();
993 void killEquivalences();
996 std::string __str__() const throw(INTERP_KERNEL::Exception)
998 return self->simpleRepr();
1001 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1003 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1006 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1009 double tmp0=self->getTime(tmp1,tmp2);
1010 PyObject *res = PyList_New(3);
1011 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1012 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1013 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1017 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1020 bool ret0=self->isEqual(other,eps,what);
1021 PyObject *res=PyList_New(2);
1022 PyObject *ret0Py=ret0?Py_True:Py_False;
1024 PyList_SetItem(res,0,ret0Py);
1025 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1029 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1031 std::vector<const DataArrayInt *> grps;
1032 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
1033 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1036 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1039 bool ret0=self->areFamsEqual(other,what);
1040 PyObject *res=PyList_New(2);
1041 PyObject *ret0Py=ret0?Py_True:Py_False;
1043 PyList_SetItem(res,0,ret0Py);
1044 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1048 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1051 bool ret0=self->areGrpsEqual(other,what);
1052 PyObject *res=PyList_New(2);
1053 PyObject *ret0Py=ret0?Py_True:Py_False;
1055 PyList_SetItem(res,0,ret0Py);
1056 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1060 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1062 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1063 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1064 PyObject *res=PyList_New(result.size());
1065 for(int i=0;iL!=result.end(); i++, iL++)
1066 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1070 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1072 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1073 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1074 PyObject *res=PyList_New(result.size());
1075 for(int i=0;iL!=result.end(); i++, iL++)
1076 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1080 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1082 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1085 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1088 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1090 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1093 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1096 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1098 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1101 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1104 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1106 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1109 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1112 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1114 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1117 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1120 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1123 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1124 PyObject *ret=PyTuple_New(2);
1125 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1126 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1130 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1132 DataArrayInt *ret3=0;
1133 std::vector<int> ret1,ret2;
1134 bool ret0=self->unPolyze(ret1,ret2,ret3);
1135 PyObject *ret=PyTuple_New(4);
1136 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1138 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1139 for(int j=0;j<(int)ret1.size()/3;j++)
1141 PyObject *retLev2=PyList_New(3);
1142 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1143 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1144 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1145 PyList_SetItem(retLev1_0,j,retLev2);
1147 PyTuple_SetItem(ret,1,retLev1_0);
1149 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1150 for(int j=0;j<(int)ret2.size()/3;j++)
1152 PyObject *retLev2=PyList_New(3);
1153 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1154 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1155 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1156 PyList_SetItem(retLev1_1,j,retLev2);
1158 PyTuple_SetItem(ret,2,retLev1_1);
1160 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1164 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1166 MEDFileEquivalences *ret(self->getEquivalences());
1167 if(ret) ret->incrRef();
1173 class MEDFileUMesh : public MEDFileMesh
1176 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1177 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1178 static MEDFileUMesh *New();
1180 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1181 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1183 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1184 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1185 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1186 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1187 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1188 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1189 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1190 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1191 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1192 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1194 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1195 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1196 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1197 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1198 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1199 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1200 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1201 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1202 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1203 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1204 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1205 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1206 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1209 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1211 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1214 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1216 return MEDFileUMesh::New(fileName,mrs);
1221 return MEDFileUMesh::New();
1225 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1227 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1230 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)
1232 std::vector<int> typesCpp1;
1233 convertPyToNewIntArr3(types,typesCpp1);
1234 std::size_t sz(typesCpp1.size());
1235 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1236 for(std::size_t ii=0;ii<sz;ii++)
1237 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1238 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1241 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1242 {// put an empty dict in input to say to __new__ to call __init__...
1243 PyObject *ret(PyTuple_New(1));
1244 PyObject *ret0(PyDict_New());
1245 PyTuple_SetItem(ret,0,ret0);
1249 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1251 std::vector<double> a0;
1252 std::vector<int> a1;
1253 std::vector<std::string> a2;
1254 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1255 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1256 self->serialize(a0,a1,a2,a3,a4);
1257 PyObject *ret(PyTuple_New(5));
1258 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1259 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1261 PyObject *ret2(PyList_New(sz));
1262 for(int i=0;i<sz;i++)
1263 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1264 PyTuple_SetItem(ret,2,ret2);
1266 PyObject *ret3(PyList_New(sz));
1267 for(int i=0;i<sz;i++)
1269 DataArrayInt *elt(a3[i]);
1272 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1274 PyTuple_SetItem(ret,3,ret3);
1275 DataArrayDouble *ret4(a4);
1278 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1282 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1284 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1285 if(!PyTuple_Check(inp))
1286 throw INTERP_KERNEL::Exception(MSG);
1287 int sz(PyTuple_Size(inp));
1289 throw INTERP_KERNEL::Exception(MSG);
1290 std::vector<double> a0;
1291 std::vector<int> a1;
1292 std::vector<std::string> a2;
1293 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1294 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1296 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1298 fillArrayWithPyListDbl3(a0py,tmp,a0);
1299 convertPyToNewIntArr3(a1py,a1);
1300 fillStringVector(a2py,a2);
1302 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1304 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1305 if(!SWIG_IsOK(status))
1306 throw INTERP_KERNEL::Exception(MSG);
1307 a4=reinterpret_cast<DataArrayDouble *>(argp);
1308 if((DataArrayDouble *)a4)
1311 std::vector< DataArrayInt * > a3Tmp;
1312 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1313 std::size_t sz(a3Tmp.size());
1315 for(std::size_t i=0;i<sz;i++)
1319 a3Tmp[i]->incrRef();
1321 self->unserialize(a0,a1,a2,a3,a4);
1325 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1328 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1329 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1332 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1335 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1338 self->setMeshAtLevel(meshDimRelToMax,m1);
1341 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1344 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1346 self->removeMeshAtLevel(meshDimRelToMax);
1349 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1351 std::vector<const MEDCouplingUMesh *> ms;
1352 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1353 self->setMeshes(ms,renum);
1356 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1358 std::vector<const MEDCouplingUMesh *> ms;
1359 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1360 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1363 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1365 std::vector<const MEDCouplingUMesh *> ms;
1366 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1367 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1370 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1372 DataArrayDouble *ret=self->getCoords();
1378 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1380 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1383 return const_cast<PartDefinition *>(ret);
1386 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1388 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1389 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1390 PyObject *ret=PyTuple_New(3);
1391 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1392 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1393 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1397 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1399 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1405 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1407 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1408 std::size_t sz(tmp.size());
1409 PyObject *ret=PyList_New(sz);
1410 for(std::size_t i=0;i<sz;i++)
1414 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1421 class MEDFileStructuredMesh : public MEDFileMesh
1426 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1428 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1436 class MEDFileCMesh : public MEDFileStructuredMesh
1439 static MEDFileCMesh *New();
1440 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1441 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1442 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1443 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1448 return MEDFileCMesh::New();
1451 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1453 return MEDFileCMesh::New(fileName,mrs);
1456 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1458 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1461 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1463 const MEDCouplingCMesh *tmp=self->getMesh();
1466 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1471 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1474 static MEDFileCurveLinearMesh *New();
1475 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1476 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1477 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1480 MEDFileCurveLinearMesh()
1482 return MEDFileCurveLinearMesh::New();
1485 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1487 return MEDFileCurveLinearMesh::New(fileName,mrs);
1490 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1492 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1495 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1497 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1500 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1505 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1508 static MEDFileMeshMultiTS *New();
1509 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1510 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1511 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1512 std::string getName() const throw(INTERP_KERNEL::Exception);
1513 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1514 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1515 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1518 MEDFileMeshMultiTS()
1520 return MEDFileMeshMultiTS::New();
1523 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1525 return MEDFileMeshMultiTS::New(fileName);
1528 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1530 return MEDFileMeshMultiTS::New(fileName,mName);
1533 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1535 MEDFileMesh *ret=self->getOneTimeStep();
1543 class MEDFileMeshesIterator
1548 PyObject *next() throw(INTERP_KERNEL::Exception)
1550 MEDFileMesh *ret=self->nextt();
1554 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1558 PyErr_SetString(PyExc_StopIteration,"No more data.");
1565 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1568 static MEDFileMeshes *New();
1569 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1570 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1571 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1572 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1573 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1575 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1576 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1577 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1578 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1579 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1584 return MEDFileMeshes::New();
1587 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1589 return MEDFileMeshes::New(fileName);
1592 std::string __str__() const throw(INTERP_KERNEL::Exception)
1594 return self->simpleRepr();
1597 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1599 if(PyInt_Check(obj))
1601 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1606 else if(PyString_Check(obj))
1608 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1614 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1617 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1619 self->setMeshAtPos(obj,mesh);
1623 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1625 return self->iterator();
1628 int __len__() const throw(INTERP_KERNEL::Exception)
1630 return self->getNumberOfMeshes();
1633 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1635 MEDFileMesh *ret=self->getMeshAtPos(i);
1640 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1642 MEDFileMesh *ret=self->getMeshWithName(mname);
1650 class MEDFileFieldLoc : public RefCountObject
1653 std::string getName() const;
1654 int getDimension() const;
1655 int getNumberOfGaussPoints() const;
1656 int getNumberOfPointsInCells() const;
1657 const std::vector<double>& getRefCoords() const;
1658 const std::vector<double>& getGaussCoords() const;
1659 const std::vector<double>& getGaussWeights() const;
1660 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1663 std::string __str__() const throw(INTERP_KERNEL::Exception)
1665 return self->repr();
1670 class MEDFileFieldGlobsReal
1673 void resetContent();
1674 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1675 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1676 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1677 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1678 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1679 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1680 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1681 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1682 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1683 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1684 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1685 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1686 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1687 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1688 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1689 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1690 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1691 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1692 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1693 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1694 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1695 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1696 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1697 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1698 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1699 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1702 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1704 const DataArrayInt *ret=self->getProfile(pflName);
1707 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1710 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1712 const DataArrayInt *ret=self->getProfileFromId(pflId);
1715 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1718 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1720 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1723 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1726 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1728 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1731 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1734 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1736 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1737 return convertVecPairVecStToPy(ret);
1740 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1742 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1743 return convertVecPairVecStToPy(ret);
1746 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1748 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1749 self->changePflsNames(v);
1752 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1754 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1755 self->changePflsRefsNamesGen(v);
1758 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1760 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1761 self->changePflsNamesInStruct(v);
1764 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1766 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1767 self->changeLocsNames(v);
1770 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1772 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1773 self->changeLocsRefsNamesGen(v);
1776 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1778 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1779 self->changeLocsNamesInStruct(v);
1782 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1784 std::ostringstream oss;
1785 self->simpleReprGlobs(oss);
1791 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1794 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1795 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1796 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1797 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1798 void loadArrays() throw(INTERP_KERNEL::Exception);
1799 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1800 void unloadArrays() throw(INTERP_KERNEL::Exception);
1801 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1802 int getDimension() const throw(INTERP_KERNEL::Exception);
1803 int getIteration() const throw(INTERP_KERNEL::Exception);
1804 int getOrder() const throw(INTERP_KERNEL::Exception);
1805 std::string getName() throw(INTERP_KERNEL::Exception);
1806 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1807 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1808 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1809 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1810 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1811 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1812 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1813 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1814 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1815 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1816 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1817 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1818 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1819 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1820 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1823 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1826 double tmp0=self->getTime(tmp1,tmp2);
1827 PyObject *res = PyList_New(3);
1828 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1829 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1830 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1834 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1836 std::pair<int,int> res=self->getDtIt();
1837 PyObject *elt=PyTuple_New(2);
1838 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1839 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1843 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1845 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1848 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1850 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1853 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1855 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1856 return self->changeMeshNames(modifTab);
1859 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1861 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1862 PyObject *ret2=PyList_New(ret.size());
1863 for(int i=0;i<(int)ret.size();i++)
1864 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1868 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1870 std::vector<int> ret1;
1871 int ret0=self->getNonEmptyLevels(mname,ret1);
1872 PyObject *elt=PyTuple_New(2);
1873 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1874 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1878 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1880 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1881 std::vector< std::vector<TypeOfField> > typesF;
1882 std::vector< std::vector<std::string> > pfls;
1883 std::vector< std::vector<std::string> > locs;
1884 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1886 PyObject *ret2=PyList_New(sz);
1887 for(int i=0;i<sz;i++)
1889 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1890 const std::vector<TypeOfField>& typesFI=typesF[i];
1891 const std::vector<std::string>& pflsI=pfls[i];
1892 const std::vector<std::string>& locsI=locs[i];
1893 PyObject *elt=PyTuple_New(2);
1894 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1895 int sz2=ret[i].size();
1896 PyObject *elt2=PyList_New(sz2);
1897 for(int j=0;j<sz2;j++)
1899 PyObject *elt3=PyTuple_New(4);
1900 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1901 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));
1902 PyTuple_SetItem(elt3,1,elt4);
1903 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1904 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1905 PyList_SetItem(elt2,j,elt3);
1907 PyTuple_SetItem(elt,1,elt2);
1908 PyList_SetItem(ret2,i,elt);
1913 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1915 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1916 std::size_t sz=ret.size();
1917 PyObject *retPy=PyList_New(sz);
1918 for(std::size_t i=0;i<sz;i++)
1919 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1923 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1925 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1926 std::size_t sz=ret.size();
1927 PyObject *retPy=PyList_New(sz);
1928 for(std::size_t i=0;i<sz;i++)
1929 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1933 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1935 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1936 std::size_t sz=ret.size();
1937 PyObject *retPy=PyList_New(sz);
1938 for(std::size_t i=0;i<sz;i++)
1939 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1945 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1948 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1949 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1950 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1951 static MEDFileField1TS *New();
1952 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1953 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1954 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1955 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1956 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1957 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1959 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1960 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1961 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1962 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1965 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1967 return MEDFileField1TS::New(fileName,loadAll);
1970 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1972 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1975 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1977 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1982 return MEDFileField1TS::New();
1985 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1987 const DataArrayDouble *arr=0;
1989 arr=field->getArray();
1990 self->copyTinyInfoFrom(field,arr);
1993 std::string __str__() const throw(INTERP_KERNEL::Exception)
1995 return self->simpleRepr();
1998 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2000 DataArrayInt *ret1=0;
2001 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2002 PyObject *ret=PyTuple_New(2);
2003 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2004 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2008 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2010 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2011 std::vector< std::vector<TypeOfField> > typesF;
2012 std::vector< std::vector<std::string> > pfls;
2013 std::vector< std::vector<std::string> > locs;
2014 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2016 PyObject *ret2=PyList_New(sz);
2017 for(int i=0;i<sz;i++)
2019 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2020 const std::vector<TypeOfField>& typesFI=typesF[i];
2021 const std::vector<std::string>& pflsI=pfls[i];
2022 const std::vector<std::string>& locsI=locs[i];
2023 PyObject *elt=PyTuple_New(2);
2024 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2025 int sz2=ret[i].size();
2026 PyObject *elt2=PyList_New(sz2);
2027 for(int j=0;j<sz2;j++)
2029 PyObject *elt3=PyTuple_New(4);
2030 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2031 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2032 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2033 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2034 PyList_SetItem(elt2,j,elt3);
2036 PyTuple_SetItem(elt,1,elt2);
2037 PyList_SetItem(ret2,i,elt);
2042 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2044 DataArrayDouble *ret=self->getUndergroundDataArray();
2050 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2052 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2053 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2056 PyObject *ret=PyTuple_New(2);
2057 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2058 std::size_t sz=elt1Cpp.size();
2059 PyObject *elt=PyList_New(sz);
2060 for(std::size_t i=0;i<sz;i++)
2062 PyObject *elt1=PyTuple_New(2);
2063 PyObject *elt2=PyTuple_New(2);
2064 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2065 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2066 PyObject *elt3=PyTuple_New(2);
2067 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2068 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2069 PyTuple_SetItem(elt1,0,elt2);
2070 PyTuple_SetItem(elt1,1,elt3);
2071 PyList_SetItem(elt,i,elt1);
2073 PyTuple_SetItem(ret,1,elt);
2079 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2082 static MEDFileIntField1TS *New();
2083 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2084 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2085 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2086 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2088 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2089 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2092 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2094 return MEDFileIntField1TS::New();
2097 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2099 return MEDFileIntField1TS::New(fileName,loadAll);
2102 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2104 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2107 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2109 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2112 std::string __str__() const throw(INTERP_KERNEL::Exception)
2114 return self->simpleRepr();
2117 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2119 DataArrayInt *ret1=0;
2120 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2121 PyObject *ret=PyTuple_New(2);
2122 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2123 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2127 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2129 DataArrayInt *ret1=0;
2130 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2131 PyObject *ret=PyTuple_New(2);
2132 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2133 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2137 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2139 DataArrayInt *ret1=0;
2140 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2141 PyObject *ret=PyTuple_New(2);
2142 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2143 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2147 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2149 DataArrayInt *ret1=0;
2150 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2151 PyObject *ret=PyTuple_New(2);
2152 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2153 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2157 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2159 DataArrayInt *ret1=0;
2160 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2161 PyObject *ret=PyTuple_New(2);
2162 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2163 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2167 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2169 DataArrayInt *ret1=0;
2170 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2171 PyObject *ret=PyTuple_New(2);
2172 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2179 DataArrayInt *ret=self->getUndergroundDataArray();
2187 class MEDFileAnyTypeFieldMultiTSIterator
2192 PyObject *next() throw(INTERP_KERNEL::Exception)
2194 MEDFileAnyTypeField1TS *ret=self->nextt();
2196 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2199 PyErr_SetString(PyExc_StopIteration,"No more data.");
2206 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2209 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2210 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2211 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2212 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2213 std::string getName() const throw(INTERP_KERNEL::Exception);
2214 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2215 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2216 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2217 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2218 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2219 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2220 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2221 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2222 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2223 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2224 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2225 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2226 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2227 void loadArrays() throw(INTERP_KERNEL::Exception);
2228 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2229 void unloadArrays() throw(INTERP_KERNEL::Exception);
2230 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2232 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2233 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2234 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2235 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2236 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2239 int __len__() const throw(INTERP_KERNEL::Exception)
2241 return self->getNumberOfTS();
2244 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2246 if(elt0 && PyInt_Check(elt0))
2248 int pos=PyInt_AS_LONG(elt0);
2251 else if(elt0 && PyTuple_Check(elt0))
2253 if(PyTuple_Size(elt0)==2)
2255 PyObject *o0=PyTuple_GetItem(elt0,0);
2256 PyObject *o1=PyTuple_GetItem(elt0,1);
2257 if(PyInt_Check(o0) && PyInt_Check(o1))
2259 int iter=PyInt_AS_LONG(o0);
2260 int order=PyInt_AS_LONG(o1);
2261 return self->getPosOfTimeStep(iter,order);
2264 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 !");
2267 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 !");
2269 else if(elt0 && PyFloat_Check(elt0))
2271 double val=PyFloat_AS_DOUBLE(elt0);
2272 return self->getPosGivenTime(val);
2275 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2278 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2280 std::vector< std::pair<int,int> > res=self->getIterations();
2281 PyObject *ret=PyList_New(res.size());
2283 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2285 PyObject *elt=PyTuple_New(2);
2286 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2287 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2288 PyList_SetItem(ret,rk,elt);
2293 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2295 std::vector<double> ret1;
2296 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2297 std::size_t sz=ret.size();
2298 PyObject *ret2=PyList_New(sz);
2299 for(std::size_t i=0;i<sz;i++)
2301 PyObject *elt=PyTuple_New(3);
2302 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2303 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2304 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2305 PyList_SetItem(ret2,i,elt);
2310 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2312 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2313 PyObject *ret2=PyList_New(ret.size());
2314 for(int i=0;i<(int)ret.size();i++)
2316 const std::vector<TypeOfField>& rett=ret[i];
2317 PyObject *ret3=PyList_New(rett.size());
2318 for(int j=0;j<(int)rett.size();j++)
2319 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2320 PyList_SetItem(ret2,i,ret3);
2325 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2327 std::vector<int> ret1;
2328 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2329 PyObject *elt=PyTuple_New(2);
2330 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2331 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2335 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2337 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2338 std::vector< std::vector<TypeOfField> > typesF;
2339 std::vector< std::vector<std::string> > pfls;
2340 std::vector< std::vector<std::string> > locs;
2341 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2343 PyObject *ret2=PyList_New(sz);
2344 for(int i=0;i<sz;i++)
2346 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2347 const std::vector<TypeOfField>& typesFI=typesF[i];
2348 const std::vector<std::string>& pflsI=pfls[i];
2349 const std::vector<std::string>& locsI=locs[i];
2350 PyObject *elt=PyTuple_New(2);
2351 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2352 int sz2=ret[i].size();
2353 PyObject *elt2=PyList_New(sz2);
2354 for(int j=0;j<sz2;j++)
2356 PyObject *elt3=PyTuple_New(4);
2357 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2358 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));
2359 PyTuple_SetItem(elt3,1,elt4);
2360 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2361 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2362 PyList_SetItem(elt2,j,elt3);
2364 PyTuple_SetItem(elt,1,elt2);
2365 PyList_SetItem(ret2,i,elt);
2370 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2372 if(PyList_Check(elts))
2374 int sz=PyList_Size(elts);
2375 std::vector<int> ret(sz);
2376 for(int i=0;i<sz;i++)
2378 PyObject *elt=PyList_GetItem(elts,i);
2379 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2385 std::vector<int> ret(1);
2386 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2391 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2393 if(PySlice_Check(elts))
2395 Py_ssize_t strt=2,stp=2,step=2;
2396 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2397 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2398 self->eraseTimeStepIds2(strt,stp,step);
2402 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2403 if(!idsToRemove.empty())
2404 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2408 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2412 std::vector<int> pos2;
2413 DataArrayInt *pos3=0;
2414 DataArrayIntTuple *pos4=0;
2415 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2420 self->eraseTimeStepIds(&pos1,&pos1+1);
2427 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2432 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2436 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2440 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2442 return self->iterator();
2445 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2447 if(elt0 && PyList_Check(elt0))
2449 int sz=PyList_Size(elt0);
2450 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2451 int *pt=da->getPointer();
2452 for(int i=0;i<sz;i++,pt++)
2454 PyObject *elt1=PyList_GetItem(elt0,i);
2455 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2457 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2459 else if(elt0 && PySlice_Check(elt0))
2461 Py_ssize_t strt=2,stp=2,step=2;
2462 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2463 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2464 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2467 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2470 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2472 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2473 return self->changeMeshNames(modifTab);
2476 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2478 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2479 std::size_t sz=ret.size();
2480 PyObject *retPy=PyList_New(sz);
2481 for(std::size_t i=0;i<sz;i++)
2482 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2486 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2488 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2489 std::size_t sz=ret.size();
2490 PyObject *retPy=PyList_New(sz);
2491 for(std::size_t i=0;i<sz;i++)
2492 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2496 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2498 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2499 std::size_t sz=ret.size();
2500 PyObject *retPy=PyList_New(sz);
2501 for(std::size_t i=0;i<sz;i++)
2502 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2506 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2509 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2510 if(SWIG_IsOK(status))
2512 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2516 std::vector<MEDFileAnyTypeField1TS *> tmp;
2517 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2518 self->pushBackTimeSteps(tmp);
2522 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2524 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2525 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2526 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2527 std::size_t sz=ret.size();
2528 PyObject *retPy=PyList_New(sz);
2529 for(std::size_t i=0;i<sz;i++)
2531 std::size_t sz2=ret[i].size();
2532 PyObject *ret1Py=PyList_New(sz2);
2533 for(std::size_t j=0;j<sz2;j++)
2535 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2538 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2540 PyList_SetItem(retPy,i,ret1Py);
2545 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2547 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2548 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2549 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2550 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2551 if(ret2.size()!=ret.size())
2553 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2554 throw INTERP_KERNEL::Exception(oss.str().c_str());
2556 std::size_t sz=ret.size();
2557 PyObject *retPy=PyList_New(sz);
2558 for(std::size_t i=0;i<sz;i++)
2560 std::size_t sz2=ret[i].size();
2561 PyObject *ret0Py=PyTuple_New(2);
2562 PyObject *ret1Py=PyList_New(sz2);
2563 for(std::size_t j=0;j<sz2;j++)
2565 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2568 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2570 PyTuple_SetItem(ret0Py,0,ret1Py);
2571 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2572 PyList_SetItem(retPy,i,ret0Py);
2579 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2582 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2583 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2584 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2586 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2587 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2588 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2589 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2590 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2592 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2593 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2594 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2597 MEDFileFieldMultiTS()
2599 return MEDFileFieldMultiTS::New();
2602 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2604 return MEDFileFieldMultiTS::New(fileName,loadAll);
2607 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2609 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2612 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2614 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2615 std::size_t sz(tmp.size());
2616 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2617 for(std::size_t i=0;i<sz;i++)
2619 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2620 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2622 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2625 std::string __str__() const throw(INTERP_KERNEL::Exception)
2627 return self->simpleRepr();
2630 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2632 DataArrayInt *ret1=0;
2633 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2634 PyObject *ret=PyTuple_New(2);
2635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2642 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2643 std::vector< std::vector<TypeOfField> > typesF;
2644 std::vector< std::vector<std::string> > pfls;
2645 std::vector< std::vector<std::string> > locs;
2646 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2648 PyObject *ret2=PyList_New(sz);
2649 for(int i=0;i<sz;i++)
2651 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2652 const std::vector<TypeOfField>& typesFI=typesF[i];
2653 const std::vector<std::string>& pflsI=pfls[i];
2654 const std::vector<std::string>& locsI=locs[i];
2655 PyObject *elt=PyTuple_New(2);
2656 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2657 int sz2=ret[i].size();
2658 PyObject *elt2=PyList_New(sz2);
2659 for(int j=0;j<sz2;j++)
2661 PyObject *elt3=PyTuple_New(4);
2662 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2663 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2664 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2665 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2666 PyList_SetItem(elt2,j,elt3);
2668 PyTuple_SetItem(elt,1,elt2);
2669 PyList_SetItem(ret2,i,elt);
2673 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2675 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2681 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2683 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2684 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2687 PyObject *ret=PyTuple_New(2);
2688 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2689 std::size_t sz=elt1Cpp.size();
2690 PyObject *elt=PyList_New(sz);
2691 for(std::size_t i=0;i<sz;i++)
2693 PyObject *elt1=PyTuple_New(2);
2694 PyObject *elt2=PyTuple_New(2);
2695 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2696 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2697 PyObject *elt3=PyTuple_New(2);
2698 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2699 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2700 PyTuple_SetItem(elt1,0,elt2);
2701 PyTuple_SetItem(elt1,1,elt3);
2702 PyList_SetItem(elt,i,elt1);
2704 PyTuple_SetItem(ret,1,elt);
2710 class MEDFileFieldsIterator
2715 PyObject *next() throw(INTERP_KERNEL::Exception)
2717 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2719 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2722 PyErr_SetString(PyExc_StopIteration,"No more data.");
2729 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2732 static MEDFileIntFieldMultiTS *New();
2733 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2734 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2736 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2737 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2738 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2741 MEDFileIntFieldMultiTS()
2743 return MEDFileIntFieldMultiTS::New();
2746 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2748 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2751 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2753 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2756 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2758 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2759 std::size_t sz(tmp.size());
2760 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2761 for(std::size_t i=0;i<sz;i++)
2763 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2764 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2766 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2769 std::string __str__() const throw(INTERP_KERNEL::Exception)
2771 return self->simpleRepr();
2774 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2776 DataArrayInt *ret1=0;
2777 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2778 PyObject *ret=PyTuple_New(2);
2779 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2780 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2784 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2786 DataArrayInt *ret1=0;
2787 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2788 PyObject *ret=PyTuple_New(2);
2789 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2790 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2794 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2796 DataArrayInt *ret1=0;
2797 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2798 PyObject *ret=PyTuple_New(2);
2799 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2800 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2804 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2806 DataArrayInt *ret1=0;
2807 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2808 PyObject *ret=PyTuple_New(2);
2809 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2810 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2814 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2816 DataArrayInt *ret1=0;
2817 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2818 PyObject *ret=PyTuple_New(2);
2819 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2820 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2824 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2826 DataArrayInt *ret1=0;
2827 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2828 PyObject *ret=PyTuple_New(2);
2829 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2830 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2834 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2836 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2844 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2847 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2848 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2849 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2850 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2851 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2852 void loadArrays() throw(INTERP_KERNEL::Exception);
2853 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2854 void unloadArrays() throw(INTERP_KERNEL::Exception);
2855 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2856 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2857 int getNumberOfFields() const;
2858 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2859 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2861 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2862 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2863 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2864 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2865 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2866 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2867 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2868 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2869 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2874 return MEDFileFields::New();
2877 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2879 return MEDFileFields::New(fileName,loadAll);
2882 std::string __str__() const throw(INTERP_KERNEL::Exception)
2884 return self->simpleRepr();
2887 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2889 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2890 std::size_t sz(tmp.size());
2891 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2892 for(std::size_t i=0;i<sz;i++)
2894 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2895 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2897 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2900 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2903 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2904 PyObject *ret=PyTuple_New(2);
2905 PyObject *ret_0=PyList_New(ret0.size());
2907 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2909 PyObject *elt=PyTuple_New(2);
2910 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2911 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2912 PyList_SetItem(ret_0,rk,elt);
2914 PyTuple_SetItem(ret,0,ret_0);
2915 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2916 PyTuple_SetItem(ret,1,ret_1);
2920 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2922 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2923 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2926 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2928 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2929 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2932 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2934 if(obj && PyList_Check(obj))
2936 int sz=PyList_Size(obj);
2937 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2938 int *pt=da->getPointer();
2939 for(int i=0;i<sz;i++,pt++)
2941 PyObject *elt1=PyList_GetItem(obj,i);
2942 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2944 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2947 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2950 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2952 self->setFieldAtPos(obj,field);
2956 int __len__() const throw(INTERP_KERNEL::Exception)
2958 return self->getNumberOfFields();
2961 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2963 return self->iterator();
2966 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2968 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2969 return self->changeMeshNames(modifTab);
2972 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2974 if(elt0 && PyInt_Check(elt0))
2976 return PyInt_AS_LONG(elt0);
2978 else if(elt0 && PyString_Check(elt0))
2979 return self->getPosFromFieldName(PyString_AsString(elt0));
2981 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2984 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2986 if(PyList_Check(elts))
2988 int sz=PyList_Size(elts);
2989 std::vector<int> ret(sz);
2990 for(int i=0;i<sz;i++)
2992 PyObject *elt=PyList_GetItem(elts,i);
2993 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2999 std::vector<int> ret(1);
3000 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
3005 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3007 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3008 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3009 self->pushFields(tmp);
3012 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3014 if(elts && PySlice_Check(elts))
3016 Py_ssize_t strt=2,stp=2,step=2;
3017 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3018 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3019 self->destroyFieldsAtPos2(strt,stp,step);
3023 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
3024 if(!idsToRemove.empty())
3025 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3031 class MEDFileParameter1TS : public RefCountObject
3034 void setIteration(int it);
3035 int getIteration() const;
3036 void setOrder(int order);
3037 int getOrder() const;
3038 void setTimeValue(double time);
3039 void setTime(int dt, int it, double time);
3040 double getTime(int& dt, int& it);
3041 double getTimeValue() const;
3044 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3047 void setValue(double val) throw(INTERP_KERNEL::Exception);
3048 double getValue() const throw(INTERP_KERNEL::Exception);
3049 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3052 std::string __str__() const throw(INTERP_KERNEL::Exception)
3054 return self->simpleRepr();
3059 class MEDFileParameterTinyInfo : public MEDFileWritable
3062 void setDescription(const std::string& name);
3063 std::string getDescription() const;
3064 void setTimeUnit(const std::string& unit);
3065 std::string getTimeUnit() const;
3068 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3071 static MEDFileParameterDouble1TS *New();
3072 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3073 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3074 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3075 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
3076 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3077 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3078 std::string getName() const throw(INTERP_KERNEL::Exception);
3079 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3082 MEDFileParameterDouble1TS()
3084 return MEDFileParameterDouble1TS::New();
3087 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3089 return MEDFileParameterDouble1TS::New(fileName);
3092 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3094 return MEDFileParameterDouble1TS::New(fileName,paramName);
3097 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3099 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3102 std::string __str__() const throw(INTERP_KERNEL::Exception)
3104 return self->simpleRepr();
3107 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3110 bool ret0=self->isEqual(other,eps,what);
3111 PyObject *res=PyList_New(2);
3112 PyObject *ret0Py=ret0?Py_True:Py_False;
3114 PyList_SetItem(res,0,ret0Py);
3115 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3121 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3124 static MEDFileParameterMultiTS *New();
3125 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3126 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3127 std::string getName() const;
3128 void setName(const std::string& name);
3129 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
3130 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3131 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3132 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3133 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3134 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3135 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3136 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3139 MEDFileParameterMultiTS()
3141 return MEDFileParameterMultiTS::New();
3144 MEDFileParameterMultiTS(const std::string& fileName)
3146 return MEDFileParameterMultiTS::New(fileName);
3149 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3151 return MEDFileParameterMultiTS::New(fileName,paramName);
3154 std::string __str__() const throw(INTERP_KERNEL::Exception)
3156 return self->simpleRepr();
3159 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3162 bool ret0=self->isEqual(other,eps,what);
3163 PyObject *res=PyList_New(2);
3164 PyObject *ret0Py=ret0?Py_True:Py_False;
3166 PyList_SetItem(res,0,ret0Py);
3167 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3171 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3175 std::vector<int> pos2;
3176 DataArrayInt *pos3=0;
3177 DataArrayIntTuple *pos4=0;
3178 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3183 self->eraseTimeStepIds(&pos1,&pos1+1);
3190 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3195 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3199 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3203 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3205 if(elt0 && PyInt_Check(elt0))
3207 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3210 else if(elt0 && PyTuple_Check(elt0))
3212 if(PyTuple_Size(elt0)==2)
3214 PyObject *o0=PyTuple_GetItem(elt0,0);
3215 PyObject *o1=PyTuple_GetItem(elt0,1);
3216 if(PyInt_Check(o0) && PyInt_Check(o1))
3218 int iter=PyInt_AS_LONG(o0);
3219 int order=PyInt_AS_LONG(o1);
3220 return self->getPosOfTimeStep(iter,order);
3223 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 !");
3226 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 !");
3228 else if(elt0 && PyFloat_Check(elt0))
3230 double val=PyFloat_AS_DOUBLE(elt0);
3231 return self->getPosGivenTime(val);
3234 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3237 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3239 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3245 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3247 if(PyList_Check(elts))
3249 int sz=PyList_Size(elts);
3250 std::vector<int> ret(sz);
3251 for(int i=0;i<sz;i++)
3253 PyObject *elt=PyList_GetItem(elts,i);
3254 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3260 std::vector<int> ret(1);
3261 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3266 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3268 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3269 if(!idsToRemove.empty())
3270 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3273 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3275 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3281 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3283 std::vector< std::pair<int,int> > res=self->getIterations();
3284 PyObject *ret=PyList_New(res.size());
3286 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3288 PyObject *elt=PyTuple_New(2);
3289 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3290 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3291 PyList_SetItem(ret,rk,elt);
3296 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3298 std::vector<double> res2;
3299 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3300 PyObject *ret=PyList_New(res.size());
3302 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3304 PyObject *elt=PyTuple_New(3);
3305 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3306 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3307 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3308 PyList_SetItem(ret,rk,elt);
3315 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3318 static MEDFileParameters *New();
3319 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3320 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3321 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3322 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3323 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3324 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3325 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3326 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3327 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3328 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3329 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3334 return MEDFileParameters::New();
3337 MEDFileParameters(const std::string& fileName)
3339 return MEDFileParameters::New(fileName);
3342 std::string __str__() const throw(INTERP_KERNEL::Exception)
3344 return self->simpleRepr();
3347 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3349 if(PyInt_Check(obj))
3351 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3356 else if(PyString_Check(obj))
3358 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3364 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3367 int __len__() const throw(INTERP_KERNEL::Exception)
3369 return self->getNumberOfParams();
3372 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3374 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3380 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3382 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3388 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3391 bool ret0=self->isEqual(other,eps,what);
3392 PyObject *res=PyList_New(2);
3393 PyObject *ret0Py=ret0?Py_True:Py_False;
3395 PyList_SetItem(res,0,ret0Py);
3396 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3402 class MEDFileData : public RefCountObject, public MEDFileWritable
3405 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3406 static MEDFileData *New();
3407 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3408 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3409 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3410 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3411 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3412 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3413 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3415 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3416 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3418 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3421 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3423 return MEDFileData::New(fileName);
3428 return MEDFileData::New();
3431 std::string __str__() const throw(INTERP_KERNEL::Exception)
3433 return self->simpleRepr();
3436 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3438 MEDFileMeshes *ret=self->getMeshes();
3444 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3446 MEDFileParameters *ret=self->getParams();
3452 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3454 MEDFileFields *ret=self->getFields();
3460 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3462 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3463 return self->changeMeshNames(modifTab);
3468 class SauvReader : public RefCountObject
3471 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3472 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3475 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3477 return SauvReader::New(fileName);
3482 class SauvWriter : public RefCountObject
3485 static SauvWriter * New();
3486 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3487 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3488 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3489 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3492 SauvWriter() throw(INTERP_KERNEL::Exception)
3494 return SauvWriter::New();
3501 class MEDFileMeshStruct;
3503 class MEDFileField1TSStructItem
3506 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3509 class MEDFileMeshStruct : public RefCountObject
3512 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3514 ~MEDFileMeshStruct();
3517 class MEDMeshMultiLev : public RefCountObject
3520 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3521 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3527 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3529 DataArrayInt *famIds(0);
3530 bool isWithoutCopy(false);
3531 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3532 PyObject *ret=PyTuple_New(2);
3533 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3535 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3536 PyTuple_SetItem(ret,1,ret1Py);
3540 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3542 DataArrayInt *numIds(0);
3543 bool isWithoutCopy(false);
3544 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3545 PyObject *ret=PyTuple_New(2);
3546 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3548 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3549 PyTuple_SetItem(ret,1,ret1Py);
3553 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3555 DataArrayInt *famIds(0);
3556 bool isWithoutCopy(false);
3557 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3558 PyObject *ret=PyTuple_New(2);
3559 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3561 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3562 PyTuple_SetItem(ret,1,ret1Py);
3566 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3568 DataArrayInt *numIds(0);
3569 bool isWithoutCopy(false);
3570 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3571 PyObject *ret=PyTuple_New(2);
3572 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3574 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3575 PyTuple_SetItem(ret,1,ret1Py);
3579 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3581 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3582 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3583 PyObject *res(PyList_New(result.size()));
3584 for(int i=0;iL!=result.end(); i++, iL++)
3585 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3591 class MEDUMeshMultiLev : public MEDMeshMultiLev
3594 ~MEDUMeshMultiLev();
3598 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3600 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3601 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3602 PyObject *ret0Py=ncc?Py_True:Py_False;
3604 PyObject *ret=PyTuple_New(7);
3605 PyTuple_SetItem(ret,0,ret0Py);
3606 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3607 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3608 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3609 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3610 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3611 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3617 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3620 ~MEDStructuredMeshMultiLev();
3623 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3626 ~MEDCMeshMultiLev();
3630 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3633 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3634 std::size_t sz(objs.size());
3635 PyObject *ret(PyTuple_New(2));
3636 PyObject *ret0=PyList_New(sz);
3637 for(std::size_t i=0;i<sz;i++)
3638 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3639 PyTuple_SetItem(ret,0,ret0);
3640 PyObject *ret1Py(isInternal?Py_True:Py_False);
3642 PyTuple_SetItem(ret,1,ret1Py);
3648 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3651 ~MEDCurveLinearMeshMultiLev();
3655 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3657 DataArrayDouble *ret0(0);
3658 std::vector<int> ret1;
3660 self->buildVTUArrays(ret0,ret1,ret2);
3661 std::size_t sz(ret1.size());
3662 PyObject *ret=PyTuple_New(3);
3663 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3664 PyObject *ret1Py=PyList_New(sz);
3665 for(std::size_t i=0;i<sz;i++)
3666 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3667 PyTuple_SetItem(ret,1,ret1Py);
3668 PyObject *ret2Py(ret2?Py_True:Py_False);
3670 PyTuple_SetItem(ret,2,ret2Py);
3676 class MEDFileFastCellSupportComparator : public RefCountObject
3679 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3680 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3681 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3682 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3684 ~MEDFileFastCellSupportComparator();
3688 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3690 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3691 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3692 PyObject *res(PyList_New(result.size()));
3693 for(int i=0;iL!=result.end(); i++, iL++)
3694 PyList_SetItem(res,i,PyInt_FromLong(*iL));