1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileJoint.hxx"
31 #include "MEDFileMesh.hxx"
32 #include "MEDFileField.hxx"
33 #include "MEDFileParameter.hxx"
34 #include "MEDFileData.hxx"
35 #include "MEDFileMeshReadSelector.hxx"
36 #include "MEDFileFieldOverView.hxx"
37 #include "MEDLoaderTypemaps.i"
38 #include "SauvReader.hxx"
39 #include "SauvWriter.hxx"
41 using namespace ParaMEDMEM;
44 #if SWIG_VERSION >= 0x010329
45 %template() std::vector<std::string>;
48 %typemap(out) ParaMEDMEM::MEDFileMesh*
50 $result=convertMEDFileMesh($1,$owner);
53 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
55 $result=convertMEDFileParameter1TS($1,$owner);
58 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
60 $result=convertMEDFileFieldMultiTS($1,$owner);
63 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
65 $result=convertMEDFileField1TS($1,$owner);
68 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
70 $result=convertMEDMeshMultiLev($1,$owner);
73 %newobject MEDLoader::ReadUMeshFromFamilies;
74 %newobject MEDLoader::ReadUMeshFromGroups;
75 %newobject MEDLoader::ReadUMeshFromFile;
76 %newobject MEDLoader::ReadMeshFromFile;
77 %newobject MEDLoader::ReadField;
78 %newobject MEDLoader::ReadFieldCell;
79 %newobject MEDLoader::ReadFieldNode;
80 %newobject MEDLoader::ReadFieldGauss;
81 %newobject MEDLoader::ReadFieldGaussNE;
82 %newobject ParaMEDMEM::MEDFileMesh::New;
83 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
84 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
86 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
95 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
96 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
97 %newobject ParaMEDMEM::MEDFileData::getJoints;
98 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
99 %newobject ParaMEDMEM::MEDFileUMesh::New;
100 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
101 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
102 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
103 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
104 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
105 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
106 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
107 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
111 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
112 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
113 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
114 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
115 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
116 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
117 %newobject ParaMEDMEM::MEDFileUMesh::__getitem__;
118 %newobject ParaMEDMEM::MEDFileUMesh::linearToQuadratic;
119 %newobject ParaMEDMEM::MEDFileUMesh::quadraticToLinear;
120 %newobject ParaMEDMEM::MEDFileCMesh::New;
121 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
122 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
123 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
124 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
125 %newobject ParaMEDMEM::MEDFileMeshes::New;
126 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
127 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
128 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
129 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
130 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
132 %newobject ParaMEDMEM::MEDFileFields::New;
133 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
134 %newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
135 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
136 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
137 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
138 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
139 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
140 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
141 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
142 %newobject ParaMEDMEM::MEDFileFields::__iter__;
144 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
145 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
146 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
147 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
148 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
149 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
150 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
152 %newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
153 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
154 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
155 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
156 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
157 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
158 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
159 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
160 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
161 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
162 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
164 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
165 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
166 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
167 %newobject ParaMEDMEM::MEDFileField1TS::New;
168 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
169 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
170 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
171 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
172 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
173 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
174 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
175 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
176 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
178 %newobject ParaMEDMEM::MEDFileData::New;
179 %newobject ParaMEDMEM::MEDFileData::deepCpy;
180 %newobject ParaMEDMEM::MEDFileData::getMeshes;
181 %newobject ParaMEDMEM::MEDFileData::getFields;
182 %newobject ParaMEDMEM::MEDFileData::getParams;
184 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
185 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
186 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
187 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
188 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
189 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
190 %newobject ParaMEDMEM::MEDFileParameters::New;
191 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
192 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
193 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
194 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
196 %newobject ParaMEDMEM::MEDFileJointCorrespondence::New;
197 %newobject ParaMEDMEM::MEDFileJointCorrespondence::deepCpy;
198 %newobject ParaMEDMEM::MEDFileJointCorrespondence::shallowCpy;
199 %newobject ParaMEDMEM::MEDFileJointOneStep::New;
200 %newobject ParaMEDMEM::MEDFileJointOneStep::deepCpy;
201 %newobject ParaMEDMEM::MEDFileJointOneStep::shallowCpy;
202 %newobject ParaMEDMEM::MEDFileJoint::New;
203 %newobject ParaMEDMEM::MEDFileJoint::deepCpy;
204 %newobject ParaMEDMEM::MEDFileJoint::shallowCpy;
205 %newobject ParaMEDMEM::MEDFileJoints::New;
206 %newobject ParaMEDMEM::MEDFileJoints::deepCpy;
207 %newobject ParaMEDMEM::MEDFileJoints::getJointAtPos;
208 %newobject ParaMEDMEM::MEDFileJoints::getJointWithName;
209 %newobject ParaMEDMEM::MEDFileJoints::__getitem__;
211 %newobject ParaMEDMEM::SauvWriter::New;
212 %newobject ParaMEDMEM::SauvReader::New;
213 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
215 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
216 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
217 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
218 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
219 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
221 %feature("unref") MEDFileMesh "$this->decrRef();"
222 %feature("unref") MEDFileUMesh "$this->decrRef();"
223 %feature("unref") MEDFileCMesh "$this->decrRef();"
224 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
225 %feature("unref") MEDFileMeshes "$this->decrRef();"
226 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
227 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
228 %feature("unref") MEDFileField1TS "$this->decrRef();"
229 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
230 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
231 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
232 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
233 %feature("unref") MEDFileFields "$this->decrRef();"
234 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
235 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
236 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
237 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
238 %feature("unref") MEDFileParameters "$this->decrRef();"
239 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
240 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
241 %feature("unref") MEDFileJoint "$this->decrRef();"
242 %feature("unref") MEDFileJoints "$this->decrRef();"
243 %feature("unref") MEDFileData "$this->decrRef();"
244 %feature("unref") SauvReader "$this->decrRef();"
245 %feature("unref") SauvWriter "$this->decrRef();"
246 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
247 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
248 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
249 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
250 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
251 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
256 static bool HasXDR();
257 static std::string MEDFileVersionStr();
258 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
259 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
260 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
261 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
262 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
263 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
264 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
265 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
266 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
267 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
268 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
269 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
270 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
271 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
272 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
273 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
274 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
277 static PyObject *MEDFileVersion()
279 int major,minor,release;
280 MEDLoader::MEDFileVersion(major,minor,release);
281 PyObject *ret(PyTuple_New(3));
282 PyTuple_SetItem(ret,0,SWIG_From_int(major));
283 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
284 PyTuple_SetItem(ret,2,SWIG_From_int(release));
288 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
290 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
291 PyObject *ret=PyList_New(res.size());
293 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
295 PyObject *elt=PyTuple_New(2);
296 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
297 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
298 PyList_SetItem(ret,rk,elt);
303 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
305 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
306 PyObject *ret=PyList_New(res.size());
308 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
310 PyObject *elt=PyTuple_New(3);
311 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
312 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
313 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
314 PyList_SetItem(ret,rk,elt);
319 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
321 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
322 PyObject *ret=PyList_New(res.size());
324 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
326 PyObject *elt=PyTuple_New(2);
327 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
328 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
329 PyList_SetItem(ret,rk,elt);
333 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
335 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
336 PyObject *ret=PyList_New(res.size());
338 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
340 PyObject *elt=PyTuple_New(2);
341 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
342 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
343 PyList_SetItem(ret,rk,elt);
347 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
349 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
350 PyObject *ret=PyList_New(res.size());
352 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
354 PyObject *elt=PyTuple_New(2);
355 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
356 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
357 PyList_SetItem(ret,rk,elt);
361 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
363 int meshDim,spaceDim,numberOfNodes;
364 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
365 PyObject *ret=PyTuple_New(4);
366 PyObject *elt0=PyList_New(res.size());
368 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
370 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
372 PyObject *elt1=PyList_New(obj2.size());
373 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
375 PyObject *elt2=PyTuple_New(2);
376 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
377 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
378 PyList_SetItem(elt1,j,elt2);
380 PyList_SetItem(elt0,i,elt1);
382 PyTuple_SetItem(ret,0,elt0);
383 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
384 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
385 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
388 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
389 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
391 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
392 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
393 return convertFieldDoubleVecToPy(res);
395 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
397 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
398 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
399 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
401 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
403 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
404 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
405 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
407 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
409 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
410 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
411 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
413 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
415 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
417 PyObject *ret=PyList_New(size);
418 for(int i=0;i<size;i++)
419 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
422 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
424 std::vector<std::string> grps;
425 converPyListToVecString(li,grps);
426 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
428 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
430 std::vector<std::string> fams;
431 converPyListToVecString(li,fams);
432 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
435 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
436 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
437 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
438 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
439 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
440 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);
441 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);
442 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);
443 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);
444 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);
445 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
446 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
447 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
448 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
449 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
450 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
455 class MEDFileWritable
458 void copyOptionsFrom(const MEDFileWritable& other) const;
459 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
460 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
461 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
462 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
465 class MEDFileMeshReadSelector
468 MEDFileMeshReadSelector();
469 MEDFileMeshReadSelector(unsigned int code);
470 unsigned int getCode() const;
471 void setCode(unsigned int newCode);
472 bool isCellFamilyFieldReading() const;
473 bool isNodeFamilyFieldReading() const;
474 bool isCellNameFieldReading() const;
475 bool isNodeNameFieldReading() const;
476 bool isCellNumFieldReading() const;
477 bool isNodeNumFieldReading() const;
478 void setCellFamilyFieldReading(bool b);
479 void setNodeFamilyFieldReading(bool b);
480 void setCellNameFieldReading(bool b);
481 void setNodeNameFieldReading(bool b);
482 void setCellNumFieldReading(bool b);
483 void setNodeNumFieldReading(bool b);
486 std::string __str__() const throw(INTERP_KERNEL::Exception)
488 std::ostringstream oss;
493 std::string __repr__() const throw(INTERP_KERNEL::Exception)
495 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
500 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
503 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
504 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
505 throw(INTERP_KERNEL::Exception);
506 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
507 INTERP_KERNEL::NormalizedCellType loc_geo_type,
508 INTERP_KERNEL::NormalizedCellType rem_geo_type)
509 throw(INTERP_KERNEL::Exception);
510 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
511 MEDFileJointCorrespondence *deepCpy() const;
512 MEDFileJointCorrespondence *shallowCpy() const;
513 void setIsNodal(bool isNodal);
514 bool getIsNodal() const;
515 bool isEqual(const MEDFileJointCorrespondence *other) const;
516 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
517 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
518 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
519 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
520 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
521 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
522 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);
523 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
526 MEDFileJointCorrespondence()
528 return MEDFileJointCorrespondence::New();
530 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
532 return MEDFileJointCorrespondence::New(correspondence);
534 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
535 INTERP_KERNEL::NormalizedCellType loc_geo_type,
536 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
538 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
541 std::string __str__() const throw(INTERP_KERNEL::Exception)
543 return self->simpleRepr();
548 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
551 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
552 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
553 MEDFileJointOneStep *deepCpy() const;
554 MEDFileJointOneStep *shallowCpy() const;
555 bool isEqual(const MEDFileJointOneStep *other) const;
556 void setOrder(int order);
557 int getOrder() const;
558 void setIteration(int it);
559 int getIteration() const;
560 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
561 int getNumberOfCorrespondences() const;
562 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
563 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
564 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
567 MEDFileJointOneStep()
569 return MEDFileJointOneStep::New();
572 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
574 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
577 std::string __str__() const throw(INTERP_KERNEL::Exception)
579 return self->simpleRepr();
583 class MEDFileJoint : public RefCountObject, public MEDFileWritable
586 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
587 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
588 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
589 MEDFileJoint *deepCpy() const;
590 MEDFileJoint *shallowCpy() const;
591 bool isEqual(const MEDFileJoint *other) const;
592 void setLocalMeshName(const std::string& name);
593 std::string getLocalMeshName() const;
594 void setRemoteMeshName(const std::string& name);
595 std::string getRemoteMeshName() const;
596 void setDescription(const std::string& name);
597 std::string getDescription() const;
598 void setJointName(const std::string& name);
599 std::string getJointName() const;
600 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
601 void setDomainNumber(const int& number);
602 int getDomainNumber() const;
603 void pushStep(MEDFileJointOneStep* step);
604 int getNumberOfSteps() const;
605 MEDFileJointOneStep *getStepAtPos(int i) const;
606 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
607 std::string simpleRepr() const;
612 return MEDFileJoint::New();
615 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
617 return MEDFileJoint::New(fileName,mName,num);
620 std::string __str__() const throw(INTERP_KERNEL::Exception)
622 return self->simpleRepr();
627 class MEDFileJoints : public RefCountObject, public MEDFileWritable
630 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
631 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
632 MEDFileJoints *deepCpy() const;
633 std::string simpleRepr() const;
634 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
635 std::string getMeshName() const;
636 int getNumberOfJoints() const;
637 std::vector<std::string> getJointsNames() const;
638 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
639 void resize(int newSize) throw(INTERP_KERNEL::Exception);
640 void pushJoint(MEDFileJoint *joint);
641 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
642 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
647 return MEDFileJoints::New();
650 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
652 return MEDFileJoints::New(fileName,meshName);
655 std::string __str__() const throw(INTERP_KERNEL::Exception)
657 return self->simpleRepr();
660 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
664 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
669 else if(PyString_Check(obj))
671 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
677 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
680 int __len__() const throw(INTERP_KERNEL::Exception)
682 return self->getNumberOfJoints();
685 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
687 MEDFileJoint *ret=self->getJointAtPos(i);
693 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
695 MEDFileJoint *ret=self->getJointWithName(paramName);
703 class MEDFileMesh : public RefCountObject, public MEDFileWritable
706 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
707 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
708 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
709 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
710 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
711 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
712 void setName(const std::string& name);
713 std::string getName();
714 std::string getUnivName() const;
715 bool getUnivNameWrStatus() const;
716 void setUnivNameWrStatus(bool newStatus);
717 void setDescription(const std::string& name);
718 std::string getDescription() const;
719 void setOrder(int order);
720 int getOrder() const;
721 void setIteration(int it);
723 void setTimeValue(double time);
724 void setTime(int dt, int it, double time);
725 double getTimeValue() const;
726 void setTimeUnit(const std::string& unit);
727 std::string getTimeUnit() const;
728 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
729 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
730 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
731 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
732 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
733 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
734 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
735 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
736 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
737 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
738 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
739 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
740 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
742 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
743 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
744 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
745 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
746 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
747 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
748 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
749 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
750 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
751 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
752 void clearGrpMap() throw(INTERP_KERNEL::Exception);
753 void clearFamMap() throw(INTERP_KERNEL::Exception);
754 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
755 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
756 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
757 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
758 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
759 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
760 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
761 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
762 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
763 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
764 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
765 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
766 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
767 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
768 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
769 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
770 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
771 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
772 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
773 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
774 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
775 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
776 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
777 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
778 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
779 void setFamilyInfo(const std::map<std::string,int>& info);
780 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
781 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
782 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
783 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
784 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
785 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
786 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
787 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
788 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
789 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
790 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
791 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
792 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
793 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
794 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
795 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
796 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
797 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
798 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
799 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
800 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
802 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
803 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
804 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
805 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
806 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
807 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
808 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
809 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
810 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
811 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
812 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
813 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
814 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
815 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
816 int getNumberOfJoints();
817 MEDFileJoints *getJoints();
818 void setJoints( MEDFileJoints* joints );
821 std::string __str__() const throw(INTERP_KERNEL::Exception)
823 return self->simpleRepr();
826 PyObject *getTime() throw(INTERP_KERNEL::Exception)
829 double tmp0=self->getTime(tmp1,tmp2);
830 PyObject *res = PyList_New(3);
831 PyList_SetItem(res,0,SWIG_From_int(tmp1));
832 PyList_SetItem(res,1,SWIG_From_int(tmp2));
833 PyList_SetItem(res,2,SWIG_From_double(tmp0));
837 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
840 bool ret0=self->isEqual(other,eps,what);
841 PyObject *res=PyList_New(2);
842 PyObject *ret0Py=ret0?Py_True:Py_False;
844 PyList_SetItem(res,0,ret0Py);
845 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
849 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
851 std::vector<const DataArrayInt *> grps;
852 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
853 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
856 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
859 bool ret0=self->areFamsEqual(other,what);
860 PyObject *res=PyList_New(2);
861 PyObject *ret0Py=ret0?Py_True:Py_False;
863 PyList_SetItem(res,0,ret0Py);
864 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
868 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
871 bool ret0=self->areGrpsEqual(other,what);
872 PyObject *res=PyList_New(2);
873 PyObject *ret0Py=ret0?Py_True:Py_False;
875 PyList_SetItem(res,0,ret0Py);
876 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
880 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
882 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
883 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
884 PyObject *res=PyList_New(result.size());
885 for(int i=0;iL!=result.end(); i++, iL++)
886 PyList_SetItem(res,i,PyInt_FromLong(*iL));
890 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
892 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
893 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
894 PyObject *res=PyList_New(result.size());
895 for(int i=0;iL!=result.end(); i++, iL++)
896 PyList_SetItem(res,i,PyInt_FromLong(*iL));
900 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
902 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
905 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
908 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
910 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
913 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
916 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
918 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
921 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
924 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
926 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
929 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
932 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
934 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
937 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
940 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
943 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
944 PyObject *ret=PyTuple_New(2);
945 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
946 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
950 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
952 DataArrayInt *ret3=0;
953 std::vector<int> ret1,ret2;
954 bool ret0=self->unPolyze(ret1,ret2,ret3);
955 PyObject *ret=PyTuple_New(4);
956 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
958 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
959 for(int j=0;j<(int)ret1.size()/3;j++)
961 PyObject *retLev2=PyList_New(3);
962 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
963 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
964 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
965 PyList_SetItem(retLev1_0,j,retLev2);
967 PyTuple_SetItem(ret,1,retLev1_0);
969 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
970 for(int j=0;j<(int)ret2.size()/3;j++)
972 PyObject *retLev2=PyList_New(3);
973 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
974 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
975 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
976 PyList_SetItem(retLev1_1,j,retLev2);
978 PyTuple_SetItem(ret,2,retLev1_1);
980 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
986 class MEDFileUMesh : public MEDFileMesh
989 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
990 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
991 static MEDFileUMesh *New();
993 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
994 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
996 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
997 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
998 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
999 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1000 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1001 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1002 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1003 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1004 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1005 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1006 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1007 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1008 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1009 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1010 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
1011 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1012 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1013 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1014 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1015 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1017 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1018 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1019 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1020 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1021 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1022 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1023 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1024 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1025 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1026 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1027 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1028 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1029 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1032 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1034 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1037 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1039 return MEDFileUMesh::New(fileName,mrs);
1044 return MEDFileUMesh::New();
1048 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1050 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1053 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)
1055 std::vector<int> typesCpp1;
1056 convertPyToNewIntArr3(types,typesCpp1);
1057 std::size_t sz(typesCpp1.size());
1058 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1059 for(std::size_t ii=0;ii<sz;ii++)
1060 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1061 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1064 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1065 {// put an empty dict in input to say to __new__ to call __init__...
1066 PyObject *ret(PyTuple_New(1));
1067 PyObject *ret0(PyDict_New());
1068 PyTuple_SetItem(ret,0,ret0);
1072 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1074 std::vector<double> a0;
1075 std::vector<int> a1;
1076 std::vector<std::string> a2;
1077 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1078 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1079 self->serialize(a0,a1,a2,a3,a4);
1080 PyObject *ret(PyTuple_New(5));
1081 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1082 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1084 PyObject *ret2(PyList_New(sz));
1085 for(int i=0;i<sz;i++)
1086 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1087 PyTuple_SetItem(ret,2,ret2);
1089 PyObject *ret3(PyList_New(sz));
1090 for(int i=0;i<sz;i++)
1092 DataArrayInt *elt(a3[i]);
1095 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1097 PyTuple_SetItem(ret,3,ret3);
1098 DataArrayDouble *ret4(a4);
1101 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1105 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1107 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1108 if(!PyTuple_Check(inp))
1109 throw INTERP_KERNEL::Exception(MSG);
1110 int sz(PyTuple_Size(inp));
1112 throw INTERP_KERNEL::Exception(MSG);
1113 std::vector<double> a0;
1114 std::vector<int> a1;
1115 std::vector<std::string> a2;
1116 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
1117 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
1119 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1121 fillArrayWithPyListDbl3(a0py,tmp,a0);
1122 convertPyToNewIntArr3(a1py,a1);
1123 fillStringVector(a2py,a2);
1125 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1127 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
1128 if(!SWIG_IsOK(status))
1129 throw INTERP_KERNEL::Exception(MSG);
1130 a4=reinterpret_cast<DataArrayDouble *>(argp);
1131 if((DataArrayDouble *)a4)
1134 std::vector< DataArrayInt * > a3Tmp;
1135 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
1136 std::size_t sz(a3Tmp.size());
1138 for(std::size_t i=0;i<sz;i++)
1142 a3Tmp[i]->incrRef();
1144 self->unserialize(a0,a1,a2,a3,a4);
1148 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1150 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1153 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1156 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1157 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1160 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1163 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1166 self->setMeshAtLevel(meshDimRelToMax,m1);
1169 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1172 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1174 self->removeMeshAtLevel(meshDimRelToMax);
1177 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1179 std::vector<const MEDCouplingUMesh *> ms;
1180 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1181 self->setMeshes(ms,renum);
1184 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1186 std::vector<const MEDCouplingUMesh *> ms;
1187 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1188 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1191 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1193 std::vector<const MEDCouplingUMesh *> ms;
1194 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1195 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1198 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1200 DataArrayDouble *ret=self->getCoords();
1206 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1208 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1211 return const_cast<PartDefinition *>(ret);
1214 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1216 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1217 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
1218 PyObject *ret=PyTuple_New(3);
1219 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1220 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1221 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1225 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1227 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1233 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1235 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1236 std::size_t sz(tmp.size());
1237 PyObject *ret=PyList_New(sz);
1238 for(std::size_t i=0;i<sz;i++)
1242 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1249 class MEDFileStructuredMesh : public MEDFileMesh
1254 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1256 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1264 class MEDFileCMesh : public MEDFileStructuredMesh
1267 static MEDFileCMesh *New();
1268 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1269 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1270 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1271 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1276 return MEDFileCMesh::New();
1279 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1281 return MEDFileCMesh::New(fileName,mrs);
1284 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1286 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1289 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1291 const MEDCouplingCMesh *tmp=self->getMesh();
1294 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1299 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1302 static MEDFileCurveLinearMesh *New();
1303 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1304 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1305 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1308 MEDFileCurveLinearMesh()
1310 return MEDFileCurveLinearMesh::New();
1313 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1315 return MEDFileCurveLinearMesh::New(fileName,mrs);
1318 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1320 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1323 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1325 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1328 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1333 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1336 static MEDFileMeshMultiTS *New();
1337 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1338 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1339 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1340 std::string getName() const throw(INTERP_KERNEL::Exception);
1341 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1342 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1345 MEDFileMeshMultiTS()
1347 return MEDFileMeshMultiTS::New();
1350 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1352 return MEDFileMeshMultiTS::New(fileName);
1355 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1357 return MEDFileMeshMultiTS::New(fileName,mName);
1360 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1362 MEDFileMesh *ret=self->getOneTimeStep();
1370 class MEDFileMeshesIterator
1375 PyObject *next() throw(INTERP_KERNEL::Exception)
1377 MEDFileMesh *ret=self->nextt();
1381 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1385 PyErr_SetString(PyExc_StopIteration,"No more data.");
1392 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1395 static MEDFileMeshes *New();
1396 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1397 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1398 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1399 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1400 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1402 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1403 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1404 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1405 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1410 return MEDFileMeshes::New();
1413 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1415 return MEDFileMeshes::New(fileName);
1418 std::string __str__() const throw(INTERP_KERNEL::Exception)
1420 return self->simpleRepr();
1423 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1425 if(PyInt_Check(obj))
1427 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1432 else if(PyString_Check(obj))
1434 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1440 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1443 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1445 self->setMeshAtPos(obj,mesh);
1449 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1451 return self->iterator();
1454 int __len__() const throw(INTERP_KERNEL::Exception)
1456 return self->getNumberOfMeshes();
1459 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1461 MEDFileMesh *ret=self->getMeshAtPos(i);
1466 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1468 MEDFileMesh *ret=self->getMeshWithName(mname);
1476 class MEDFileFieldLoc : public RefCountObject
1479 std::string getName() const;
1480 int getDimension() const;
1481 int getNumberOfGaussPoints() const;
1482 int getNumberOfPointsInCells() const;
1483 const std::vector<double>& getRefCoords() const;
1484 const std::vector<double>& getGaussCoords() const;
1485 const std::vector<double>& getGaussWeights() const;
1486 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1489 std::string __str__() const throw(INTERP_KERNEL::Exception)
1491 return self->repr();
1496 class MEDFileFieldGlobsReal
1499 void resetContent();
1500 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1501 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1502 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1503 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1504 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1505 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1506 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1507 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1508 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1509 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1510 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1511 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1512 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1513 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1514 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1515 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1516 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1517 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1518 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1519 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1520 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1521 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1522 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1523 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1524 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1525 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1528 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1530 const DataArrayInt *ret=self->getProfile(pflName);
1533 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1536 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1538 const DataArrayInt *ret=self->getProfileFromId(pflId);
1541 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1544 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1546 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1549 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1552 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1554 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1557 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1560 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1562 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1563 return convertVecPairVecStToPy(ret);
1566 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1568 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1569 return convertVecPairVecStToPy(ret);
1572 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1574 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1575 self->changePflsNames(v);
1578 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1580 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1581 self->changePflsRefsNamesGen(v);
1584 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1586 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1587 self->changePflsNamesInStruct(v);
1590 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1592 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1593 self->changeLocsNames(v);
1596 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1598 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1599 self->changeLocsRefsNamesGen(v);
1602 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1604 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1605 self->changeLocsNamesInStruct(v);
1608 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1610 std::ostringstream oss;
1611 self->simpleReprGlobs(oss);
1617 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1620 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1621 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1622 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1623 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1624 void loadArrays() throw(INTERP_KERNEL::Exception);
1625 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1626 void unloadArrays() throw(INTERP_KERNEL::Exception);
1627 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1628 int getDimension() const throw(INTERP_KERNEL::Exception);
1629 int getIteration() const throw(INTERP_KERNEL::Exception);
1630 int getOrder() const throw(INTERP_KERNEL::Exception);
1631 std::string getName() throw(INTERP_KERNEL::Exception);
1632 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1633 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1634 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1635 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1636 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1637 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1638 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1639 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1640 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1641 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1642 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1643 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1644 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1645 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1646 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1649 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1652 double tmp0=self->getTime(tmp1,tmp2);
1653 PyObject *res = PyList_New(3);
1654 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1655 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1656 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1660 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1662 std::pair<int,int> res=self->getDtIt();
1663 PyObject *elt=PyTuple_New(2);
1664 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1665 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1669 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1671 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1674 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1676 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1679 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1681 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1682 return self->changeMeshNames(modifTab);
1685 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1687 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1688 PyObject *ret2=PyList_New(ret.size());
1689 for(int i=0;i<(int)ret.size();i++)
1690 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1694 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1696 std::vector<int> ret1;
1697 int ret0=self->getNonEmptyLevels(mname,ret1);
1698 PyObject *elt=PyTuple_New(2);
1699 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1700 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1704 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1706 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1707 std::vector< std::vector<TypeOfField> > typesF;
1708 std::vector< std::vector<std::string> > pfls;
1709 std::vector< std::vector<std::string> > locs;
1710 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1712 PyObject *ret2=PyList_New(sz);
1713 for(int i=0;i<sz;i++)
1715 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1716 const std::vector<TypeOfField>& typesFI=typesF[i];
1717 const std::vector<std::string>& pflsI=pfls[i];
1718 const std::vector<std::string>& locsI=locs[i];
1719 PyObject *elt=PyTuple_New(2);
1720 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1721 int sz2=ret[i].size();
1722 PyObject *elt2=PyList_New(sz2);
1723 for(int j=0;j<sz2;j++)
1725 PyObject *elt3=PyTuple_New(4);
1726 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1727 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));
1728 PyTuple_SetItem(elt3,1,elt4);
1729 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1730 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1731 PyList_SetItem(elt2,j,elt3);
1733 PyTuple_SetItem(elt,1,elt2);
1734 PyList_SetItem(ret2,i,elt);
1739 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1741 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1742 std::size_t sz=ret.size();
1743 PyObject *retPy=PyList_New(sz);
1744 for(std::size_t i=0;i<sz;i++)
1745 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1749 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1751 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1752 std::size_t sz=ret.size();
1753 PyObject *retPy=PyList_New(sz);
1754 for(std::size_t i=0;i<sz;i++)
1755 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1759 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1761 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1762 std::size_t sz=ret.size();
1763 PyObject *retPy=PyList_New(sz);
1764 for(std::size_t i=0;i<sz;i++)
1765 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1771 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1774 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1775 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1776 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1777 static MEDFileField1TS *New();
1778 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1779 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1780 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1781 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1782 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1783 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1785 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1786 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1787 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1788 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1791 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1793 return MEDFileField1TS::New(fileName,loadAll);
1796 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1798 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1801 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1803 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1808 return MEDFileField1TS::New();
1811 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1813 const DataArrayDouble *arr=0;
1815 arr=field->getArray();
1816 self->copyTinyInfoFrom(field,arr);
1819 std::string __str__() const throw(INTERP_KERNEL::Exception)
1821 return self->simpleRepr();
1824 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1826 DataArrayInt *ret1=0;
1827 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1828 PyObject *ret=PyTuple_New(2);
1829 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1830 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1834 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1836 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1837 std::vector< std::vector<TypeOfField> > typesF;
1838 std::vector< std::vector<std::string> > pfls;
1839 std::vector< std::vector<std::string> > locs;
1840 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1842 PyObject *ret2=PyList_New(sz);
1843 for(int i=0;i<sz;i++)
1845 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1846 const std::vector<TypeOfField>& typesFI=typesF[i];
1847 const std::vector<std::string>& pflsI=pfls[i];
1848 const std::vector<std::string>& locsI=locs[i];
1849 PyObject *elt=PyTuple_New(2);
1850 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1851 int sz2=ret[i].size();
1852 PyObject *elt2=PyList_New(sz2);
1853 for(int j=0;j<sz2;j++)
1855 PyObject *elt3=PyTuple_New(4);
1856 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1857 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1858 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1859 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1860 PyList_SetItem(elt2,j,elt3);
1862 PyTuple_SetItem(elt,1,elt2);
1863 PyList_SetItem(ret2,i,elt);
1868 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1870 DataArrayDouble *ret=self->getUndergroundDataArray();
1876 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1878 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1879 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1882 PyObject *ret=PyTuple_New(2);
1883 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1884 std::size_t sz=elt1Cpp.size();
1885 PyObject *elt=PyList_New(sz);
1886 for(std::size_t i=0;i<sz;i++)
1888 PyObject *elt1=PyTuple_New(2);
1889 PyObject *elt2=PyTuple_New(2);
1890 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1891 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1892 PyObject *elt3=PyTuple_New(2);
1893 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1894 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1895 PyTuple_SetItem(elt1,0,elt2);
1896 PyTuple_SetItem(elt1,1,elt3);
1897 PyList_SetItem(elt,i,elt1);
1899 PyTuple_SetItem(ret,1,elt);
1905 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1908 static MEDFileIntField1TS *New();
1909 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1910 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1911 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1912 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1914 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1915 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1918 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1920 return MEDFileIntField1TS::New();
1923 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1925 return MEDFileIntField1TS::New(fileName,loadAll);
1928 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1930 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1933 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1935 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1938 std::string __str__() const throw(INTERP_KERNEL::Exception)
1940 return self->simpleRepr();
1943 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1945 DataArrayInt *ret1=0;
1946 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1947 PyObject *ret=PyTuple_New(2);
1948 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1949 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1953 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1955 DataArrayInt *ret1=0;
1956 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1957 PyObject *ret=PyTuple_New(2);
1958 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1959 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1963 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1965 DataArrayInt *ret1=0;
1966 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1967 PyObject *ret=PyTuple_New(2);
1968 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1969 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1973 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1975 DataArrayInt *ret1=0;
1976 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1977 PyObject *ret=PyTuple_New(2);
1978 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1979 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1983 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1985 DataArrayInt *ret1=0;
1986 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1987 PyObject *ret=PyTuple_New(2);
1988 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1989 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1993 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1995 DataArrayInt *ret1=0;
1996 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1997 PyObject *ret=PyTuple_New(2);
1998 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1999 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2003 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2005 DataArrayInt *ret=self->getUndergroundDataArray();
2013 class MEDFileAnyTypeFieldMultiTSIterator
2018 PyObject *next() throw(INTERP_KERNEL::Exception)
2020 MEDFileAnyTypeField1TS *ret=self->nextt();
2022 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2025 PyErr_SetString(PyExc_StopIteration,"No more data.");
2032 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2035 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2036 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2037 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2038 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2039 std::string getName() const throw(INTERP_KERNEL::Exception);
2040 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2041 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2042 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2043 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2044 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2045 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2046 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2047 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2048 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2049 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2050 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2051 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2052 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2053 void loadArrays() throw(INTERP_KERNEL::Exception);
2054 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2055 void unloadArrays() throw(INTERP_KERNEL::Exception);
2056 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2058 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2059 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2060 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2061 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2062 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2065 int __len__() const throw(INTERP_KERNEL::Exception)
2067 return self->getNumberOfTS();
2070 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2072 if(elt0 && PyInt_Check(elt0))
2074 int pos=PyInt_AS_LONG(elt0);
2077 else if(elt0 && PyTuple_Check(elt0))
2079 if(PyTuple_Size(elt0)==2)
2081 PyObject *o0=PyTuple_GetItem(elt0,0);
2082 PyObject *o1=PyTuple_GetItem(elt0,1);
2083 if(PyInt_Check(o0) && PyInt_Check(o1))
2085 int iter=PyInt_AS_LONG(o0);
2086 int order=PyInt_AS_LONG(o1);
2087 return self->getPosOfTimeStep(iter,order);
2090 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 !");
2093 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 !");
2095 else if(elt0 && PyFloat_Check(elt0))
2097 double val=PyFloat_AS_DOUBLE(elt0);
2098 return self->getPosGivenTime(val);
2101 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2104 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2106 std::vector< std::pair<int,int> > res=self->getIterations();
2107 PyObject *ret=PyList_New(res.size());
2109 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2111 PyObject *elt=PyTuple_New(2);
2112 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2113 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2114 PyList_SetItem(ret,rk,elt);
2119 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2121 std::vector<double> ret1;
2122 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2123 std::size_t sz=ret.size();
2124 PyObject *ret2=PyList_New(sz);
2125 for(std::size_t i=0;i<sz;i++)
2127 PyObject *elt=PyTuple_New(3);
2128 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2129 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2130 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2131 PyList_SetItem(ret2,i,elt);
2136 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2138 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2139 PyObject *ret2=PyList_New(ret.size());
2140 for(int i=0;i<(int)ret.size();i++)
2142 const std::vector<TypeOfField>& rett=ret[i];
2143 PyObject *ret3=PyList_New(rett.size());
2144 for(int j=0;j<(int)rett.size();j++)
2145 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2146 PyList_SetItem(ret2,i,ret3);
2151 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2153 std::vector<int> ret1;
2154 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2155 PyObject *elt=PyTuple_New(2);
2156 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2157 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2161 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2163 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2164 std::vector< std::vector<TypeOfField> > typesF;
2165 std::vector< std::vector<std::string> > pfls;
2166 std::vector< std::vector<std::string> > locs;
2167 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2169 PyObject *ret2=PyList_New(sz);
2170 for(int i=0;i<sz;i++)
2172 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2173 const std::vector<TypeOfField>& typesFI=typesF[i];
2174 const std::vector<std::string>& pflsI=pfls[i];
2175 const std::vector<std::string>& locsI=locs[i];
2176 PyObject *elt=PyTuple_New(2);
2177 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2178 int sz2=ret[i].size();
2179 PyObject *elt2=PyList_New(sz2);
2180 for(int j=0;j<sz2;j++)
2182 PyObject *elt3=PyTuple_New(4);
2183 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2184 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));
2185 PyTuple_SetItem(elt3,1,elt4);
2186 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2187 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2188 PyList_SetItem(elt2,j,elt3);
2190 PyTuple_SetItem(elt,1,elt2);
2191 PyList_SetItem(ret2,i,elt);
2196 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2198 if(PyList_Check(elts))
2200 int sz=PyList_Size(elts);
2201 std::vector<int> ret(sz);
2202 for(int i=0;i<sz;i++)
2204 PyObject *elt=PyList_GetItem(elts,i);
2205 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2211 std::vector<int> ret(1);
2212 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2217 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2219 if(PySlice_Check(elts))
2221 Py_ssize_t strt=2,stp=2,step=2;
2222 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2223 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2224 self->eraseTimeStepIds2(strt,stp,step);
2228 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2229 if(!idsToRemove.empty())
2230 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2234 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2238 std::vector<int> pos2;
2239 DataArrayInt *pos3=0;
2240 DataArrayIntTuple *pos4=0;
2241 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2246 self->eraseTimeStepIds(&pos1,&pos1+1);
2253 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2258 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2262 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2266 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2268 return self->iterator();
2271 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2273 if(elt0 && PyList_Check(elt0))
2275 int sz=PyList_Size(elt0);
2276 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2277 int *pt=da->getPointer();
2278 for(int i=0;i<sz;i++,pt++)
2280 PyObject *elt1=PyList_GetItem(elt0,i);
2281 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2283 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2285 else if(elt0 && PySlice_Check(elt0))
2287 Py_ssize_t strt=2,stp=2,step=2;
2288 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2289 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2290 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2293 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2296 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2298 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2299 return self->changeMeshNames(modifTab);
2302 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2304 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2305 std::size_t sz=ret.size();
2306 PyObject *retPy=PyList_New(sz);
2307 for(std::size_t i=0;i<sz;i++)
2308 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2312 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2314 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2315 std::size_t sz=ret.size();
2316 PyObject *retPy=PyList_New(sz);
2317 for(std::size_t i=0;i<sz;i++)
2318 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2322 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2324 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2325 std::size_t sz=ret.size();
2326 PyObject *retPy=PyList_New(sz);
2327 for(std::size_t i=0;i<sz;i++)
2328 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2332 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2335 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
2336 if(SWIG_IsOK(status))
2338 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2342 std::vector<MEDFileAnyTypeField1TS *> tmp;
2343 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2344 self->pushBackTimeSteps(tmp);
2348 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2350 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2351 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2352 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2353 std::size_t sz=ret.size();
2354 PyObject *retPy=PyList_New(sz);
2355 for(std::size_t i=0;i<sz;i++)
2357 std::size_t sz2=ret[i].size();
2358 PyObject *ret1Py=PyList_New(sz2);
2359 for(std::size_t j=0;j<sz2;j++)
2361 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2364 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2366 PyList_SetItem(retPy,i,ret1Py);
2371 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2373 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2374 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2375 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2376 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2377 if(ret2.size()!=ret.size())
2379 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2380 throw INTERP_KERNEL::Exception(oss.str().c_str());
2382 std::size_t sz=ret.size();
2383 PyObject *retPy=PyList_New(sz);
2384 for(std::size_t i=0;i<sz;i++)
2386 std::size_t sz2=ret[i].size();
2387 PyObject *ret0Py=PyTuple_New(2);
2388 PyObject *ret1Py=PyList_New(sz2);
2389 for(std::size_t j=0;j<sz2;j++)
2391 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2394 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2396 PyTuple_SetItem(ret0Py,0,ret1Py);
2397 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2398 PyList_SetItem(retPy,i,ret0Py);
2405 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2408 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2409 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2410 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2412 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2413 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2414 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2415 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2416 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2418 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2419 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2420 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2423 MEDFileFieldMultiTS()
2425 return MEDFileFieldMultiTS::New();
2428 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2430 return MEDFileFieldMultiTS::New(fileName,loadAll);
2433 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2435 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2438 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2440 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2441 std::size_t sz(tmp.size());
2442 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2443 for(std::size_t i=0;i<sz;i++)
2445 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2446 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2448 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2451 std::string __str__() const throw(INTERP_KERNEL::Exception)
2453 return self->simpleRepr();
2456 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2458 DataArrayInt *ret1=0;
2459 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2460 PyObject *ret=PyTuple_New(2);
2461 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2462 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2466 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2468 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2469 std::vector< std::vector<TypeOfField> > typesF;
2470 std::vector< std::vector<std::string> > pfls;
2471 std::vector< std::vector<std::string> > locs;
2472 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2474 PyObject *ret2=PyList_New(sz);
2475 for(int i=0;i<sz;i++)
2477 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2478 const std::vector<TypeOfField>& typesFI=typesF[i];
2479 const std::vector<std::string>& pflsI=pfls[i];
2480 const std::vector<std::string>& locsI=locs[i];
2481 PyObject *elt=PyTuple_New(2);
2482 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2483 int sz2=ret[i].size();
2484 PyObject *elt2=PyList_New(sz2);
2485 for(int j=0;j<sz2;j++)
2487 PyObject *elt3=PyTuple_New(4);
2488 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2489 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2490 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2491 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2492 PyList_SetItem(elt2,j,elt3);
2494 PyTuple_SetItem(elt,1,elt2);
2495 PyList_SetItem(ret2,i,elt);
2499 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2501 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2507 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2509 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2510 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2513 PyObject *ret=PyTuple_New(2);
2514 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2515 std::size_t sz=elt1Cpp.size();
2516 PyObject *elt=PyList_New(sz);
2517 for(std::size_t i=0;i<sz;i++)
2519 PyObject *elt1=PyTuple_New(2);
2520 PyObject *elt2=PyTuple_New(2);
2521 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2522 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2523 PyObject *elt3=PyTuple_New(2);
2524 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2525 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2526 PyTuple_SetItem(elt1,0,elt2);
2527 PyTuple_SetItem(elt1,1,elt3);
2528 PyList_SetItem(elt,i,elt1);
2530 PyTuple_SetItem(ret,1,elt);
2536 class MEDFileFieldsIterator
2541 PyObject *next() throw(INTERP_KERNEL::Exception)
2543 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2545 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2548 PyErr_SetString(PyExc_StopIteration,"No more data.");
2555 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2558 static MEDFileIntFieldMultiTS *New();
2559 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2560 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2562 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2563 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2564 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2567 MEDFileIntFieldMultiTS()
2569 return MEDFileIntFieldMultiTS::New();
2572 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2574 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2577 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2579 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2582 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2584 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2585 std::size_t sz(tmp.size());
2586 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2587 for(std::size_t i=0;i<sz;i++)
2589 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2590 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2592 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2595 std::string __str__() const throw(INTERP_KERNEL::Exception)
2597 return self->simpleRepr();
2600 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2602 DataArrayInt *ret1=0;
2603 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2604 PyObject *ret=PyTuple_New(2);
2605 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2606 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2610 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2612 DataArrayInt *ret1=0;
2613 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2614 PyObject *ret=PyTuple_New(2);
2615 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2616 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2620 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2622 DataArrayInt *ret1=0;
2623 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2624 PyObject *ret=PyTuple_New(2);
2625 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2626 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2630 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2632 DataArrayInt *ret1=0;
2633 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2634 PyObject *ret=PyTuple_New(2);
2635 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2636 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2640 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2642 DataArrayInt *ret1=0;
2643 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2644 PyObject *ret=PyTuple_New(2);
2645 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2646 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2650 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2652 DataArrayInt *ret1=0;
2653 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2654 PyObject *ret=PyTuple_New(2);
2655 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2656 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2660 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2662 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2670 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2673 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2674 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2675 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2676 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2677 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2678 void loadArrays() throw(INTERP_KERNEL::Exception);
2679 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2680 void unloadArrays() throw(INTERP_KERNEL::Exception);
2681 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2682 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2683 int getNumberOfFields() const;
2684 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2685 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2687 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2688 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2689 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2690 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2691 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2692 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2693 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2694 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2695 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2700 return MEDFileFields::New();
2703 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2705 return MEDFileFields::New(fileName,loadAll);
2708 std::string __str__() const throw(INTERP_KERNEL::Exception)
2710 return self->simpleRepr();
2713 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2715 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2716 std::size_t sz(tmp.size());
2717 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2718 for(std::size_t i=0;i<sz;i++)
2720 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2721 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2723 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2726 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2729 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2730 PyObject *ret=PyTuple_New(2);
2731 PyObject *ret_0=PyList_New(ret0.size());
2733 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2735 PyObject *elt=PyTuple_New(2);
2736 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2737 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2738 PyList_SetItem(ret_0,rk,elt);
2740 PyTuple_SetItem(ret,0,ret_0);
2741 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2742 PyTuple_SetItem(ret,1,ret_1);
2746 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2748 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2749 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2752 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2754 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2755 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2758 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2760 if(obj && PyList_Check(obj))
2762 int sz=PyList_Size(obj);
2763 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2764 int *pt=da->getPointer();
2765 for(int i=0;i<sz;i++,pt++)
2767 PyObject *elt1=PyList_GetItem(obj,i);
2768 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2770 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2773 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2776 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2778 self->setFieldAtPos(obj,field);
2782 int __len__() const throw(INTERP_KERNEL::Exception)
2784 return self->getNumberOfFields();
2787 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2789 return self->iterator();
2792 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2794 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2795 return self->changeMeshNames(modifTab);
2798 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2800 if(elt0 && PyInt_Check(elt0))
2802 return PyInt_AS_LONG(elt0);
2804 else if(elt0 && PyString_Check(elt0))
2805 return self->getPosFromFieldName(PyString_AsString(elt0));
2807 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2810 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2812 if(PyList_Check(elts))
2814 int sz=PyList_Size(elts);
2815 std::vector<int> ret(sz);
2816 for(int i=0;i<sz;i++)
2818 PyObject *elt=PyList_GetItem(elts,i);
2819 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2825 std::vector<int> ret(1);
2826 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2831 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2833 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2834 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2835 self->pushFields(tmp);
2838 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2840 if(elts && PySlice_Check(elts))
2842 Py_ssize_t strt=2,stp=2,step=2;
2843 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2844 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2845 self->destroyFieldsAtPos2(strt,stp,step);
2849 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2850 if(!idsToRemove.empty())
2851 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2857 class MEDFileParameter1TS : public RefCountObject
2860 void setIteration(int it);
2861 int getIteration() const;
2862 void setOrder(int order);
2863 int getOrder() const;
2864 void setTimeValue(double time);
2865 void setTime(int dt, int it, double time);
2866 double getTime(int& dt, int& it);
2867 double getTimeValue() const;
2870 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2873 void setValue(double val) throw(INTERP_KERNEL::Exception);
2874 double getValue() const throw(INTERP_KERNEL::Exception);
2875 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2878 std::string __str__() const throw(INTERP_KERNEL::Exception)
2880 return self->simpleRepr();
2885 class MEDFileParameterTinyInfo : public MEDFileWritable
2888 void setDescription(const std::string& name);
2889 std::string getDescription() const;
2890 void setTimeUnit(const std::string& unit);
2891 std::string getTimeUnit() const;
2894 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2897 static MEDFileParameterDouble1TS *New();
2898 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2899 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2900 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2901 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2902 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2903 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2904 std::string getName() const throw(INTERP_KERNEL::Exception);
2905 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2908 MEDFileParameterDouble1TS()
2910 return MEDFileParameterDouble1TS::New();
2913 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2915 return MEDFileParameterDouble1TS::New(fileName);
2918 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2920 return MEDFileParameterDouble1TS::New(fileName,paramName);
2923 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2925 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2928 std::string __str__() const throw(INTERP_KERNEL::Exception)
2930 return self->simpleRepr();
2933 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2936 bool ret0=self->isEqual(other,eps,what);
2937 PyObject *res=PyList_New(2);
2938 PyObject *ret0Py=ret0?Py_True:Py_False;
2940 PyList_SetItem(res,0,ret0Py);
2941 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2947 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2950 static MEDFileParameterMultiTS *New();
2951 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2952 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2953 std::string getName() const;
2954 void setName(const std::string& name);
2955 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2956 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2957 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2958 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2959 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2960 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2961 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2962 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2965 MEDFileParameterMultiTS()
2967 return MEDFileParameterMultiTS::New();
2970 MEDFileParameterMultiTS(const std::string& fileName)
2972 return MEDFileParameterMultiTS::New(fileName);
2975 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2977 return MEDFileParameterMultiTS::New(fileName,paramName);
2980 std::string __str__() const throw(INTERP_KERNEL::Exception)
2982 return self->simpleRepr();
2985 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2988 bool ret0=self->isEqual(other,eps,what);
2989 PyObject *res=PyList_New(2);
2990 PyObject *ret0Py=ret0?Py_True:Py_False;
2992 PyList_SetItem(res,0,ret0Py);
2993 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2997 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3001 std::vector<int> pos2;
3002 DataArrayInt *pos3=0;
3003 DataArrayIntTuple *pos4=0;
3004 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3009 self->eraseTimeStepIds(&pos1,&pos1+1);
3016 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3021 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3025 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3029 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3031 if(elt0 && PyInt_Check(elt0))
3033 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3036 else if(elt0 && PyTuple_Check(elt0))
3038 if(PyTuple_Size(elt0)==2)
3040 PyObject *o0=PyTuple_GetItem(elt0,0);
3041 PyObject *o1=PyTuple_GetItem(elt0,1);
3042 if(PyInt_Check(o0) && PyInt_Check(o1))
3044 int iter=PyInt_AS_LONG(o0);
3045 int order=PyInt_AS_LONG(o1);
3046 return self->getPosOfTimeStep(iter,order);
3049 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 !");
3052 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 !");
3054 else if(elt0 && PyFloat_Check(elt0))
3056 double val=PyFloat_AS_DOUBLE(elt0);
3057 return self->getPosGivenTime(val);
3060 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3063 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3065 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3071 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3073 if(PyList_Check(elts))
3075 int sz=PyList_Size(elts);
3076 std::vector<int> ret(sz);
3077 for(int i=0;i<sz;i++)
3079 PyObject *elt=PyList_GetItem(elts,i);
3080 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3086 std::vector<int> ret(1);
3087 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3092 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3094 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3095 if(!idsToRemove.empty())
3096 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3099 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3101 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3107 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3109 std::vector< std::pair<int,int> > res=self->getIterations();
3110 PyObject *ret=PyList_New(res.size());
3112 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3114 PyObject *elt=PyTuple_New(2);
3115 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3116 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3117 PyList_SetItem(ret,rk,elt);
3122 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3124 std::vector<double> res2;
3125 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3126 PyObject *ret=PyList_New(res.size());
3128 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3130 PyObject *elt=PyTuple_New(3);
3131 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3132 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3133 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3134 PyList_SetItem(ret,rk,elt);
3141 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3144 static MEDFileParameters *New();
3145 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3146 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
3147 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3148 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3149 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3150 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3151 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3152 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3153 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3154 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3155 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3160 return MEDFileParameters::New();
3163 MEDFileParameters(const std::string& fileName)
3165 return MEDFileParameters::New(fileName);
3168 std::string __str__() const throw(INTERP_KERNEL::Exception)
3170 return self->simpleRepr();
3173 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3175 if(PyInt_Check(obj))
3177 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3182 else if(PyString_Check(obj))
3184 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3190 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3193 int __len__() const throw(INTERP_KERNEL::Exception)
3195 return self->getNumberOfParams();
3198 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3200 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3206 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3208 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3214 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3217 bool ret0=self->isEqual(other,eps,what);
3218 PyObject *res=PyList_New(2);
3219 PyObject *ret0Py=ret0?Py_True:Py_False;
3221 PyList_SetItem(res,0,ret0Py);
3222 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3228 class MEDFileData : public RefCountObject, public MEDFileWritable
3231 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3232 static MEDFileData *New();
3233 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
3234 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3235 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3236 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3237 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3238 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3239 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3241 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3242 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3244 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3247 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3249 return MEDFileData::New(fileName);
3254 return MEDFileData::New();
3257 std::string __str__() const throw(INTERP_KERNEL::Exception)
3259 return self->simpleRepr();
3262 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3264 MEDFileMeshes *ret=self->getMeshes();
3270 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3272 MEDFileParameters *ret=self->getParams();
3278 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3280 MEDFileFields *ret=self->getFields();
3286 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3288 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3289 return self->changeMeshNames(modifTab);
3294 class SauvReader : public RefCountObject
3297 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3298 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3301 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3303 return SauvReader::New(fileName);
3308 class SauvWriter : public RefCountObject
3311 static SauvWriter * New();
3312 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3313 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3314 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3315 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3318 SauvWriter() throw(INTERP_KERNEL::Exception)
3320 return SauvWriter::New();
3327 class MEDFileMeshStruct;
3329 class MEDFileField1TSStructItem
3332 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3335 class MEDFileMeshStruct : public RefCountObject
3338 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3340 ~MEDFileMeshStruct();
3343 class MEDMeshMultiLev : public RefCountObject
3346 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3347 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3353 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3355 DataArrayInt *famIds(0);
3356 bool isWithoutCopy(false);
3357 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3358 PyObject *ret=PyTuple_New(2);
3359 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3361 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3362 PyTuple_SetItem(ret,1,ret1Py);
3366 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3368 DataArrayInt *numIds(0);
3369 bool isWithoutCopy(false);
3370 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3371 PyObject *ret=PyTuple_New(2);
3372 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3374 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3375 PyTuple_SetItem(ret,1,ret1Py);
3379 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3381 DataArrayInt *famIds(0);
3382 bool isWithoutCopy(false);
3383 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3384 PyObject *ret=PyTuple_New(2);
3385 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3387 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3388 PyTuple_SetItem(ret,1,ret1Py);
3392 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3394 DataArrayInt *numIds(0);
3395 bool isWithoutCopy(false);
3396 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3397 PyObject *ret=PyTuple_New(2);
3398 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3400 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3401 PyTuple_SetItem(ret,1,ret1Py);
3405 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3407 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3408 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3409 PyObject *res(PyList_New(result.size()));
3410 for(int i=0;iL!=result.end(); i++, iL++)
3411 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3417 class MEDUMeshMultiLev : public MEDMeshMultiLev
3420 ~MEDUMeshMultiLev();
3424 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3426 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3427 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3428 PyObject *ret0Py=ncc?Py_True:Py_False;
3430 PyObject *ret=PyTuple_New(7);
3431 PyTuple_SetItem(ret,0,ret0Py);
3432 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3433 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3434 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3435 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3436 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3437 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3443 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3446 ~MEDStructuredMeshMultiLev();
3449 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3452 ~MEDCMeshMultiLev();
3456 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3459 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3460 std::size_t sz(objs.size());
3461 PyObject *ret(PyTuple_New(2));
3462 PyObject *ret0=PyList_New(sz);
3463 for(std::size_t i=0;i<sz;i++)
3464 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3465 PyTuple_SetItem(ret,0,ret0);
3466 PyObject *ret1Py(isInternal?Py_True:Py_False);
3468 PyTuple_SetItem(ret,1,ret1Py);
3474 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3477 ~MEDCurveLinearMeshMultiLev();
3481 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3483 DataArrayDouble *ret0(0);
3484 std::vector<int> ret1;
3486 self->buildVTUArrays(ret0,ret1,ret2);
3487 std::size_t sz(ret1.size());
3488 PyObject *ret=PyTuple_New(3);
3489 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3490 PyObject *ret1Py=PyList_New(sz);
3491 for(std::size_t i=0;i<sz;i++)
3492 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3493 PyTuple_SetItem(ret,1,ret1Py);
3494 PyObject *ret2Py(ret2?Py_True:Py_False);
3496 PyTuple_SetItem(ret,2,ret2Py);
3502 class MEDFileFastCellSupportComparator : public RefCountObject
3505 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3506 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3507 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3508 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3510 ~MEDFileFastCellSupportComparator();
3514 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3516 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3517 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3518 PyObject *res(PyList_New(result.size()));
3519 for(int i=0;iL!=result.end(); i++, iL++)
3520 PyList_SetItem(res,i,PyInt_FromLong(*iL));