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 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
926 static std::string GetMagicFamilyStr();
927 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
928 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
929 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
930 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
931 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
932 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
933 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
934 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
935 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
936 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
937 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
938 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
939 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
940 void setFamilyInfo(const std::map<std::string,int>& info);
941 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
942 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
943 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
944 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
945 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
946 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
947 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
948 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
949 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
950 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
951 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
952 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
953 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
954 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
955 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
956 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
957 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
958 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
959 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
960 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
961 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
963 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
964 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
965 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
966 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
967 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
968 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
969 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
970 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
971 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
972 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
973 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
974 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
975 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
976 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
977 int getNumberOfJoints();
978 MEDFileJoints *getJoints();
979 void setJoints( MEDFileJoints* joints );
980 void initializeEquivalences();
981 void killEquivalences();
984 std::string __str__() const throw(INTERP_KERNEL::Exception)
986 return self->simpleRepr();
989 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
991 return self->getGenMeshAtLevel(meshDimRelToMaxExt,false);
994 PyObject *getTime() throw(INTERP_KERNEL::Exception)
997 double tmp0=self->getTime(tmp1,tmp2);
998 PyObject *res = PyList_New(3);
999 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1000 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1001 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1005 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1008 bool ret0=self->isEqual(other,eps,what);
1009 PyObject *res=PyList_New(2);
1010 PyObject *ret0Py=ret0?Py_True:Py_False;
1012 PyList_SetItem(res,0,ret0Py);
1013 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1017 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1019 std::vector<const DataArrayInt *> grps;
1020 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
1021 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1024 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1027 bool ret0=self->areFamsEqual(other,what);
1028 PyObject *res=PyList_New(2);
1029 PyObject *ret0Py=ret0?Py_True:Py_False;
1031 PyList_SetItem(res,0,ret0Py);
1032 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1036 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1039 bool ret0=self->areGrpsEqual(other,what);
1040 PyObject *res=PyList_New(2);
1041 PyObject *ret0Py=ret0?Py_True:Py_False;
1043 PyList_SetItem(res,0,ret0Py);
1044 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1048 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1050 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1051 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1052 PyObject *res=PyList_New(result.size());
1053 for(int i=0;iL!=result.end(); i++, iL++)
1054 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1058 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1060 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1061 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1062 PyObject *res=PyList_New(result.size());
1063 for(int i=0;iL!=result.end(); i++, iL++)
1064 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1068 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1070 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1073 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1076 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1078 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1081 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1084 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1086 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1089 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1092 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1094 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1097 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1100 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1102 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1105 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1108 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1111 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1112 PyObject *ret=PyTuple_New(2);
1113 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1114 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1118 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1120 DataArrayInt *ret3=0;
1121 std::vector<int> ret1,ret2;
1122 bool ret0=self->unPolyze(ret1,ret2,ret3);
1123 PyObject *ret=PyTuple_New(4);
1124 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1126 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1127 for(int j=0;j<(int)ret1.size()/3;j++)
1129 PyObject *retLev2=PyList_New(3);
1130 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1131 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1132 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1133 PyList_SetItem(retLev1_0,j,retLev2);
1135 PyTuple_SetItem(ret,1,retLev1_0);
1137 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1138 for(int j=0;j<(int)ret2.size()/3;j++)
1140 PyObject *retLev2=PyList_New(3);
1141 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1142 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1143 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1144 PyList_SetItem(retLev1_1,j,retLev2);
1146 PyTuple_SetItem(ret,2,retLev1_1);
1148 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1152 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1154 MEDFileEquivalences *ret(self->getEquivalences());
1155 if(ret) ret->incrRef();
1161 class MEDFileUMesh : public MEDFileMesh
1164 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1165 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1166 static MEDFileUMesh *New();
1168 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1169 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1171 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1172 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1173 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1174 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1175 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1176 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1177 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1178 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1179 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1180 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1181 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1182 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1183 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1184 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1185 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
1186 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1187 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1188 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1189 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1190 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1192 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1193 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1194 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1195 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1196 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1197 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1198 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1199 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1200 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1201 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1202 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1203 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1204 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1207 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1209 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1212 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1214 return MEDFileUMesh::New(fileName,mrs);
1219 return MEDFileUMesh::New();
1223 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1225 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1228 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)
1230 std::vector<int> typesCpp1;
1231 convertPyToNewIntArr3(types,typesCpp1);
1232 std::size_t sz(typesCpp1.size());
1233 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1234 for(std::size_t ii=0;ii<sz;ii++)
1235 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1236 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1239 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1240 {// put an empty dict in input to say to __new__ to call __init__...
1241 PyObject *ret(PyTuple_New(1));
1242 PyObject *ret0(PyDict_New());
1243 PyTuple_SetItem(ret,0,ret0);
1247 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1249 std::vector<double> a0;
1250 std::vector<int> a1;
1251 std::vector<std::string> a2;
1252 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1253 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1254 self->serialize(a0,a1,a2,a3,a4);
1255 PyObject *ret(PyTuple_New(5));
1256 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1257 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1259 PyObject *ret2(PyList_New(sz));
1260 for(int i=0;i<sz;i++)
1261 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1262 PyTuple_SetItem(ret,2,ret2);
1264 PyObject *ret3(PyList_New(sz));
1265 for(int i=0;i<sz;i++)
1267 DataArrayInt *elt(a3[i]);
1270 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1272 PyTuple_SetItem(ret,3,ret3);
1273 DataArrayDouble *ret4(a4);
1276 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1280 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1282 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1283 if(!PyTuple_Check(inp))
1284 throw INTERP_KERNEL::Exception(MSG);
1285 int sz(PyTuple_Size(inp));
1287 throw INTERP_KERNEL::Exception(MSG);
1288 std::vector<double> a0;
1289 std::vector<int> a1;
1290 std::vector<std::string> a2;
1291 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1292 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1294 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1296 fillArrayWithPyListDbl3(a0py,tmp,a0);
1297 convertPyToNewIntArr3(a1py,a1);
1298 fillStringVector(a2py,a2);
1300 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1302 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1303 if(!SWIG_IsOK(status))
1304 throw INTERP_KERNEL::Exception(MSG);
1305 a4=reinterpret_cast<DataArrayDouble *>(argp);
1306 if((DataArrayDouble *)a4)
1309 std::vector< DataArrayInt * > a3Tmp;
1310 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1311 std::size_t sz(a3Tmp.size());
1313 for(std::size_t i=0;i<sz;i++)
1317 a3Tmp[i]->incrRef();
1319 self->unserialize(a0,a1,a2,a3,a4);
1323 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1326 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1327 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1330 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1333 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1336 self->setMeshAtLevel(meshDimRelToMax,m1);
1339 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1342 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1344 self->removeMeshAtLevel(meshDimRelToMax);
1347 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1349 std::vector<const MEDCouplingUMesh *> ms;
1350 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1351 self->setMeshes(ms,renum);
1354 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1356 std::vector<const MEDCouplingUMesh *> ms;
1357 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1358 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1361 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1363 std::vector<const MEDCouplingUMesh *> ms;
1364 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1365 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1368 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1370 DataArrayDouble *ret=self->getCoords();
1376 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1378 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1381 return const_cast<PartDefinition *>(ret);
1384 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1386 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1387 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1388 PyObject *ret=PyTuple_New(3);
1389 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1390 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1391 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1395 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1397 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1403 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1405 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1406 std::size_t sz(tmp.size());
1407 PyObject *ret=PyList_New(sz);
1408 for(std::size_t i=0;i<sz;i++)
1412 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1419 class MEDFileStructuredMesh : public MEDFileMesh
1424 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1426 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1434 class MEDFileCMesh : public MEDFileStructuredMesh
1437 static MEDFileCMesh *New();
1438 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1439 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1440 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1441 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1446 return MEDFileCMesh::New();
1449 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1451 return MEDFileCMesh::New(fileName,mrs);
1454 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1456 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1459 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1461 const MEDCouplingCMesh *tmp=self->getMesh();
1464 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1469 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1472 static MEDFileCurveLinearMesh *New();
1473 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1474 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1475 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1478 MEDFileCurveLinearMesh()
1480 return MEDFileCurveLinearMesh::New();
1483 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1485 return MEDFileCurveLinearMesh::New(fileName,mrs);
1488 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1490 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1493 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1495 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1498 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1503 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1506 static MEDFileMeshMultiTS *New();
1507 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1508 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1509 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1510 std::string getName() const throw(INTERP_KERNEL::Exception);
1511 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1512 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1515 MEDFileMeshMultiTS()
1517 return MEDFileMeshMultiTS::New();
1520 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1522 return MEDFileMeshMultiTS::New(fileName);
1525 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1527 return MEDFileMeshMultiTS::New(fileName,mName);
1530 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1532 MEDFileMesh *ret=self->getOneTimeStep();
1540 class MEDFileMeshesIterator
1545 PyObject *next() throw(INTERP_KERNEL::Exception)
1547 MEDFileMesh *ret=self->nextt();
1551 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1555 PyErr_SetString(PyExc_StopIteration,"No more data.");
1562 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1565 static MEDFileMeshes *New();
1566 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1567 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1568 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1569 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1570 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1572 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1573 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1574 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1575 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1580 return MEDFileMeshes::New();
1583 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1585 return MEDFileMeshes::New(fileName);
1588 std::string __str__() const throw(INTERP_KERNEL::Exception)
1590 return self->simpleRepr();
1593 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1595 if(PyInt_Check(obj))
1597 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1602 else if(PyString_Check(obj))
1604 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1610 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1613 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1615 self->setMeshAtPos(obj,mesh);
1619 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1621 return self->iterator();
1624 int __len__() const throw(INTERP_KERNEL::Exception)
1626 return self->getNumberOfMeshes();
1629 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1631 MEDFileMesh *ret=self->getMeshAtPos(i);
1636 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1638 MEDFileMesh *ret=self->getMeshWithName(mname);
1646 class MEDFileFieldLoc : public RefCountObject
1649 std::string getName() const;
1650 int getDimension() const;
1651 int getNumberOfGaussPoints() const;
1652 int getNumberOfPointsInCells() const;
1653 const std::vector<double>& getRefCoords() const;
1654 const std::vector<double>& getGaussCoords() const;
1655 const std::vector<double>& getGaussWeights() const;
1656 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1659 std::string __str__() const throw(INTERP_KERNEL::Exception)
1661 return self->repr();
1666 class MEDFileFieldGlobsReal
1669 void resetContent();
1670 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1671 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1672 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1673 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1674 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1675 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1676 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1677 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1678 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1679 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1680 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1681 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1682 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1683 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1684 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1685 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1686 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1687 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1688 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1689 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1690 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1691 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1692 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1693 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1694 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1695 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1698 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1700 const DataArrayInt *ret=self->getProfile(pflName);
1703 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1706 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1708 const DataArrayInt *ret=self->getProfileFromId(pflId);
1711 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1714 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1716 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1719 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1722 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1724 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1727 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1730 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1732 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1733 return convertVecPairVecStToPy(ret);
1736 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1738 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1739 return convertVecPairVecStToPy(ret);
1742 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1744 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1745 self->changePflsNames(v);
1748 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1750 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1751 self->changePflsRefsNamesGen(v);
1754 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1756 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1757 self->changePflsNamesInStruct(v);
1760 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1762 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1763 self->changeLocsNames(v);
1766 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1768 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1769 self->changeLocsRefsNamesGen(v);
1772 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1774 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1775 self->changeLocsNamesInStruct(v);
1778 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1780 std::ostringstream oss;
1781 self->simpleReprGlobs(oss);
1787 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1790 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1791 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1792 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1793 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1794 void loadArrays() throw(INTERP_KERNEL::Exception);
1795 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1796 void unloadArrays() throw(INTERP_KERNEL::Exception);
1797 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1798 int getDimension() const throw(INTERP_KERNEL::Exception);
1799 int getIteration() const throw(INTERP_KERNEL::Exception);
1800 int getOrder() const throw(INTERP_KERNEL::Exception);
1801 std::string getName() throw(INTERP_KERNEL::Exception);
1802 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1803 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1804 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1805 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1806 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1807 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1808 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1809 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1810 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1811 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1812 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1813 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1814 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1815 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1816 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1819 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1822 double tmp0=self->getTime(tmp1,tmp2);
1823 PyObject *res = PyList_New(3);
1824 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1825 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1826 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1830 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1832 std::pair<int,int> res=self->getDtIt();
1833 PyObject *elt=PyTuple_New(2);
1834 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1835 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1839 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1841 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1844 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1846 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1849 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1851 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1852 return self->changeMeshNames(modifTab);
1855 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1857 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1858 PyObject *ret2=PyList_New(ret.size());
1859 for(int i=0;i<(int)ret.size();i++)
1860 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1864 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1866 std::vector<int> ret1;
1867 int ret0=self->getNonEmptyLevels(mname,ret1);
1868 PyObject *elt=PyTuple_New(2);
1869 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1870 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1874 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1876 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1877 std::vector< std::vector<TypeOfField> > typesF;
1878 std::vector< std::vector<std::string> > pfls;
1879 std::vector< std::vector<std::string> > locs;
1880 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1882 PyObject *ret2=PyList_New(sz);
1883 for(int i=0;i<sz;i++)
1885 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1886 const std::vector<TypeOfField>& typesFI=typesF[i];
1887 const std::vector<std::string>& pflsI=pfls[i];
1888 const std::vector<std::string>& locsI=locs[i];
1889 PyObject *elt=PyTuple_New(2);
1890 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1891 int sz2=ret[i].size();
1892 PyObject *elt2=PyList_New(sz2);
1893 for(int j=0;j<sz2;j++)
1895 PyObject *elt3=PyTuple_New(4);
1896 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1897 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));
1898 PyTuple_SetItem(elt3,1,elt4);
1899 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1900 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1901 PyList_SetItem(elt2,j,elt3);
1903 PyTuple_SetItem(elt,1,elt2);
1904 PyList_SetItem(ret2,i,elt);
1909 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1911 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1912 std::size_t sz=ret.size();
1913 PyObject *retPy=PyList_New(sz);
1914 for(std::size_t i=0;i<sz;i++)
1915 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1919 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1921 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1922 std::size_t sz=ret.size();
1923 PyObject *retPy=PyList_New(sz);
1924 for(std::size_t i=0;i<sz;i++)
1925 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1929 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1931 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1932 std::size_t sz=ret.size();
1933 PyObject *retPy=PyList_New(sz);
1934 for(std::size_t i=0;i<sz;i++)
1935 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1941 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1944 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1945 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1946 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1947 static MEDFileField1TS *New();
1948 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1949 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1950 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1951 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1952 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1953 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1955 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1956 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1957 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1958 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1961 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1963 return MEDFileField1TS::New(fileName,loadAll);
1966 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1968 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1971 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1973 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1978 return MEDFileField1TS::New();
1981 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1983 const DataArrayDouble *arr=0;
1985 arr=field->getArray();
1986 self->copyTinyInfoFrom(field,arr);
1989 std::string __str__() const throw(INTERP_KERNEL::Exception)
1991 return self->simpleRepr();
1994 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1996 DataArrayInt *ret1=0;
1997 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1998 PyObject *ret=PyTuple_New(2);
1999 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2000 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2004 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2006 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2007 std::vector< std::vector<TypeOfField> > typesF;
2008 std::vector< std::vector<std::string> > pfls;
2009 std::vector< std::vector<std::string> > locs;
2010 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2012 PyObject *ret2=PyList_New(sz);
2013 for(int i=0;i<sz;i++)
2015 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2016 const std::vector<TypeOfField>& typesFI=typesF[i];
2017 const std::vector<std::string>& pflsI=pfls[i];
2018 const std::vector<std::string>& locsI=locs[i];
2019 PyObject *elt=PyTuple_New(2);
2020 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2021 int sz2=ret[i].size();
2022 PyObject *elt2=PyList_New(sz2);
2023 for(int j=0;j<sz2;j++)
2025 PyObject *elt3=PyTuple_New(4);
2026 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2027 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2028 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2029 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2030 PyList_SetItem(elt2,j,elt3);
2032 PyTuple_SetItem(elt,1,elt2);
2033 PyList_SetItem(ret2,i,elt);
2038 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2040 DataArrayDouble *ret=self->getUndergroundDataArray();
2046 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2048 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2049 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2052 PyObject *ret=PyTuple_New(2);
2053 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2054 std::size_t sz=elt1Cpp.size();
2055 PyObject *elt=PyList_New(sz);
2056 for(std::size_t i=0;i<sz;i++)
2058 PyObject *elt1=PyTuple_New(2);
2059 PyObject *elt2=PyTuple_New(2);
2060 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2061 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2062 PyObject *elt3=PyTuple_New(2);
2063 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2064 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2065 PyTuple_SetItem(elt1,0,elt2);
2066 PyTuple_SetItem(elt1,1,elt3);
2067 PyList_SetItem(elt,i,elt1);
2069 PyTuple_SetItem(ret,1,elt);
2075 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2078 static MEDFileIntField1TS *New();
2079 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2080 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2081 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2082 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2084 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2085 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2088 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2090 return MEDFileIntField1TS::New();
2093 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2095 return MEDFileIntField1TS::New(fileName,loadAll);
2098 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2100 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2103 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2105 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2108 std::string __str__() const throw(INTERP_KERNEL::Exception)
2110 return self->simpleRepr();
2113 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2115 DataArrayInt *ret1=0;
2116 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2117 PyObject *ret=PyTuple_New(2);
2118 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2119 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2123 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2125 DataArrayInt *ret1=0;
2126 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2127 PyObject *ret=PyTuple_New(2);
2128 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2129 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2133 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2135 DataArrayInt *ret1=0;
2136 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2137 PyObject *ret=PyTuple_New(2);
2138 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2139 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2143 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2145 DataArrayInt *ret1=0;
2146 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2147 PyObject *ret=PyTuple_New(2);
2148 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2149 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2153 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2155 DataArrayInt *ret1=0;
2156 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2157 PyObject *ret=PyTuple_New(2);
2158 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2159 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2163 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2165 DataArrayInt *ret1=0;
2166 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2167 PyObject *ret=PyTuple_New(2);
2168 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2173 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2175 DataArrayInt *ret=self->getUndergroundDataArray();
2183 class MEDFileAnyTypeFieldMultiTSIterator
2188 PyObject *next() throw(INTERP_KERNEL::Exception)
2190 MEDFileAnyTypeField1TS *ret=self->nextt();
2192 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2195 PyErr_SetString(PyExc_StopIteration,"No more data.");
2202 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2205 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2206 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2207 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2208 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2209 std::string getName() const throw(INTERP_KERNEL::Exception);
2210 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2211 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2212 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2213 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2214 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2215 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2216 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2217 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2218 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2219 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2220 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2221 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2222 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2223 void loadArrays() throw(INTERP_KERNEL::Exception);
2224 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2225 void unloadArrays() throw(INTERP_KERNEL::Exception);
2226 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2228 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2229 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2230 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2231 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2232 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2235 int __len__() const throw(INTERP_KERNEL::Exception)
2237 return self->getNumberOfTS();
2240 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2242 if(elt0 && PyInt_Check(elt0))
2244 int pos=PyInt_AS_LONG(elt0);
2247 else if(elt0 && PyTuple_Check(elt0))
2249 if(PyTuple_Size(elt0)==2)
2251 PyObject *o0=PyTuple_GetItem(elt0,0);
2252 PyObject *o1=PyTuple_GetItem(elt0,1);
2253 if(PyInt_Check(o0) && PyInt_Check(o1))
2255 int iter=PyInt_AS_LONG(o0);
2256 int order=PyInt_AS_LONG(o1);
2257 return self->getPosOfTimeStep(iter,order);
2260 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 !");
2263 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 !");
2265 else if(elt0 && PyFloat_Check(elt0))
2267 double val=PyFloat_AS_DOUBLE(elt0);
2268 return self->getPosGivenTime(val);
2271 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2274 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2276 std::vector< std::pair<int,int> > res=self->getIterations();
2277 PyObject *ret=PyList_New(res.size());
2279 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2281 PyObject *elt=PyTuple_New(2);
2282 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2283 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2284 PyList_SetItem(ret,rk,elt);
2289 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2291 std::vector<double> ret1;
2292 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2293 std::size_t sz=ret.size();
2294 PyObject *ret2=PyList_New(sz);
2295 for(std::size_t i=0;i<sz;i++)
2297 PyObject *elt=PyTuple_New(3);
2298 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2299 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2300 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2301 PyList_SetItem(ret2,i,elt);
2306 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2308 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2309 PyObject *ret2=PyList_New(ret.size());
2310 for(int i=0;i<(int)ret.size();i++)
2312 const std::vector<TypeOfField>& rett=ret[i];
2313 PyObject *ret3=PyList_New(rett.size());
2314 for(int j=0;j<(int)rett.size();j++)
2315 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2316 PyList_SetItem(ret2,i,ret3);
2321 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2323 std::vector<int> ret1;
2324 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2325 PyObject *elt=PyTuple_New(2);
2326 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2327 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2331 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2333 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2334 std::vector< std::vector<TypeOfField> > typesF;
2335 std::vector< std::vector<std::string> > pfls;
2336 std::vector< std::vector<std::string> > locs;
2337 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2339 PyObject *ret2=PyList_New(sz);
2340 for(int i=0;i<sz;i++)
2342 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2343 const std::vector<TypeOfField>& typesFI=typesF[i];
2344 const std::vector<std::string>& pflsI=pfls[i];
2345 const std::vector<std::string>& locsI=locs[i];
2346 PyObject *elt=PyTuple_New(2);
2347 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2348 int sz2=ret[i].size();
2349 PyObject *elt2=PyList_New(sz2);
2350 for(int j=0;j<sz2;j++)
2352 PyObject *elt3=PyTuple_New(4);
2353 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2354 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));
2355 PyTuple_SetItem(elt3,1,elt4);
2356 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2357 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2358 PyList_SetItem(elt2,j,elt3);
2360 PyTuple_SetItem(elt,1,elt2);
2361 PyList_SetItem(ret2,i,elt);
2366 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2368 if(PyList_Check(elts))
2370 int sz=PyList_Size(elts);
2371 std::vector<int> ret(sz);
2372 for(int i=0;i<sz;i++)
2374 PyObject *elt=PyList_GetItem(elts,i);
2375 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2381 std::vector<int> ret(1);
2382 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2387 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2389 if(PySlice_Check(elts))
2391 Py_ssize_t strt=2,stp=2,step=2;
2392 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2393 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2394 self->eraseTimeStepIds2(strt,stp,step);
2398 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2399 if(!idsToRemove.empty())
2400 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2404 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2408 std::vector<int> pos2;
2409 DataArrayInt *pos3=0;
2410 DataArrayIntTuple *pos4=0;
2411 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2416 self->eraseTimeStepIds(&pos1,&pos1+1);
2423 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2428 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2432 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2436 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2438 return self->iterator();
2441 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2443 if(elt0 && PyList_Check(elt0))
2445 int sz=PyList_Size(elt0);
2446 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2447 int *pt=da->getPointer();
2448 for(int i=0;i<sz;i++,pt++)
2450 PyObject *elt1=PyList_GetItem(elt0,i);
2451 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2453 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2455 else if(elt0 && PySlice_Check(elt0))
2457 Py_ssize_t strt=2,stp=2,step=2;
2458 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2459 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2460 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2463 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2466 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2468 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2469 return self->changeMeshNames(modifTab);
2472 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2474 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2475 std::size_t sz=ret.size();
2476 PyObject *retPy=PyList_New(sz);
2477 for(std::size_t i=0;i<sz;i++)
2478 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2482 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2484 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2485 std::size_t sz=ret.size();
2486 PyObject *retPy=PyList_New(sz);
2487 for(std::size_t i=0;i<sz;i++)
2488 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2492 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2494 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2495 std::size_t sz=ret.size();
2496 PyObject *retPy=PyList_New(sz);
2497 for(std::size_t i=0;i<sz;i++)
2498 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2502 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2505 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2506 if(SWIG_IsOK(status))
2508 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2512 std::vector<MEDFileAnyTypeField1TS *> tmp;
2513 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2514 self->pushBackTimeSteps(tmp);
2518 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2520 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2521 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2522 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2523 std::size_t sz=ret.size();
2524 PyObject *retPy=PyList_New(sz);
2525 for(std::size_t i=0;i<sz;i++)
2527 std::size_t sz2=ret[i].size();
2528 PyObject *ret1Py=PyList_New(sz2);
2529 for(std::size_t j=0;j<sz2;j++)
2531 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2534 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2536 PyList_SetItem(retPy,i,ret1Py);
2541 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2543 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2544 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2545 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2546 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2547 if(ret2.size()!=ret.size())
2549 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2550 throw INTERP_KERNEL::Exception(oss.str().c_str());
2552 std::size_t sz=ret.size();
2553 PyObject *retPy=PyList_New(sz);
2554 for(std::size_t i=0;i<sz;i++)
2556 std::size_t sz2=ret[i].size();
2557 PyObject *ret0Py=PyTuple_New(2);
2558 PyObject *ret1Py=PyList_New(sz2);
2559 for(std::size_t j=0;j<sz2;j++)
2561 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2564 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2566 PyTuple_SetItem(ret0Py,0,ret1Py);
2567 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2568 PyList_SetItem(retPy,i,ret0Py);
2575 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2578 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2579 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2580 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2582 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2583 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2584 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2585 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2586 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2588 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2589 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2590 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2593 MEDFileFieldMultiTS()
2595 return MEDFileFieldMultiTS::New();
2598 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2600 return MEDFileFieldMultiTS::New(fileName,loadAll);
2603 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2605 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2608 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2610 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2611 std::size_t sz(tmp.size());
2612 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2613 for(std::size_t i=0;i<sz;i++)
2615 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2616 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2618 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2621 std::string __str__() const throw(INTERP_KERNEL::Exception)
2623 return self->simpleRepr();
2626 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2628 DataArrayInt *ret1=0;
2629 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2630 PyObject *ret=PyTuple_New(2);
2631 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2632 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2636 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2638 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2639 std::vector< std::vector<TypeOfField> > typesF;
2640 std::vector< std::vector<std::string> > pfls;
2641 std::vector< std::vector<std::string> > locs;
2642 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2644 PyObject *ret2=PyList_New(sz);
2645 for(int i=0;i<sz;i++)
2647 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2648 const std::vector<TypeOfField>& typesFI=typesF[i];
2649 const std::vector<std::string>& pflsI=pfls[i];
2650 const std::vector<std::string>& locsI=locs[i];
2651 PyObject *elt=PyTuple_New(2);
2652 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2653 int sz2=ret[i].size();
2654 PyObject *elt2=PyList_New(sz2);
2655 for(int j=0;j<sz2;j++)
2657 PyObject *elt3=PyTuple_New(4);
2658 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2659 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2660 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2661 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2662 PyList_SetItem(elt2,j,elt3);
2664 PyTuple_SetItem(elt,1,elt2);
2665 PyList_SetItem(ret2,i,elt);
2669 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2671 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2677 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2679 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2680 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2683 PyObject *ret=PyTuple_New(2);
2684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2685 std::size_t sz=elt1Cpp.size();
2686 PyObject *elt=PyList_New(sz);
2687 for(std::size_t i=0;i<sz;i++)
2689 PyObject *elt1=PyTuple_New(2);
2690 PyObject *elt2=PyTuple_New(2);
2691 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2692 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2693 PyObject *elt3=PyTuple_New(2);
2694 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2695 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2696 PyTuple_SetItem(elt1,0,elt2);
2697 PyTuple_SetItem(elt1,1,elt3);
2698 PyList_SetItem(elt,i,elt1);
2700 PyTuple_SetItem(ret,1,elt);
2706 class MEDFileFieldsIterator
2711 PyObject *next() throw(INTERP_KERNEL::Exception)
2713 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2715 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2718 PyErr_SetString(PyExc_StopIteration,"No more data.");
2725 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2728 static MEDFileIntFieldMultiTS *New();
2729 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2730 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2732 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2733 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2734 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2737 MEDFileIntFieldMultiTS()
2739 return MEDFileIntFieldMultiTS::New();
2742 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2744 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2747 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2749 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2752 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2754 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2755 std::size_t sz(tmp.size());
2756 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2757 for(std::size_t i=0;i<sz;i++)
2759 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2760 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2762 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2765 std::string __str__() const throw(INTERP_KERNEL::Exception)
2767 return self->simpleRepr();
2770 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2772 DataArrayInt *ret1=0;
2773 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2774 PyObject *ret=PyTuple_New(2);
2775 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2776 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2780 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2782 DataArrayInt *ret1=0;
2783 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2784 PyObject *ret=PyTuple_New(2);
2785 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2786 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2790 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2792 DataArrayInt *ret1=0;
2793 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2794 PyObject *ret=PyTuple_New(2);
2795 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2796 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2800 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2802 DataArrayInt *ret1=0;
2803 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2804 PyObject *ret=PyTuple_New(2);
2805 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2806 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2810 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2812 DataArrayInt *ret1=0;
2813 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2814 PyObject *ret=PyTuple_New(2);
2815 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2820 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2822 DataArrayInt *ret1=0;
2823 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2824 PyObject *ret=PyTuple_New(2);
2825 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2826 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2830 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2832 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2840 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2843 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2844 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2845 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2846 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2847 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2848 void loadArrays() throw(INTERP_KERNEL::Exception);
2849 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2850 void unloadArrays() throw(INTERP_KERNEL::Exception);
2851 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2852 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2853 int getNumberOfFields() const;
2854 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2855 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2857 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2858 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2859 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2860 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2861 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2862 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2863 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2864 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2865 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2870 return MEDFileFields::New();
2873 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2875 return MEDFileFields::New(fileName,loadAll);
2878 std::string __str__() const throw(INTERP_KERNEL::Exception)
2880 return self->simpleRepr();
2883 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2885 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2886 std::size_t sz(tmp.size());
2887 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2888 for(std::size_t i=0;i<sz;i++)
2890 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2891 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2893 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2896 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2899 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2900 PyObject *ret=PyTuple_New(2);
2901 PyObject *ret_0=PyList_New(ret0.size());
2903 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2905 PyObject *elt=PyTuple_New(2);
2906 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2907 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2908 PyList_SetItem(ret_0,rk,elt);
2910 PyTuple_SetItem(ret,0,ret_0);
2911 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2912 PyTuple_SetItem(ret,1,ret_1);
2916 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2918 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2919 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2922 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2924 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2925 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2928 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2930 if(obj && PyList_Check(obj))
2932 int sz=PyList_Size(obj);
2933 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2934 int *pt=da->getPointer();
2935 for(int i=0;i<sz;i++,pt++)
2937 PyObject *elt1=PyList_GetItem(obj,i);
2938 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2940 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2943 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2946 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2948 self->setFieldAtPos(obj,field);
2952 int __len__() const throw(INTERP_KERNEL::Exception)
2954 return self->getNumberOfFields();
2957 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2959 return self->iterator();
2962 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2964 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2965 return self->changeMeshNames(modifTab);
2968 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2970 if(elt0 && PyInt_Check(elt0))
2972 return PyInt_AS_LONG(elt0);
2974 else if(elt0 && PyString_Check(elt0))
2975 return self->getPosFromFieldName(PyString_AsString(elt0));
2977 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2980 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2982 if(PyList_Check(elts))
2984 int sz=PyList_Size(elts);
2985 std::vector<int> ret(sz);
2986 for(int i=0;i<sz;i++)
2988 PyObject *elt=PyList_GetItem(elts,i);
2989 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2995 std::vector<int> ret(1);
2996 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
3001 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3003 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3004 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3005 self->pushFields(tmp);
3008 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3010 if(elts && PySlice_Check(elts))
3012 Py_ssize_t strt=2,stp=2,step=2;
3013 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3014 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3015 self->destroyFieldsAtPos2(strt,stp,step);
3019 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
3020 if(!idsToRemove.empty())
3021 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3027 class MEDFileParameter1TS : public RefCountObject
3030 void setIteration(int it);
3031 int getIteration() const;
3032 void setOrder(int order);
3033 int getOrder() const;
3034 void setTimeValue(double time);
3035 void setTime(int dt, int it, double time);
3036 double getTime(int& dt, int& it);
3037 double getTimeValue() const;
3040 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3043 void setValue(double val) throw(INTERP_KERNEL::Exception);
3044 double getValue() const throw(INTERP_KERNEL::Exception);
3045 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3048 std::string __str__() const throw(INTERP_KERNEL::Exception)
3050 return self->simpleRepr();
3055 class MEDFileParameterTinyInfo : public MEDFileWritable
3058 void setDescription(const std::string& name);
3059 std::string getDescription() const;
3060 void setTimeUnit(const std::string& unit);
3061 std::string getTimeUnit() const;
3064 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3067 static MEDFileParameterDouble1TS *New();
3068 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3069 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3070 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3071 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
3072 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3073 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3074 std::string getName() const throw(INTERP_KERNEL::Exception);
3075 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3078 MEDFileParameterDouble1TS()
3080 return MEDFileParameterDouble1TS::New();
3083 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3085 return MEDFileParameterDouble1TS::New(fileName);
3088 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3090 return MEDFileParameterDouble1TS::New(fileName,paramName);
3093 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3095 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3098 std::string __str__() const throw(INTERP_KERNEL::Exception)
3100 return self->simpleRepr();
3103 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3106 bool ret0=self->isEqual(other,eps,what);
3107 PyObject *res=PyList_New(2);
3108 PyObject *ret0Py=ret0?Py_True:Py_False;
3110 PyList_SetItem(res,0,ret0Py);
3111 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3117 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3120 static MEDFileParameterMultiTS *New();
3121 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3122 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3123 std::string getName() const;
3124 void setName(const std::string& name);
3125 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
3126 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3127 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3128 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3129 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3130 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3131 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3132 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3135 MEDFileParameterMultiTS()
3137 return MEDFileParameterMultiTS::New();
3140 MEDFileParameterMultiTS(const std::string& fileName)
3142 return MEDFileParameterMultiTS::New(fileName);
3145 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3147 return MEDFileParameterMultiTS::New(fileName,paramName);
3150 std::string __str__() const throw(INTERP_KERNEL::Exception)
3152 return self->simpleRepr();
3155 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3158 bool ret0=self->isEqual(other,eps,what);
3159 PyObject *res=PyList_New(2);
3160 PyObject *ret0Py=ret0?Py_True:Py_False;
3162 PyList_SetItem(res,0,ret0Py);
3163 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3167 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3171 std::vector<int> pos2;
3172 DataArrayInt *pos3=0;
3173 DataArrayIntTuple *pos4=0;
3174 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3179 self->eraseTimeStepIds(&pos1,&pos1+1);
3186 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3191 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3195 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3199 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3201 if(elt0 && PyInt_Check(elt0))
3203 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3206 else if(elt0 && PyTuple_Check(elt0))
3208 if(PyTuple_Size(elt0)==2)
3210 PyObject *o0=PyTuple_GetItem(elt0,0);
3211 PyObject *o1=PyTuple_GetItem(elt0,1);
3212 if(PyInt_Check(o0) && PyInt_Check(o1))
3214 int iter=PyInt_AS_LONG(o0);
3215 int order=PyInt_AS_LONG(o1);
3216 return self->getPosOfTimeStep(iter,order);
3219 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 !");
3222 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 !");
3224 else if(elt0 && PyFloat_Check(elt0))
3226 double val=PyFloat_AS_DOUBLE(elt0);
3227 return self->getPosGivenTime(val);
3230 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3233 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3235 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3241 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3243 if(PyList_Check(elts))
3245 int sz=PyList_Size(elts);
3246 std::vector<int> ret(sz);
3247 for(int i=0;i<sz;i++)
3249 PyObject *elt=PyList_GetItem(elts,i);
3250 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3256 std::vector<int> ret(1);
3257 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3262 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3264 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3265 if(!idsToRemove.empty())
3266 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3269 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3271 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3277 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3279 std::vector< std::pair<int,int> > res=self->getIterations();
3280 PyObject *ret=PyList_New(res.size());
3282 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3284 PyObject *elt=PyTuple_New(2);
3285 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3286 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3287 PyList_SetItem(ret,rk,elt);
3292 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3294 std::vector<double> res2;
3295 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3296 PyObject *ret=PyList_New(res.size());
3298 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3300 PyObject *elt=PyTuple_New(3);
3301 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3302 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3303 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3304 PyList_SetItem(ret,rk,elt);
3311 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3314 static MEDFileParameters *New();
3315 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3316 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3317 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3318 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3319 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3320 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3321 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3322 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3323 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3324 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3325 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3330 return MEDFileParameters::New();
3333 MEDFileParameters(const std::string& fileName)
3335 return MEDFileParameters::New(fileName);
3338 std::string __str__() const throw(INTERP_KERNEL::Exception)
3340 return self->simpleRepr();
3343 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3345 if(PyInt_Check(obj))
3347 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3352 else if(PyString_Check(obj))
3354 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3360 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3363 int __len__() const throw(INTERP_KERNEL::Exception)
3365 return self->getNumberOfParams();
3368 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3370 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3376 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3378 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3384 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3387 bool ret0=self->isEqual(other,eps,what);
3388 PyObject *res=PyList_New(2);
3389 PyObject *ret0Py=ret0?Py_True:Py_False;
3391 PyList_SetItem(res,0,ret0Py);
3392 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3398 class MEDFileData : public RefCountObject, public MEDFileWritable
3401 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3402 static MEDFileData *New();
3403 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3404 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3405 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3406 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3407 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3408 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3409 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3411 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3412 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3414 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3417 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3419 return MEDFileData::New(fileName);
3424 return MEDFileData::New();
3427 std::string __str__() const throw(INTERP_KERNEL::Exception)
3429 return self->simpleRepr();
3432 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3434 MEDFileMeshes *ret=self->getMeshes();
3440 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3442 MEDFileParameters *ret=self->getParams();
3448 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3450 MEDFileFields *ret=self->getFields();
3456 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3458 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3459 return self->changeMeshNames(modifTab);
3464 class SauvReader : public RefCountObject
3467 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3468 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3471 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3473 return SauvReader::New(fileName);
3478 class SauvWriter : public RefCountObject
3481 static SauvWriter * New();
3482 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3483 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3484 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3485 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3488 SauvWriter() throw(INTERP_KERNEL::Exception)
3490 return SauvWriter::New();
3497 class MEDFileMeshStruct;
3499 class MEDFileField1TSStructItem
3502 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3505 class MEDFileMeshStruct : public RefCountObject
3508 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3510 ~MEDFileMeshStruct();
3513 class MEDMeshMultiLev : public RefCountObject
3516 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3517 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3523 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3525 DataArrayInt *famIds(0);
3526 bool isWithoutCopy(false);
3527 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3528 PyObject *ret=PyTuple_New(2);
3529 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3531 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3532 PyTuple_SetItem(ret,1,ret1Py);
3536 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3538 DataArrayInt *numIds(0);
3539 bool isWithoutCopy(false);
3540 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3541 PyObject *ret=PyTuple_New(2);
3542 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3544 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3545 PyTuple_SetItem(ret,1,ret1Py);
3549 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3551 DataArrayInt *famIds(0);
3552 bool isWithoutCopy(false);
3553 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3554 PyObject *ret=PyTuple_New(2);
3555 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3557 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3558 PyTuple_SetItem(ret,1,ret1Py);
3562 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3564 DataArrayInt *numIds(0);
3565 bool isWithoutCopy(false);
3566 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3567 PyObject *ret=PyTuple_New(2);
3568 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3570 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3571 PyTuple_SetItem(ret,1,ret1Py);
3575 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3577 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3578 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3579 PyObject *res(PyList_New(result.size()));
3580 for(int i=0;iL!=result.end(); i++, iL++)
3581 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3587 class MEDUMeshMultiLev : public MEDMeshMultiLev
3590 ~MEDUMeshMultiLev();
3594 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3596 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3597 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3598 PyObject *ret0Py=ncc?Py_True:Py_False;
3600 PyObject *ret=PyTuple_New(7);
3601 PyTuple_SetItem(ret,0,ret0Py);
3602 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3603 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3604 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3605 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3606 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3607 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3613 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3616 ~MEDStructuredMeshMultiLev();
3619 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3622 ~MEDCMeshMultiLev();
3626 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3629 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3630 std::size_t sz(objs.size());
3631 PyObject *ret(PyTuple_New(2));
3632 PyObject *ret0=PyList_New(sz);
3633 for(std::size_t i=0;i<sz;i++)
3634 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3635 PyTuple_SetItem(ret,0,ret0);
3636 PyObject *ret1Py(isInternal?Py_True:Py_False);
3638 PyTuple_SetItem(ret,1,ret1Py);
3644 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3647 ~MEDCurveLinearMeshMultiLev();
3651 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3653 DataArrayDouble *ret0(0);
3654 std::vector<int> ret1;
3656 self->buildVTUArrays(ret0,ret1,ret2);
3657 std::size_t sz(ret1.size());
3658 PyObject *ret=PyTuple_New(3);
3659 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3660 PyObject *ret1Py=PyList_New(sz);
3661 for(std::size_t i=0;i<sz;i++)
3662 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3663 PyTuple_SetItem(ret,1,ret1Py);
3664 PyObject *ret2Py(ret2?Py_True:Py_False);
3666 PyTuple_SetItem(ret,2,ret2Py);
3672 class MEDFileFastCellSupportComparator : public RefCountObject
3675 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3676 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3677 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3678 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3680 ~MEDFileFastCellSupportComparator();
3684 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3686 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3687 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3688 PyObject *res(PyList_New(result.size()));
3689 for(int i=0;iL!=result.end(); i++, iL++)
3690 PyList_SetItem(res,i,PyInt_FromLong(*iL));