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::getGenMeshAtLevel;
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::MEDFileData::getJoints;
105 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
106 %newobject ParaMEDMEM::MEDFileUMesh::New;
107 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
108 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
109 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
110 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
111 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
112 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
113 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
114 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
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 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
887 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
888 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
889 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
890 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
891 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
892 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
893 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
894 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
895 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
896 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
897 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
898 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
899 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
901 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
902 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
903 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
904 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
905 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
906 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
907 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
908 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
909 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
910 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
911 void clearGrpMap() throw(INTERP_KERNEL::Exception);
912 void clearFamMap() throw(INTERP_KERNEL::Exception);
913 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
914 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
915 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
916 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
917 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
918 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
919 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
920 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
921 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
922 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
923 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
924 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
925 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
926 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
927 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
928 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
929 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
930 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
931 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
932 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
933 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
934 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
935 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
936 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
937 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
938 void setFamilyInfo(const std::map<std::string,int>& info);
939 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
940 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
941 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
942 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
943 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
944 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
945 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
946 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
947 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
948 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
949 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
950 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
951 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
952 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
953 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
954 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
955 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
956 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
957 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
958 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
959 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
961 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
962 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
963 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
964 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
965 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
966 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
967 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
968 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
969 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
970 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
971 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
972 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
973 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
974 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
975 int getNumberOfJoints();
976 MEDFileJoints *getJoints();
977 void setJoints( MEDFileJoints* joints );
978 void initializeEquivalences();
979 void killEquivalences();
982 std::string __str__() const throw(INTERP_KERNEL::Exception)
984 return self->simpleRepr();
987 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
989 return self->getGenMeshAtLevel(meshDimRelToMaxExt,false);
992 PyObject *getTime() throw(INTERP_KERNEL::Exception)
995 double tmp0=self->getTime(tmp1,tmp2);
996 PyObject *res = PyList_New(3);
997 PyList_SetItem(res,0,SWIG_From_int(tmp1));
998 PyList_SetItem(res,1,SWIG_From_int(tmp2));
999 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1003 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1006 bool ret0=self->isEqual(other,eps,what);
1007 PyObject *res=PyList_New(2);
1008 PyObject *ret0Py=ret0?Py_True:Py_False;
1010 PyList_SetItem(res,0,ret0Py);
1011 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1015 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1017 std::vector<const DataArrayInt *> grps;
1018 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
1019 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1022 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1025 bool ret0=self->areFamsEqual(other,what);
1026 PyObject *res=PyList_New(2);
1027 PyObject *ret0Py=ret0?Py_True:Py_False;
1029 PyList_SetItem(res,0,ret0Py);
1030 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1034 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1037 bool ret0=self->areGrpsEqual(other,what);
1038 PyObject *res=PyList_New(2);
1039 PyObject *ret0Py=ret0?Py_True:Py_False;
1041 PyList_SetItem(res,0,ret0Py);
1042 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1046 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1048 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1049 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1050 PyObject *res=PyList_New(result.size());
1051 for(int i=0;iL!=result.end(); i++, iL++)
1052 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1056 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1058 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1059 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1060 PyObject *res=PyList_New(result.size());
1061 for(int i=0;iL!=result.end(); i++, iL++)
1062 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1066 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1068 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1071 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1074 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1076 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1079 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1082 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1084 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1087 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1090 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1092 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1095 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1098 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1100 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1103 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1106 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1109 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1110 PyObject *ret=PyTuple_New(2);
1111 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1112 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1116 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1118 DataArrayInt *ret3=0;
1119 std::vector<int> ret1,ret2;
1120 bool ret0=self->unPolyze(ret1,ret2,ret3);
1121 PyObject *ret=PyTuple_New(4);
1122 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1124 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1125 for(int j=0;j<(int)ret1.size()/3;j++)
1127 PyObject *retLev2=PyList_New(3);
1128 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1129 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1130 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1131 PyList_SetItem(retLev1_0,j,retLev2);
1133 PyTuple_SetItem(ret,1,retLev1_0);
1135 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1136 for(int j=0;j<(int)ret2.size()/3;j++)
1138 PyObject *retLev2=PyList_New(3);
1139 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1140 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1141 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1142 PyList_SetItem(retLev1_1,j,retLev2);
1144 PyTuple_SetItem(ret,2,retLev1_1);
1146 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1150 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1152 MEDFileEquivalences *ret(self->getEquivalences());
1153 if(ret) ret->incrRef();
1159 class MEDFileUMesh : public MEDFileMesh
1162 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1163 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1164 static MEDFileUMesh *New();
1166 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1167 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1169 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1170 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1171 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1172 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1173 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1174 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1175 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1176 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1177 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1178 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1179 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1180 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1181 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1182 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1183 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
1184 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1185 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1186 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1187 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1188 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1190 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1191 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1192 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1193 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1194 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1195 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1196 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1197 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1198 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1199 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1200 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1201 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1202 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1205 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1207 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1210 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1212 return MEDFileUMesh::New(fileName,mrs);
1217 return MEDFileUMesh::New();
1221 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1223 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1226 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)
1228 std::vector<int> typesCpp1;
1229 convertPyToNewIntArr3(types,typesCpp1);
1230 std::size_t sz(typesCpp1.size());
1231 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1232 for(std::size_t ii=0;ii<sz;ii++)
1233 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1234 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1237 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1238 {// put an empty dict in input to say to __new__ to call __init__...
1239 PyObject *ret(PyTuple_New(1));
1240 PyObject *ret0(PyDict_New());
1241 PyTuple_SetItem(ret,0,ret0);
1245 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1247 std::vector<double> a0;
1248 std::vector<int> a1;
1249 std::vector<std::string> a2;
1250 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1251 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1252 self->serialize(a0,a1,a2,a3,a4);
1253 PyObject *ret(PyTuple_New(5));
1254 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1255 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1257 PyObject *ret2(PyList_New(sz));
1258 for(int i=0;i<sz;i++)
1259 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1260 PyTuple_SetItem(ret,2,ret2);
1262 PyObject *ret3(PyList_New(sz));
1263 for(int i=0;i<sz;i++)
1265 DataArrayInt *elt(a3[i]);
1268 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1270 PyTuple_SetItem(ret,3,ret3);
1271 DataArrayDouble *ret4(a4);
1274 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1278 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1280 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1281 if(!PyTuple_Check(inp))
1282 throw INTERP_KERNEL::Exception(MSG);
1283 int sz(PyTuple_Size(inp));
1285 throw INTERP_KERNEL::Exception(MSG);
1286 std::vector<double> a0;
1287 std::vector<int> a1;
1288 std::vector<std::string> a2;
1289 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1290 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1292 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1294 fillArrayWithPyListDbl3(a0py,tmp,a0);
1295 convertPyToNewIntArr3(a1py,a1);
1296 fillStringVector(a2py,a2);
1298 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1300 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1301 if(!SWIG_IsOK(status))
1302 throw INTERP_KERNEL::Exception(MSG);
1303 a4=reinterpret_cast<DataArrayDouble *>(argp);
1304 if((DataArrayDouble *)a4)
1307 std::vector< DataArrayInt * > a3Tmp;
1308 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1309 std::size_t sz(a3Tmp.size());
1311 for(std::size_t i=0;i<sz;i++)
1315 a3Tmp[i]->incrRef();
1317 self->unserialize(a0,a1,a2,a3,a4);
1321 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1324 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1325 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1328 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1331 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1334 self->setMeshAtLevel(meshDimRelToMax,m1);
1337 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1340 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1342 self->removeMeshAtLevel(meshDimRelToMax);
1345 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1347 std::vector<const MEDCouplingUMesh *> ms;
1348 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1349 self->setMeshes(ms,renum);
1352 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1354 std::vector<const MEDCouplingUMesh *> ms;
1355 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1356 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1359 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1361 std::vector<const MEDCouplingUMesh *> ms;
1362 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1363 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1366 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1368 DataArrayDouble *ret=self->getCoords();
1374 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1376 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1379 return const_cast<PartDefinition *>(ret);
1382 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1384 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1385 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1386 PyObject *ret=PyTuple_New(3);
1387 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1388 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1389 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1393 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1395 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1401 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1403 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1404 std::size_t sz(tmp.size());
1405 PyObject *ret=PyList_New(sz);
1406 for(std::size_t i=0;i<sz;i++)
1410 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1417 class MEDFileStructuredMesh : public MEDFileMesh
1422 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1424 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1432 class MEDFileCMesh : public MEDFileStructuredMesh
1435 static MEDFileCMesh *New();
1436 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1437 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1438 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1439 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1444 return MEDFileCMesh::New();
1447 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1449 return MEDFileCMesh::New(fileName,mrs);
1452 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1454 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1457 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1459 const MEDCouplingCMesh *tmp=self->getMesh();
1462 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1467 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1470 static MEDFileCurveLinearMesh *New();
1471 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1472 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1473 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1476 MEDFileCurveLinearMesh()
1478 return MEDFileCurveLinearMesh::New();
1481 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1483 return MEDFileCurveLinearMesh::New(fileName,mrs);
1486 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1488 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1491 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1493 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1496 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1501 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1504 static MEDFileMeshMultiTS *New();
1505 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1506 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1507 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1508 std::string getName() const throw(INTERP_KERNEL::Exception);
1509 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1510 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1513 MEDFileMeshMultiTS()
1515 return MEDFileMeshMultiTS::New();
1518 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1520 return MEDFileMeshMultiTS::New(fileName);
1523 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1525 return MEDFileMeshMultiTS::New(fileName,mName);
1528 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1530 MEDFileMesh *ret=self->getOneTimeStep();
1538 class MEDFileMeshesIterator
1543 PyObject *next() throw(INTERP_KERNEL::Exception)
1545 MEDFileMesh *ret=self->nextt();
1549 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1553 PyErr_SetString(PyExc_StopIteration,"No more data.");
1560 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1563 static MEDFileMeshes *New();
1564 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1565 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1566 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1567 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1568 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1570 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1571 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1572 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1573 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1578 return MEDFileMeshes::New();
1581 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1583 return MEDFileMeshes::New(fileName);
1586 std::string __str__() const throw(INTERP_KERNEL::Exception)
1588 return self->simpleRepr();
1591 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1593 if(PyInt_Check(obj))
1595 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1600 else if(PyString_Check(obj))
1602 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1608 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1611 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1613 self->setMeshAtPos(obj,mesh);
1617 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1619 return self->iterator();
1622 int __len__() const throw(INTERP_KERNEL::Exception)
1624 return self->getNumberOfMeshes();
1627 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1629 MEDFileMesh *ret=self->getMeshAtPos(i);
1634 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1636 MEDFileMesh *ret=self->getMeshWithName(mname);
1644 class MEDFileFieldLoc : public RefCountObject
1647 std::string getName() const;
1648 int getDimension() const;
1649 int getNumberOfGaussPoints() const;
1650 int getNumberOfPointsInCells() const;
1651 const std::vector<double>& getRefCoords() const;
1652 const std::vector<double>& getGaussCoords() const;
1653 const std::vector<double>& getGaussWeights() const;
1654 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1657 std::string __str__() const throw(INTERP_KERNEL::Exception)
1659 return self->repr();
1664 class MEDFileFieldGlobsReal
1667 void resetContent();
1668 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1669 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1670 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1671 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1672 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1673 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1674 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1675 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1676 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1677 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1678 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1679 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1680 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1681 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1682 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1683 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1684 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1685 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1686 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1687 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1688 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1689 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1690 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1691 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1692 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1693 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1696 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1698 const DataArrayInt *ret=self->getProfile(pflName);
1701 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1704 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1706 const DataArrayInt *ret=self->getProfileFromId(pflId);
1709 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1712 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1714 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1717 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1720 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1722 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1725 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1728 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1730 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1731 return convertVecPairVecStToPy(ret);
1734 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1736 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1737 return convertVecPairVecStToPy(ret);
1740 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1742 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1743 self->changePflsNames(v);
1746 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1748 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1749 self->changePflsRefsNamesGen(v);
1752 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1754 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1755 self->changePflsNamesInStruct(v);
1758 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1760 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1761 self->changeLocsNames(v);
1764 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1766 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1767 self->changeLocsRefsNamesGen(v);
1770 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1772 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1773 self->changeLocsNamesInStruct(v);
1776 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1778 std::ostringstream oss;
1779 self->simpleReprGlobs(oss);
1785 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1788 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1789 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1790 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1791 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1792 void loadArrays() throw(INTERP_KERNEL::Exception);
1793 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1794 void unloadArrays() throw(INTERP_KERNEL::Exception);
1795 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1796 int getDimension() const throw(INTERP_KERNEL::Exception);
1797 int getIteration() const throw(INTERP_KERNEL::Exception);
1798 int getOrder() const throw(INTERP_KERNEL::Exception);
1799 std::string getName() throw(INTERP_KERNEL::Exception);
1800 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1801 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1802 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1803 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1804 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1805 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1806 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1807 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1808 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1809 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1810 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1811 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1812 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1813 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1814 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1817 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1820 double tmp0=self->getTime(tmp1,tmp2);
1821 PyObject *res = PyList_New(3);
1822 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1823 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1824 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1828 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1830 std::pair<int,int> res=self->getDtIt();
1831 PyObject *elt=PyTuple_New(2);
1832 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1833 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1837 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1839 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1842 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1844 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1847 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1849 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1850 return self->changeMeshNames(modifTab);
1853 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1855 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1856 PyObject *ret2=PyList_New(ret.size());
1857 for(int i=0;i<(int)ret.size();i++)
1858 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1862 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1864 std::vector<int> ret1;
1865 int ret0=self->getNonEmptyLevels(mname,ret1);
1866 PyObject *elt=PyTuple_New(2);
1867 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1868 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1872 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1874 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1875 std::vector< std::vector<TypeOfField> > typesF;
1876 std::vector< std::vector<std::string> > pfls;
1877 std::vector< std::vector<std::string> > locs;
1878 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1880 PyObject *ret2=PyList_New(sz);
1881 for(int i=0;i<sz;i++)
1883 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1884 const std::vector<TypeOfField>& typesFI=typesF[i];
1885 const std::vector<std::string>& pflsI=pfls[i];
1886 const std::vector<std::string>& locsI=locs[i];
1887 PyObject *elt=PyTuple_New(2);
1888 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1889 int sz2=ret[i].size();
1890 PyObject *elt2=PyList_New(sz2);
1891 for(int j=0;j<sz2;j++)
1893 PyObject *elt3=PyTuple_New(4);
1894 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1895 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));
1896 PyTuple_SetItem(elt3,1,elt4);
1897 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1898 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1899 PyList_SetItem(elt2,j,elt3);
1901 PyTuple_SetItem(elt,1,elt2);
1902 PyList_SetItem(ret2,i,elt);
1907 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1909 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1910 std::size_t sz=ret.size();
1911 PyObject *retPy=PyList_New(sz);
1912 for(std::size_t i=0;i<sz;i++)
1913 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1917 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1919 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1920 std::size_t sz=ret.size();
1921 PyObject *retPy=PyList_New(sz);
1922 for(std::size_t i=0;i<sz;i++)
1923 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1927 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1929 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1930 std::size_t sz=ret.size();
1931 PyObject *retPy=PyList_New(sz);
1932 for(std::size_t i=0;i<sz;i++)
1933 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1939 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1942 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1943 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1944 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1945 static MEDFileField1TS *New();
1946 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1947 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1948 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1949 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1950 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1951 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1953 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1954 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1955 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1956 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1959 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1961 return MEDFileField1TS::New(fileName,loadAll);
1964 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1966 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1969 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1971 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1976 return MEDFileField1TS::New();
1979 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1981 const DataArrayDouble *arr=0;
1983 arr=field->getArray();
1984 self->copyTinyInfoFrom(field,arr);
1987 std::string __str__() const throw(INTERP_KERNEL::Exception)
1989 return self->simpleRepr();
1992 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1994 DataArrayInt *ret1=0;
1995 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1996 PyObject *ret=PyTuple_New(2);
1997 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1998 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2002 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2004 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2005 std::vector< std::vector<TypeOfField> > typesF;
2006 std::vector< std::vector<std::string> > pfls;
2007 std::vector< std::vector<std::string> > locs;
2008 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2010 PyObject *ret2=PyList_New(sz);
2011 for(int i=0;i<sz;i++)
2013 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2014 const std::vector<TypeOfField>& typesFI=typesF[i];
2015 const std::vector<std::string>& pflsI=pfls[i];
2016 const std::vector<std::string>& locsI=locs[i];
2017 PyObject *elt=PyTuple_New(2);
2018 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2019 int sz2=ret[i].size();
2020 PyObject *elt2=PyList_New(sz2);
2021 for(int j=0;j<sz2;j++)
2023 PyObject *elt3=PyTuple_New(4);
2024 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2025 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2026 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2027 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2028 PyList_SetItem(elt2,j,elt3);
2030 PyTuple_SetItem(elt,1,elt2);
2031 PyList_SetItem(ret2,i,elt);
2036 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2038 DataArrayDouble *ret=self->getUndergroundDataArray();
2044 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2046 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2047 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2050 PyObject *ret=PyTuple_New(2);
2051 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2052 std::size_t sz=elt1Cpp.size();
2053 PyObject *elt=PyList_New(sz);
2054 for(std::size_t i=0;i<sz;i++)
2056 PyObject *elt1=PyTuple_New(2);
2057 PyObject *elt2=PyTuple_New(2);
2058 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2059 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2060 PyObject *elt3=PyTuple_New(2);
2061 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2062 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2063 PyTuple_SetItem(elt1,0,elt2);
2064 PyTuple_SetItem(elt1,1,elt3);
2065 PyList_SetItem(elt,i,elt1);
2067 PyTuple_SetItem(ret,1,elt);
2073 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2076 static MEDFileIntField1TS *New();
2077 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2078 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2079 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2080 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2082 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2083 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2086 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2088 return MEDFileIntField1TS::New();
2091 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2093 return MEDFileIntField1TS::New(fileName,loadAll);
2096 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2098 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2101 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2103 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2106 std::string __str__() const throw(INTERP_KERNEL::Exception)
2108 return self->simpleRepr();
2111 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2113 DataArrayInt *ret1=0;
2114 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2115 PyObject *ret=PyTuple_New(2);
2116 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2117 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2121 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2123 DataArrayInt *ret1=0;
2124 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2125 PyObject *ret=PyTuple_New(2);
2126 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2127 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2131 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2133 DataArrayInt *ret1=0;
2134 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2135 PyObject *ret=PyTuple_New(2);
2136 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2137 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2141 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2143 DataArrayInt *ret1=0;
2144 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2145 PyObject *ret=PyTuple_New(2);
2146 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2147 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2153 DataArrayInt *ret1=0;
2154 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2155 PyObject *ret=PyTuple_New(2);
2156 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2157 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2163 DataArrayInt *ret1=0;
2164 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2165 PyObject *ret=PyTuple_New(2);
2166 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2167 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2171 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2173 DataArrayInt *ret=self->getUndergroundDataArray();
2181 class MEDFileAnyTypeFieldMultiTSIterator
2186 PyObject *next() throw(INTERP_KERNEL::Exception)
2188 MEDFileAnyTypeField1TS *ret=self->nextt();
2190 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2193 PyErr_SetString(PyExc_StopIteration,"No more data.");
2200 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2203 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2204 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2205 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2206 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2207 std::string getName() const throw(INTERP_KERNEL::Exception);
2208 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2209 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2210 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2211 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2212 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2213 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2214 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2215 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2216 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2217 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2218 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2219 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2220 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2221 void loadArrays() throw(INTERP_KERNEL::Exception);
2222 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2223 void unloadArrays() throw(INTERP_KERNEL::Exception);
2224 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2226 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2227 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2228 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2229 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2230 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2233 int __len__() const throw(INTERP_KERNEL::Exception)
2235 return self->getNumberOfTS();
2238 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2240 if(elt0 && PyInt_Check(elt0))
2242 int pos=PyInt_AS_LONG(elt0);
2245 else if(elt0 && PyTuple_Check(elt0))
2247 if(PyTuple_Size(elt0)==2)
2249 PyObject *o0=PyTuple_GetItem(elt0,0);
2250 PyObject *o1=PyTuple_GetItem(elt0,1);
2251 if(PyInt_Check(o0) && PyInt_Check(o1))
2253 int iter=PyInt_AS_LONG(o0);
2254 int order=PyInt_AS_LONG(o1);
2255 return self->getPosOfTimeStep(iter,order);
2258 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 !");
2261 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 !");
2263 else if(elt0 && PyFloat_Check(elt0))
2265 double val=PyFloat_AS_DOUBLE(elt0);
2266 return self->getPosGivenTime(val);
2269 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2272 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2274 std::vector< std::pair<int,int> > res=self->getIterations();
2275 PyObject *ret=PyList_New(res.size());
2277 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2279 PyObject *elt=PyTuple_New(2);
2280 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2281 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2282 PyList_SetItem(ret,rk,elt);
2287 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2289 std::vector<double> ret1;
2290 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2291 std::size_t sz=ret.size();
2292 PyObject *ret2=PyList_New(sz);
2293 for(std::size_t i=0;i<sz;i++)
2295 PyObject *elt=PyTuple_New(3);
2296 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2297 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2298 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2299 PyList_SetItem(ret2,i,elt);
2304 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2306 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2307 PyObject *ret2=PyList_New(ret.size());
2308 for(int i=0;i<(int)ret.size();i++)
2310 const std::vector<TypeOfField>& rett=ret[i];
2311 PyObject *ret3=PyList_New(rett.size());
2312 for(int j=0;j<(int)rett.size();j++)
2313 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2314 PyList_SetItem(ret2,i,ret3);
2319 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2321 std::vector<int> ret1;
2322 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2323 PyObject *elt=PyTuple_New(2);
2324 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2325 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2329 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2331 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2332 std::vector< std::vector<TypeOfField> > typesF;
2333 std::vector< std::vector<std::string> > pfls;
2334 std::vector< std::vector<std::string> > locs;
2335 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2337 PyObject *ret2=PyList_New(sz);
2338 for(int i=0;i<sz;i++)
2340 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2341 const std::vector<TypeOfField>& typesFI=typesF[i];
2342 const std::vector<std::string>& pflsI=pfls[i];
2343 const std::vector<std::string>& locsI=locs[i];
2344 PyObject *elt=PyTuple_New(2);
2345 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2346 int sz2=ret[i].size();
2347 PyObject *elt2=PyList_New(sz2);
2348 for(int j=0;j<sz2;j++)
2350 PyObject *elt3=PyTuple_New(4);
2351 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2352 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));
2353 PyTuple_SetItem(elt3,1,elt4);
2354 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2355 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2356 PyList_SetItem(elt2,j,elt3);
2358 PyTuple_SetItem(elt,1,elt2);
2359 PyList_SetItem(ret2,i,elt);
2364 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2366 if(PyList_Check(elts))
2368 int sz=PyList_Size(elts);
2369 std::vector<int> ret(sz);
2370 for(int i=0;i<sz;i++)
2372 PyObject *elt=PyList_GetItem(elts,i);
2373 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2379 std::vector<int> ret(1);
2380 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2385 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2387 if(PySlice_Check(elts))
2389 Py_ssize_t strt=2,stp=2,step=2;
2390 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2391 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2392 self->eraseTimeStepIds2(strt,stp,step);
2396 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2397 if(!idsToRemove.empty())
2398 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2402 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2406 std::vector<int> pos2;
2407 DataArrayInt *pos3=0;
2408 DataArrayIntTuple *pos4=0;
2409 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2414 self->eraseTimeStepIds(&pos1,&pos1+1);
2421 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2426 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2430 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2434 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2436 return self->iterator();
2439 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2441 if(elt0 && PyList_Check(elt0))
2443 int sz=PyList_Size(elt0);
2444 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2445 int *pt=da->getPointer();
2446 for(int i=0;i<sz;i++,pt++)
2448 PyObject *elt1=PyList_GetItem(elt0,i);
2449 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2451 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2453 else if(elt0 && PySlice_Check(elt0))
2455 Py_ssize_t strt=2,stp=2,step=2;
2456 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2457 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2458 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2461 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2464 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2466 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2467 return self->changeMeshNames(modifTab);
2470 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2472 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2473 std::size_t sz=ret.size();
2474 PyObject *retPy=PyList_New(sz);
2475 for(std::size_t i=0;i<sz;i++)
2476 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2480 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2482 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2483 std::size_t sz=ret.size();
2484 PyObject *retPy=PyList_New(sz);
2485 for(std::size_t i=0;i<sz;i++)
2486 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2490 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2492 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2493 std::size_t sz=ret.size();
2494 PyObject *retPy=PyList_New(sz);
2495 for(std::size_t i=0;i<sz;i++)
2496 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2500 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2503 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2504 if(SWIG_IsOK(status))
2506 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2510 std::vector<MEDFileAnyTypeField1TS *> tmp;
2511 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2512 self->pushBackTimeSteps(tmp);
2516 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2518 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2519 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2520 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2521 std::size_t sz=ret.size();
2522 PyObject *retPy=PyList_New(sz);
2523 for(std::size_t i=0;i<sz;i++)
2525 std::size_t sz2=ret[i].size();
2526 PyObject *ret1Py=PyList_New(sz2);
2527 for(std::size_t j=0;j<sz2;j++)
2529 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2532 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2534 PyList_SetItem(retPy,i,ret1Py);
2539 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2541 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2542 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2543 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2544 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2545 if(ret2.size()!=ret.size())
2547 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2548 throw INTERP_KERNEL::Exception(oss.str().c_str());
2550 std::size_t sz=ret.size();
2551 PyObject *retPy=PyList_New(sz);
2552 for(std::size_t i=0;i<sz;i++)
2554 std::size_t sz2=ret[i].size();
2555 PyObject *ret0Py=PyTuple_New(2);
2556 PyObject *ret1Py=PyList_New(sz2);
2557 for(std::size_t j=0;j<sz2;j++)
2559 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2562 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2564 PyTuple_SetItem(ret0Py,0,ret1Py);
2565 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2566 PyList_SetItem(retPy,i,ret0Py);
2573 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2576 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2577 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2578 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2580 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2581 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2582 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2583 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2584 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2586 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2587 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2588 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2591 MEDFileFieldMultiTS()
2593 return MEDFileFieldMultiTS::New();
2596 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2598 return MEDFileFieldMultiTS::New(fileName,loadAll);
2601 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2603 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2606 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2608 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2609 std::size_t sz(tmp.size());
2610 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2611 for(std::size_t i=0;i<sz;i++)
2613 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2614 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2616 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2619 std::string __str__() const throw(INTERP_KERNEL::Exception)
2621 return self->simpleRepr();
2624 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2626 DataArrayInt *ret1=0;
2627 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2628 PyObject *ret=PyTuple_New(2);
2629 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2630 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2634 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2636 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2637 std::vector< std::vector<TypeOfField> > typesF;
2638 std::vector< std::vector<std::string> > pfls;
2639 std::vector< std::vector<std::string> > locs;
2640 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2642 PyObject *ret2=PyList_New(sz);
2643 for(int i=0;i<sz;i++)
2645 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2646 const std::vector<TypeOfField>& typesFI=typesF[i];
2647 const std::vector<std::string>& pflsI=pfls[i];
2648 const std::vector<std::string>& locsI=locs[i];
2649 PyObject *elt=PyTuple_New(2);
2650 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2651 int sz2=ret[i].size();
2652 PyObject *elt2=PyList_New(sz2);
2653 for(int j=0;j<sz2;j++)
2655 PyObject *elt3=PyTuple_New(4);
2656 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2657 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2658 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2659 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2660 PyList_SetItem(elt2,j,elt3);
2662 PyTuple_SetItem(elt,1,elt2);
2663 PyList_SetItem(ret2,i,elt);
2667 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2669 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2675 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2677 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2678 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2681 PyObject *ret=PyTuple_New(2);
2682 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2683 std::size_t sz=elt1Cpp.size();
2684 PyObject *elt=PyList_New(sz);
2685 for(std::size_t i=0;i<sz;i++)
2687 PyObject *elt1=PyTuple_New(2);
2688 PyObject *elt2=PyTuple_New(2);
2689 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2690 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2691 PyObject *elt3=PyTuple_New(2);
2692 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2693 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2694 PyTuple_SetItem(elt1,0,elt2);
2695 PyTuple_SetItem(elt1,1,elt3);
2696 PyList_SetItem(elt,i,elt1);
2698 PyTuple_SetItem(ret,1,elt);
2704 class MEDFileFieldsIterator
2709 PyObject *next() throw(INTERP_KERNEL::Exception)
2711 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2713 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2716 PyErr_SetString(PyExc_StopIteration,"No more data.");
2723 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2726 static MEDFileIntFieldMultiTS *New();
2727 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2728 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2730 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2731 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2732 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2735 MEDFileIntFieldMultiTS()
2737 return MEDFileIntFieldMultiTS::New();
2740 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2742 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2745 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2747 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2750 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2752 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2753 std::size_t sz(tmp.size());
2754 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2755 for(std::size_t i=0;i<sz;i++)
2757 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2758 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2760 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2763 std::string __str__() const throw(INTERP_KERNEL::Exception)
2765 return self->simpleRepr();
2768 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2770 DataArrayInt *ret1=0;
2771 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2772 PyObject *ret=PyTuple_New(2);
2773 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2774 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2778 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2780 DataArrayInt *ret1=0;
2781 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2782 PyObject *ret=PyTuple_New(2);
2783 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2784 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2788 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2790 DataArrayInt *ret1=0;
2791 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2792 PyObject *ret=PyTuple_New(2);
2793 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2794 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2798 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2800 DataArrayInt *ret1=0;
2801 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2802 PyObject *ret=PyTuple_New(2);
2803 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2804 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2808 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2810 DataArrayInt *ret1=0;
2811 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2812 PyObject *ret=PyTuple_New(2);
2813 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2814 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2818 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2820 DataArrayInt *ret1=0;
2821 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2822 PyObject *ret=PyTuple_New(2);
2823 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2824 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2828 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2830 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2838 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2841 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2842 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2843 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2844 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2845 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2846 void loadArrays() throw(INTERP_KERNEL::Exception);
2847 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2848 void unloadArrays() throw(INTERP_KERNEL::Exception);
2849 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2850 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2851 int getNumberOfFields() const;
2852 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2853 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2855 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2856 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2857 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2858 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2859 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2860 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2861 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2862 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2863 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2868 return MEDFileFields::New();
2871 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2873 return MEDFileFields::New(fileName,loadAll);
2876 std::string __str__() const throw(INTERP_KERNEL::Exception)
2878 return self->simpleRepr();
2881 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2883 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2884 std::size_t sz(tmp.size());
2885 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2886 for(std::size_t i=0;i<sz;i++)
2888 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2889 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2891 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2894 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2897 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2898 PyObject *ret=PyTuple_New(2);
2899 PyObject *ret_0=PyList_New(ret0.size());
2901 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2903 PyObject *elt=PyTuple_New(2);
2904 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2905 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2906 PyList_SetItem(ret_0,rk,elt);
2908 PyTuple_SetItem(ret,0,ret_0);
2909 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2910 PyTuple_SetItem(ret,1,ret_1);
2914 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2916 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2917 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2920 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2922 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2923 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2926 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2928 if(obj && PyList_Check(obj))
2930 int sz=PyList_Size(obj);
2931 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2932 int *pt=da->getPointer();
2933 for(int i=0;i<sz;i++,pt++)
2935 PyObject *elt1=PyList_GetItem(obj,i);
2936 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2938 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2941 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2944 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2946 self->setFieldAtPos(obj,field);
2950 int __len__() const throw(INTERP_KERNEL::Exception)
2952 return self->getNumberOfFields();
2955 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2957 return self->iterator();
2960 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2962 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2963 return self->changeMeshNames(modifTab);
2966 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2968 if(elt0 && PyInt_Check(elt0))
2970 return PyInt_AS_LONG(elt0);
2972 else if(elt0 && PyString_Check(elt0))
2973 return self->getPosFromFieldName(PyString_AsString(elt0));
2975 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2978 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2980 if(PyList_Check(elts))
2982 int sz=PyList_Size(elts);
2983 std::vector<int> ret(sz);
2984 for(int i=0;i<sz;i++)
2986 PyObject *elt=PyList_GetItem(elts,i);
2987 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2993 std::vector<int> ret(1);
2994 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2999 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3001 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3002 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3003 self->pushFields(tmp);
3006 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3008 if(elts && PySlice_Check(elts))
3010 Py_ssize_t strt=2,stp=2,step=2;
3011 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3012 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3013 self->destroyFieldsAtPos2(strt,stp,step);
3017 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
3018 if(!idsToRemove.empty())
3019 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3025 class MEDFileParameter1TS : public RefCountObject
3028 void setIteration(int it);
3029 int getIteration() const;
3030 void setOrder(int order);
3031 int getOrder() const;
3032 void setTimeValue(double time);
3033 void setTime(int dt, int it, double time);
3034 double getTime(int& dt, int& it);
3035 double getTimeValue() const;
3038 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3041 void setValue(double val) throw(INTERP_KERNEL::Exception);
3042 double getValue() const throw(INTERP_KERNEL::Exception);
3043 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3046 std::string __str__() const throw(INTERP_KERNEL::Exception)
3048 return self->simpleRepr();
3053 class MEDFileParameterTinyInfo : public MEDFileWritable
3056 void setDescription(const std::string& name);
3057 std::string getDescription() const;
3058 void setTimeUnit(const std::string& unit);
3059 std::string getTimeUnit() const;
3062 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3065 static MEDFileParameterDouble1TS *New();
3066 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3067 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3068 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3069 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
3070 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3071 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3072 std::string getName() const throw(INTERP_KERNEL::Exception);
3073 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3076 MEDFileParameterDouble1TS()
3078 return MEDFileParameterDouble1TS::New();
3081 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3083 return MEDFileParameterDouble1TS::New(fileName);
3086 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3088 return MEDFileParameterDouble1TS::New(fileName,paramName);
3091 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3093 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3096 std::string __str__() const throw(INTERP_KERNEL::Exception)
3098 return self->simpleRepr();
3101 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3104 bool ret0=self->isEqual(other,eps,what);
3105 PyObject *res=PyList_New(2);
3106 PyObject *ret0Py=ret0?Py_True:Py_False;
3108 PyList_SetItem(res,0,ret0Py);
3109 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3115 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3118 static MEDFileParameterMultiTS *New();
3119 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3120 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3121 std::string getName() const;
3122 void setName(const std::string& name);
3123 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
3124 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3125 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3126 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3127 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3128 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3129 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3130 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3133 MEDFileParameterMultiTS()
3135 return MEDFileParameterMultiTS::New();
3138 MEDFileParameterMultiTS(const std::string& fileName)
3140 return MEDFileParameterMultiTS::New(fileName);
3143 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3145 return MEDFileParameterMultiTS::New(fileName,paramName);
3148 std::string __str__() const throw(INTERP_KERNEL::Exception)
3150 return self->simpleRepr();
3153 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3156 bool ret0=self->isEqual(other,eps,what);
3157 PyObject *res=PyList_New(2);
3158 PyObject *ret0Py=ret0?Py_True:Py_False;
3160 PyList_SetItem(res,0,ret0Py);
3161 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3165 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3169 std::vector<int> pos2;
3170 DataArrayInt *pos3=0;
3171 DataArrayIntTuple *pos4=0;
3172 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3177 self->eraseTimeStepIds(&pos1,&pos1+1);
3184 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3189 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3193 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3197 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3199 if(elt0 && PyInt_Check(elt0))
3201 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3204 else if(elt0 && PyTuple_Check(elt0))
3206 if(PyTuple_Size(elt0)==2)
3208 PyObject *o0=PyTuple_GetItem(elt0,0);
3209 PyObject *o1=PyTuple_GetItem(elt0,1);
3210 if(PyInt_Check(o0) && PyInt_Check(o1))
3212 int iter=PyInt_AS_LONG(o0);
3213 int order=PyInt_AS_LONG(o1);
3214 return self->getPosOfTimeStep(iter,order);
3217 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 !");
3220 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 !");
3222 else if(elt0 && PyFloat_Check(elt0))
3224 double val=PyFloat_AS_DOUBLE(elt0);
3225 return self->getPosGivenTime(val);
3228 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3231 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3233 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3239 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3241 if(PyList_Check(elts))
3243 int sz=PyList_Size(elts);
3244 std::vector<int> ret(sz);
3245 for(int i=0;i<sz;i++)
3247 PyObject *elt=PyList_GetItem(elts,i);
3248 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3254 std::vector<int> ret(1);
3255 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3260 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3262 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3263 if(!idsToRemove.empty())
3264 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3267 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3269 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3275 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3277 std::vector< std::pair<int,int> > res=self->getIterations();
3278 PyObject *ret=PyList_New(res.size());
3280 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3282 PyObject *elt=PyTuple_New(2);
3283 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3284 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3285 PyList_SetItem(ret,rk,elt);
3290 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3292 std::vector<double> res2;
3293 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3294 PyObject *ret=PyList_New(res.size());
3296 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3298 PyObject *elt=PyTuple_New(3);
3299 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3300 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3301 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3302 PyList_SetItem(ret,rk,elt);
3309 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3312 static MEDFileParameters *New();
3313 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3314 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3315 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3316 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3317 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3318 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3319 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3320 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3321 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3322 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3323 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3328 return MEDFileParameters::New();
3331 MEDFileParameters(const std::string& fileName)
3333 return MEDFileParameters::New(fileName);
3336 std::string __str__() const throw(INTERP_KERNEL::Exception)
3338 return self->simpleRepr();
3341 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3343 if(PyInt_Check(obj))
3345 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3350 else if(PyString_Check(obj))
3352 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3358 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3361 int __len__() const throw(INTERP_KERNEL::Exception)
3363 return self->getNumberOfParams();
3366 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3368 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3374 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3376 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3382 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3385 bool ret0=self->isEqual(other,eps,what);
3386 PyObject *res=PyList_New(2);
3387 PyObject *ret0Py=ret0?Py_True:Py_False;
3389 PyList_SetItem(res,0,ret0Py);
3390 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3396 class MEDFileData : public RefCountObject, public MEDFileWritable
3399 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3400 static MEDFileData *New();
3401 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3402 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3403 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3404 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3405 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3406 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3407 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3409 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3410 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3412 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3415 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3417 return MEDFileData::New(fileName);
3422 return MEDFileData::New();
3425 std::string __str__() const throw(INTERP_KERNEL::Exception)
3427 return self->simpleRepr();
3430 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3432 MEDFileMeshes *ret=self->getMeshes();
3438 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3440 MEDFileParameters *ret=self->getParams();
3446 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3448 MEDFileFields *ret=self->getFields();
3454 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3456 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3457 return self->changeMeshNames(modifTab);
3462 class SauvReader : public RefCountObject
3465 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3466 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3469 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3471 return SauvReader::New(fileName);
3476 class SauvWriter : public RefCountObject
3479 static SauvWriter * New();
3480 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3481 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3482 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3483 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3486 SauvWriter() throw(INTERP_KERNEL::Exception)
3488 return SauvWriter::New();
3495 class MEDFileMeshStruct;
3497 class MEDFileField1TSStructItem
3500 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3503 class MEDFileMeshStruct : public RefCountObject
3506 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3508 ~MEDFileMeshStruct();
3511 class MEDMeshMultiLev : public RefCountObject
3514 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3515 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3521 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3523 DataArrayInt *famIds(0);
3524 bool isWithoutCopy(false);
3525 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3526 PyObject *ret=PyTuple_New(2);
3527 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3529 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3530 PyTuple_SetItem(ret,1,ret1Py);
3534 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3536 DataArrayInt *numIds(0);
3537 bool isWithoutCopy(false);
3538 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3539 PyObject *ret=PyTuple_New(2);
3540 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3542 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3543 PyTuple_SetItem(ret,1,ret1Py);
3547 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3549 DataArrayInt *famIds(0);
3550 bool isWithoutCopy(false);
3551 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3552 PyObject *ret=PyTuple_New(2);
3553 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3555 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3556 PyTuple_SetItem(ret,1,ret1Py);
3560 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3562 DataArrayInt *numIds(0);
3563 bool isWithoutCopy(false);
3564 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3565 PyObject *ret=PyTuple_New(2);
3566 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3568 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3569 PyTuple_SetItem(ret,1,ret1Py);
3573 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3575 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3576 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3577 PyObject *res(PyList_New(result.size()));
3578 for(int i=0;iL!=result.end(); i++, iL++)
3579 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3585 class MEDUMeshMultiLev : public MEDMeshMultiLev
3588 ~MEDUMeshMultiLev();
3592 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3594 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3595 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3596 PyObject *ret0Py=ncc?Py_True:Py_False;
3598 PyObject *ret=PyTuple_New(7);
3599 PyTuple_SetItem(ret,0,ret0Py);
3600 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3601 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3602 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3603 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3604 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3605 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3611 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3614 ~MEDStructuredMeshMultiLev();
3617 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3620 ~MEDCMeshMultiLev();
3624 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3627 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3628 std::size_t sz(objs.size());
3629 PyObject *ret(PyTuple_New(2));
3630 PyObject *ret0=PyList_New(sz);
3631 for(std::size_t i=0;i<sz;i++)
3632 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3633 PyTuple_SetItem(ret,0,ret0);
3634 PyObject *ret1Py(isInternal?Py_True:Py_False);
3636 PyTuple_SetItem(ret,1,ret1Py);
3642 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3645 ~MEDCurveLinearMeshMultiLev();
3649 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3651 DataArrayDouble *ret0(0);
3652 std::vector<int> ret1;
3654 self->buildVTUArrays(ret0,ret1,ret2);
3655 std::size_t sz(ret1.size());
3656 PyObject *ret=PyTuple_New(3);
3657 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3658 PyObject *ret1Py=PyList_New(sz);
3659 for(std::size_t i=0;i<sz;i++)
3660 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3661 PyTuple_SetItem(ret,1,ret1Py);
3662 PyObject *ret2Py(ret2?Py_True:Py_False);
3664 PyTuple_SetItem(ret,2,ret2Py);
3670 class MEDFileFastCellSupportComparator : public RefCountObject
3673 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3674 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3675 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3676 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3678 ~MEDFileFastCellSupportComparator();
3682 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3684 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3685 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3686 PyObject *res(PyList_New(result.size()));
3687 for(int i=0;iL!=result.end(); i++, iL++)
3688 PyList_SetItem(res,i,PyInt_FromLong(*iL));