1 // Copyright (C) 2007-2014 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 "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
101 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
102 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
103 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
104 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
105 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
111 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
112 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
113 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
114 %newobject ParaMEDMEM::MEDFileCMesh::New;
115 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
116 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
117 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
118 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
119 %newobject ParaMEDMEM::MEDFileMeshes::New;
120 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
121 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
122 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
123 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
124 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
126 %newobject ParaMEDMEM::MEDFileFields::New;
127 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
128 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
129 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
130 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
131 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
132 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
133 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
134 %newobject ParaMEDMEM::MEDFileFields::__iter__;
136 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
137 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
138 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
143 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
144 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
145 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
150 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
151 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
152 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
154 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
155 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
156 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
157 %newobject ParaMEDMEM::MEDFileField1TS::New;
158 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
159 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
160 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
161 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
162 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
163 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
164 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
165 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
166 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
168 %newobject ParaMEDMEM::MEDFileData::New;
169 %newobject ParaMEDMEM::MEDFileData::deepCpy;
170 %newobject ParaMEDMEM::MEDFileData::getMeshes;
171 %newobject ParaMEDMEM::MEDFileData::getFields;
172 %newobject ParaMEDMEM::MEDFileData::getParams;
174 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
175 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
176 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
177 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
178 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
179 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
180 %newobject ParaMEDMEM::MEDFileParameters::New;
181 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
182 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
183 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
184 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
186 %newobject ParaMEDMEM::SauvWriter::New;
187 %newobject ParaMEDMEM::SauvReader::New;
188 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
190 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
191 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
192 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
193 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
194 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
196 %feature("unref") MEDFileMesh "$this->decrRef();"
197 %feature("unref") MEDFileUMesh "$this->decrRef();"
198 %feature("unref") MEDFileCMesh "$this->decrRef();"
199 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
200 %feature("unref") MEDFileMeshes "$this->decrRef();"
201 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
202 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
203 %feature("unref") MEDFileField1TS "$this->decrRef();"
204 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
205 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
207 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
208 %feature("unref") MEDFileFields "$this->decrRef();"
209 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
210 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
211 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
212 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
213 %feature("unref") MEDFileParameters "$this->decrRef();"
214 %feature("unref") MEDFileData "$this->decrRef();"
215 %feature("unref") SauvReader "$this->decrRef();"
216 %feature("unref") SauvWriter "$this->decrRef();"
217 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
218 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
219 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
220 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
221 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
222 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
227 static bool HasXDR();
228 static std::string MEDFileVersionStr();
229 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
230 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
231 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
232 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
244 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
245 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
248 static PyObject *MEDFileVersion()
250 int major,minor,release;
251 MEDLoader::MEDFileVersion(major,minor,release);
252 PyObject *ret(PyTuple_New(3));
253 PyTuple_SetItem(ret,0,SWIG_From_int(major));
254 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
255 PyTuple_SetItem(ret,2,SWIG_From_int(release));
259 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
261 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
262 PyObject *ret=PyList_New(res.size());
264 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
266 PyObject *elt=PyTuple_New(2);
267 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
268 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
269 PyList_SetItem(ret,rk,elt);
274 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
276 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
277 PyObject *ret=PyList_New(res.size());
279 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
281 PyObject *elt=PyTuple_New(3);
282 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
283 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
284 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
285 PyList_SetItem(ret,rk,elt);
290 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
292 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
293 PyObject *ret=PyList_New(res.size());
295 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
297 PyObject *elt=PyTuple_New(2);
298 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
299 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
300 PyList_SetItem(ret,rk,elt);
304 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
306 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
307 PyObject *ret=PyList_New(res.size());
309 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
311 PyObject *elt=PyTuple_New(2);
312 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
313 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
314 PyList_SetItem(ret,rk,elt);
318 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
320 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
321 PyObject *ret=PyList_New(res.size());
323 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
325 PyObject *elt=PyTuple_New(2);
326 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
327 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
328 PyList_SetItem(ret,rk,elt);
332 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
334 int meshDim,spaceDim,numberOfNodes;
335 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
336 PyObject *ret=PyTuple_New(4);
337 PyObject *elt0=PyList_New(res.size());
339 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
341 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
343 PyObject *elt1=PyList_New(obj2.size());
344 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
346 PyObject *elt2=PyTuple_New(2);
347 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
348 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
349 PyList_SetItem(elt1,j,elt2);
351 PyList_SetItem(elt0,i,elt1);
353 PyTuple_SetItem(ret,0,elt0);
354 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
355 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
356 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
359 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
360 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
362 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
363 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
364 return convertFieldDoubleVecToPy(res);
366 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
368 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
369 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
370 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
372 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
374 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
375 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
376 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
378 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
380 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
381 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
382 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
384 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
386 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
388 PyObject *ret=PyList_New(size);
389 for(int i=0;i<size;i++)
390 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
393 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
395 std::vector<std::string> grps;
396 converPyListToVecString(li,grps);
397 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
399 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
401 std::vector<std::string> fams;
402 converPyListToVecString(li,fams);
403 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
406 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
407 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
408 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
409 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
410 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
411 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);
412 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);
413 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);
414 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);
415 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);
416 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
417 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
418 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
419 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
420 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
421 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
426 class MEDFileWritable
429 void copyOptionsFrom(const MEDFileWritable& other) const;
430 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
431 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
432 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
433 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
436 class MEDFileMeshReadSelector
439 MEDFileMeshReadSelector();
440 MEDFileMeshReadSelector(unsigned int code);
441 unsigned int getCode() const;
442 void setCode(unsigned int newCode);
443 bool isCellFamilyFieldReading() const;
444 bool isNodeFamilyFieldReading() const;
445 bool isCellNameFieldReading() const;
446 bool isNodeNameFieldReading() const;
447 bool isCellNumFieldReading() const;
448 bool isNodeNumFieldReading() const;
449 void setCellFamilyFieldReading(bool b);
450 void setNodeFamilyFieldReading(bool b);
451 void setCellNameFieldReading(bool b);
452 void setNodeNameFieldReading(bool b);
453 void setCellNumFieldReading(bool b);
454 void setNodeNumFieldReading(bool b);
457 std::string __str__() const throw(INTERP_KERNEL::Exception)
459 std::ostringstream oss;
464 std::string __repr__() const throw(INTERP_KERNEL::Exception)
466 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
472 class MEDFileMesh : public RefCountObject, public MEDFileWritable
475 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
476 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
477 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
478 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
479 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
480 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
481 void setName(const std::string& name);
482 std::string getName();
483 std::string getUnivName() const;
484 bool getUnivNameWrStatus() const;
485 void setUnivNameWrStatus(bool newStatus);
486 void setDescription(const std::string& name);
487 std::string getDescription() const;
488 void setOrder(int order);
489 int getOrder() const;
490 void setIteration(int it);
492 void setTimeValue(double time);
493 void setTime(int dt, int it, double time);
494 double getTimeValue() const;
495 void setTimeUnit(const std::string& unit);
496 std::string getTimeUnit() const;
497 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
498 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
499 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
500 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
501 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
502 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
503 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
504 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
505 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
506 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
507 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
508 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
510 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
511 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
512 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
513 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
514 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
515 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
516 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
517 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
518 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
519 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
520 void clearGrpMap() throw(INTERP_KERNEL::Exception);
521 void clearFamMap() throw(INTERP_KERNEL::Exception);
522 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
523 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
524 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
525 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
526 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
527 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
528 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
529 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
530 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
531 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
532 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
533 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
534 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
535 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
536 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
537 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
538 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
539 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
540 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
541 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
542 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
543 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
544 void setFamilyInfo(const std::map<std::string,int>& info);
545 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
546 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
547 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
548 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
549 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
550 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
551 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
552 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
553 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
554 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
555 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
556 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
557 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
558 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
559 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
560 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
561 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
562 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
563 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
564 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
565 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
567 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
568 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
569 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
570 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
571 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
572 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
573 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
581 std::string __str__() const throw(INTERP_KERNEL::Exception)
583 return self->simpleRepr();
586 PyObject *getTime() throw(INTERP_KERNEL::Exception)
589 double tmp0=self->getTime(tmp1,tmp2);
590 PyObject *res = PyList_New(3);
591 PyList_SetItem(res,0,SWIG_From_int(tmp1));
592 PyList_SetItem(res,1,SWIG_From_int(tmp2));
593 PyList_SetItem(res,2,SWIG_From_double(tmp0));
597 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
600 bool ret0=self->isEqual(other,eps,what);
601 PyObject *res=PyList_New(2);
602 PyObject *ret0Py=ret0?Py_True:Py_False;
604 PyList_SetItem(res,0,ret0Py);
605 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
609 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
612 bool ret0=self->areFamsEqual(other,what);
613 PyObject *res=PyList_New(2);
614 PyObject *ret0Py=ret0?Py_True:Py_False;
616 PyList_SetItem(res,0,ret0Py);
617 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
621 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
624 bool ret0=self->areGrpsEqual(other,what);
625 PyObject *res=PyList_New(2);
626 PyObject *ret0Py=ret0?Py_True:Py_False;
628 PyList_SetItem(res,0,ret0Py);
629 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
633 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
635 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
636 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
637 PyObject *res=PyList_New(result.size());
638 for(int i=0;iL!=result.end(); i++, iL++)
639 PyList_SetItem(res,i,PyInt_FromLong(*iL));
643 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
645 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
646 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
647 PyObject *res=PyList_New(result.size());
648 for(int i=0;iL!=result.end(); i++, iL++)
649 PyList_SetItem(res,i,PyInt_FromLong(*iL));
653 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
655 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
658 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
661 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
663 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
666 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
669 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
671 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
674 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
677 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
680 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
681 PyObject *ret=PyTuple_New(2);
682 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
683 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
687 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
689 DataArrayInt *ret3=0;
690 std::vector<int> ret1,ret2;
691 bool ret0=self->unPolyze(ret1,ret2,ret3);
692 PyObject *ret=PyTuple_New(4);
693 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
695 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
696 for(int j=0;j<(int)ret1.size()/3;j++)
698 PyObject *retLev2=PyList_New(3);
699 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
700 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
701 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
702 PyList_SetItem(retLev1_0,j,retLev2);
704 PyTuple_SetItem(ret,1,retLev1_0);
706 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
707 for(int j=0;j<(int)ret2.size()/3;j++)
709 PyObject *retLev2=PyList_New(3);
710 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
711 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
712 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
713 PyList_SetItem(retLev1_1,j,retLev2);
715 PyTuple_SetItem(ret,2,retLev1_1);
717 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
723 class MEDFileUMesh : public MEDFileMesh
726 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
727 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
728 static MEDFileUMesh *New();
730 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
731 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
733 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
734 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
735 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
736 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
737 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
738 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
739 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
740 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
741 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
742 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
743 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
744 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
745 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
746 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
747 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
748 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
749 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
750 DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
751 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
752 DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
753 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
754 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
755 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
756 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
757 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
758 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
759 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
761 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
762 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
763 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
764 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
765 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
766 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
767 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
768 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
769 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
770 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
771 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
772 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
775 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
777 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
780 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
782 return MEDFileUMesh::New(fileName,mrs);
787 return MEDFileUMesh::New();
790 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)
792 std::vector<int> typesCpp1;
793 convertPyToNewIntArr3(types,typesCpp1);
794 std::size_t sz(typesCpp1.size());
795 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
796 for(std::size_t ii=0;ii<sz;ii++)
797 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
798 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
801 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
803 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
806 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
809 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
811 std::vector<const DataArrayInt *> grps;
812 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
813 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
816 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
818 std::vector<const MEDCouplingUMesh *> ms;
819 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
820 self->setMeshes(ms,renum);
823 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
825 std::vector<const MEDCouplingUMesh *> ms;
826 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
827 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
830 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
832 std::vector<const MEDCouplingUMesh *> ms;
833 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
834 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
837 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
839 DataArrayDouble *ret=self->getCoords();
845 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
847 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
850 return const_cast<PartDefinition *>(ret);
853 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
855 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
856 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
857 PyObject *ret=PyTuple_New(3);
858 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
859 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
860 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
864 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
866 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
872 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
874 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
875 std::size_t sz(tmp.size());
876 PyObject *ret=PyList_New(sz);
877 for(std::size_t i=0;i<sz;i++)
881 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
888 class MEDFileStructuredMesh : public MEDFileMesh
893 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
895 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
903 class MEDFileCMesh : public MEDFileStructuredMesh
906 static MEDFileCMesh *New();
907 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
908 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
909 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
910 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
915 return MEDFileCMesh::New();
918 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
920 return MEDFileCMesh::New(fileName,mrs);
923 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
925 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
928 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
930 const MEDCouplingCMesh *tmp=self->getMesh();
933 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
938 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
941 static MEDFileCurveLinearMesh *New();
942 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
943 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
944 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
947 MEDFileCurveLinearMesh()
949 return MEDFileCurveLinearMesh::New();
952 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
954 return MEDFileCurveLinearMesh::New(fileName,mrs);
957 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
959 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
962 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
964 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
967 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
972 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
975 static MEDFileMeshMultiTS *New();
976 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
977 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
978 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
979 std::string getName() const throw(INTERP_KERNEL::Exception);
980 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
981 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
986 return MEDFileMeshMultiTS::New();
989 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
991 return MEDFileMeshMultiTS::New(fileName);
994 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
996 return MEDFileMeshMultiTS::New(fileName,mName);
999 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1001 MEDFileMesh *ret=self->getOneTimeStep();
1009 class MEDFileMeshesIterator
1014 PyObject *next() throw(INTERP_KERNEL::Exception)
1016 MEDFileMesh *ret=self->nextt();
1020 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1024 PyErr_SetString(PyExc_StopIteration,"No more data.");
1031 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1034 static MEDFileMeshes *New();
1035 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1036 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1037 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1038 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1039 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1041 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1042 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1043 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1044 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1049 return MEDFileMeshes::New();
1052 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1054 return MEDFileMeshes::New(fileName);
1057 std::string __str__() const throw(INTERP_KERNEL::Exception)
1059 return self->simpleRepr();
1062 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1064 if(PyInt_Check(obj))
1066 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1071 else if(PyString_Check(obj))
1073 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1079 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1082 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1084 self->setMeshAtPos(obj,mesh);
1088 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1090 return self->iterator();
1093 int __len__() const throw(INTERP_KERNEL::Exception)
1095 return self->getNumberOfMeshes();
1098 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1100 MEDFileMesh *ret=self->getMeshAtPos(i);
1105 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1107 MEDFileMesh *ret=self->getMeshWithName(mname);
1115 class MEDFileFieldLoc : public RefCountObject
1118 std::string getName() const;
1119 int getDimension() const;
1120 int getNumberOfGaussPoints() const;
1121 int getNumberOfPointsInCells() const;
1122 const std::vector<double>& getRefCoords() const;
1123 const std::vector<double>& getGaussCoords() const;
1124 const std::vector<double>& getGaussWeights() const;
1125 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1128 std::string __str__() const throw(INTERP_KERNEL::Exception)
1130 return self->repr();
1135 class MEDFileFieldGlobsReal
1138 void resetContent();
1139 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1140 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1141 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1142 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1143 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1144 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1145 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1146 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1147 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1148 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1149 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1150 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1151 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1152 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1153 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1154 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1155 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1156 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1157 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1158 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1159 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1160 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1161 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1162 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1163 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1164 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1167 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1169 const DataArrayInt *ret=self->getProfile(pflName);
1172 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1175 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1177 const DataArrayInt *ret=self->getProfileFromId(pflId);
1180 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1183 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1185 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1188 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1191 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1193 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1196 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1199 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1201 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1202 return convertVecPairVecStToPy(ret);
1205 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1207 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1208 return convertVecPairVecStToPy(ret);
1211 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1213 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1214 self->changePflsNames(v);
1217 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1219 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1220 self->changePflsRefsNamesGen(v);
1223 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1225 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1226 self->changePflsNamesInStruct(v);
1229 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1231 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1232 self->changeLocsNames(v);
1235 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1237 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1238 self->changeLocsRefsNamesGen(v);
1241 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1243 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1244 self->changeLocsNamesInStruct(v);
1247 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1249 std::ostringstream oss;
1250 self->simpleReprGlobs(oss);
1256 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1259 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1260 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1261 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1262 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1263 void loadArrays() throw(INTERP_KERNEL::Exception);
1264 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1265 void unloadArrays() throw(INTERP_KERNEL::Exception);
1266 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1267 int getDimension() const throw(INTERP_KERNEL::Exception);
1268 int getIteration() const throw(INTERP_KERNEL::Exception);
1269 int getOrder() const throw(INTERP_KERNEL::Exception);
1270 std::string getName() throw(INTERP_KERNEL::Exception);
1271 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1272 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1273 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1274 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1275 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1276 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1277 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1278 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1279 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1280 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1281 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1282 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1283 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1284 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1287 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1290 double tmp0=self->getTime(tmp1,tmp2);
1291 PyObject *res = PyList_New(3);
1292 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1293 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1294 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1298 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1300 std::pair<int,int> res=self->getDtIt();
1301 PyObject *elt=PyTuple_New(2);
1302 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1303 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1307 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1309 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1312 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1314 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1317 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1319 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1320 return self->changeMeshNames(modifTab);
1323 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1325 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1326 PyObject *ret2=PyList_New(ret.size());
1327 for(int i=0;i<(int)ret.size();i++)
1328 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1332 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1334 std::vector<int> ret1;
1335 int ret0=self->getNonEmptyLevels(mname,ret1);
1336 PyObject *elt=PyTuple_New(2);
1337 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1338 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1342 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1344 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1345 std::vector< std::vector<TypeOfField> > typesF;
1346 std::vector< std::vector<std::string> > pfls;
1347 std::vector< std::vector<std::string> > locs;
1348 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1350 PyObject *ret2=PyList_New(sz);
1351 for(int i=0;i<sz;i++)
1353 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1354 const std::vector<TypeOfField>& typesFI=typesF[i];
1355 const std::vector<std::string>& pflsI=pfls[i];
1356 const std::vector<std::string>& locsI=locs[i];
1357 PyObject *elt=PyTuple_New(2);
1358 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1359 int sz2=ret[i].size();
1360 PyObject *elt2=PyList_New(sz2);
1361 for(int j=0;j<sz2;j++)
1363 PyObject *elt3=PyTuple_New(4);
1364 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1365 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));
1366 PyTuple_SetItem(elt3,1,elt4);
1367 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1368 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1369 PyList_SetItem(elt2,j,elt3);
1371 PyTuple_SetItem(elt,1,elt2);
1372 PyList_SetItem(ret2,i,elt);
1377 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1379 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1380 std::size_t sz=ret.size();
1381 PyObject *retPy=PyList_New(sz);
1382 for(std::size_t i=0;i<sz;i++)
1383 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1387 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1389 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1390 std::size_t sz=ret.size();
1391 PyObject *retPy=PyList_New(sz);
1392 for(std::size_t i=0;i<sz;i++)
1393 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1399 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1402 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1403 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1404 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1405 static MEDFileField1TS *New();
1406 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1407 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1408 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1409 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1410 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1411 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1413 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1414 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1415 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1416 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1419 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1421 return MEDFileField1TS::New(fileName,loadAll);
1424 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1426 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1429 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1431 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1436 return MEDFileField1TS::New();
1439 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1441 const DataArrayDouble *arr=0;
1443 arr=field->getArray();
1444 self->copyTinyInfoFrom(field,arr);
1447 std::string __str__() const throw(INTERP_KERNEL::Exception)
1449 return self->simpleRepr();
1452 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1454 DataArrayInt *ret1=0;
1455 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1456 PyObject *ret=PyTuple_New(2);
1457 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1458 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1462 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1464 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1465 std::vector< std::vector<TypeOfField> > typesF;
1466 std::vector< std::vector<std::string> > pfls;
1467 std::vector< std::vector<std::string> > locs;
1468 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1470 PyObject *ret2=PyList_New(sz);
1471 for(int i=0;i<sz;i++)
1473 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1474 const std::vector<TypeOfField>& typesFI=typesF[i];
1475 const std::vector<std::string>& pflsI=pfls[i];
1476 const std::vector<std::string>& locsI=locs[i];
1477 PyObject *elt=PyTuple_New(2);
1478 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1479 int sz2=ret[i].size();
1480 PyObject *elt2=PyList_New(sz2);
1481 for(int j=0;j<sz2;j++)
1483 PyObject *elt3=PyTuple_New(4);
1484 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1485 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1486 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1487 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1488 PyList_SetItem(elt2,j,elt3);
1490 PyTuple_SetItem(elt,1,elt2);
1491 PyList_SetItem(ret2,i,elt);
1496 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1498 DataArrayDouble *ret=self->getUndergroundDataArray();
1504 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1506 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1507 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1510 PyObject *ret=PyTuple_New(2);
1511 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1512 std::size_t sz=elt1Cpp.size();
1513 PyObject *elt=PyList_New(sz);
1514 for(std::size_t i=0;i<sz;i++)
1516 PyObject *elt1=PyTuple_New(2);
1517 PyObject *elt2=PyTuple_New(2);
1518 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1519 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1520 PyObject *elt3=PyTuple_New(2);
1521 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1522 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1523 PyTuple_SetItem(elt1,0,elt2);
1524 PyTuple_SetItem(elt1,1,elt3);
1525 PyList_SetItem(elt,i,elt1);
1527 PyTuple_SetItem(ret,1,elt);
1533 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1536 static MEDFileIntField1TS *New();
1537 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1538 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1539 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1540 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1542 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1543 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1546 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1548 return MEDFileIntField1TS::New();
1551 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1553 return MEDFileIntField1TS::New(fileName,loadAll);
1556 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1558 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1561 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1563 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1566 std::string __str__() const throw(INTERP_KERNEL::Exception)
1568 return self->simpleRepr();
1571 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1573 DataArrayInt *ret1=0;
1574 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1575 PyObject *ret=PyTuple_New(2);
1576 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1577 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1581 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1583 DataArrayInt *ret1=0;
1584 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1585 PyObject *ret=PyTuple_New(2);
1586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1587 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1591 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1593 DataArrayInt *ret1=0;
1594 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1595 PyObject *ret=PyTuple_New(2);
1596 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1597 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1601 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1603 DataArrayInt *ret1=0;
1604 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1605 PyObject *ret=PyTuple_New(2);
1606 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1607 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1611 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1613 DataArrayInt *ret1=0;
1614 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1615 PyObject *ret=PyTuple_New(2);
1616 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1617 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1621 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1623 DataArrayInt *ret1=0;
1624 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1625 PyObject *ret=PyTuple_New(2);
1626 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1627 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1631 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1633 DataArrayInt *ret=self->getUndergroundDataArray();
1641 class MEDFileAnyTypeFieldMultiTSIterator
1646 PyObject *next() throw(INTERP_KERNEL::Exception)
1648 MEDFileAnyTypeField1TS *ret=self->nextt();
1650 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1653 PyErr_SetString(PyExc_StopIteration,"No more data.");
1660 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1663 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1664 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1665 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1666 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1667 std::string getName() const throw(INTERP_KERNEL::Exception);
1668 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1669 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1670 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1671 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1672 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1673 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1674 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1675 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1676 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1677 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1678 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1679 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1680 void loadArrays() throw(INTERP_KERNEL::Exception);
1681 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1682 void unloadArrays() throw(INTERP_KERNEL::Exception);
1683 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1685 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1686 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1687 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1688 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1689 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1692 int __len__() const throw(INTERP_KERNEL::Exception)
1694 return self->getNumberOfTS();
1697 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1699 if(elt0 && PyInt_Check(elt0))
1701 int pos=PyInt_AS_LONG(elt0);
1704 else if(elt0 && PyTuple_Check(elt0))
1706 if(PyTuple_Size(elt0)==2)
1708 PyObject *o0=PyTuple_GetItem(elt0,0);
1709 PyObject *o1=PyTuple_GetItem(elt0,1);
1710 if(PyInt_Check(o0) && PyInt_Check(o1))
1712 int iter=PyInt_AS_LONG(o0);
1713 int order=PyInt_AS_LONG(o1);
1714 return self->getPosOfTimeStep(iter,order);
1717 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 !");
1720 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 !");
1722 else if(elt0 && PyFloat_Check(elt0))
1724 double val=PyFloat_AS_DOUBLE(elt0);
1725 return self->getPosGivenTime(val);
1728 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1731 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1733 std::vector< std::pair<int,int> > res=self->getIterations();
1734 PyObject *ret=PyList_New(res.size());
1736 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1738 PyObject *elt=PyTuple_New(2);
1739 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1740 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1741 PyList_SetItem(ret,rk,elt);
1746 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1748 std::vector<double> ret1;
1749 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1750 std::size_t sz=ret.size();
1751 PyObject *ret2=PyList_New(sz);
1752 for(std::size_t i=0;i<sz;i++)
1754 PyObject *elt=PyTuple_New(3);
1755 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1756 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1757 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1758 PyList_SetItem(ret2,i,elt);
1763 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1765 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1766 PyObject *ret2=PyList_New(ret.size());
1767 for(int i=0;i<(int)ret.size();i++)
1769 const std::vector<TypeOfField>& rett=ret[i];
1770 PyObject *ret3=PyList_New(rett.size());
1771 for(int j=0;j<(int)rett.size();j++)
1772 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1773 PyList_SetItem(ret2,i,ret3);
1778 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1780 std::vector<int> ret1;
1781 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1782 PyObject *elt=PyTuple_New(2);
1783 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1784 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1788 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1790 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1791 std::vector< std::vector<TypeOfField> > typesF;
1792 std::vector< std::vector<std::string> > pfls;
1793 std::vector< std::vector<std::string> > locs;
1794 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1796 PyObject *ret2=PyList_New(sz);
1797 for(int i=0;i<sz;i++)
1799 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1800 const std::vector<TypeOfField>& typesFI=typesF[i];
1801 const std::vector<std::string>& pflsI=pfls[i];
1802 const std::vector<std::string>& locsI=locs[i];
1803 PyObject *elt=PyTuple_New(2);
1804 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1805 int sz2=ret[i].size();
1806 PyObject *elt2=PyList_New(sz2);
1807 for(int j=0;j<sz2;j++)
1809 PyObject *elt3=PyTuple_New(4);
1810 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1811 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));
1812 PyTuple_SetItem(elt3,1,elt4);
1813 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1814 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1815 PyList_SetItem(elt2,j,elt3);
1817 PyTuple_SetItem(elt,1,elt2);
1818 PyList_SetItem(ret2,i,elt);
1823 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1825 if(PyList_Check(elts))
1827 int sz=PyList_Size(elts);
1828 std::vector<int> ret(sz);
1829 for(int i=0;i<sz;i++)
1831 PyObject *elt=PyList_GetItem(elts,i);
1832 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1838 std::vector<int> ret(1);
1839 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1844 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1846 if(PySlice_Check(elts))
1848 Py_ssize_t strt=2,stp=2,step=2;
1849 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1850 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1851 self->eraseTimeStepIds2(strt,stp,step);
1855 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1856 if(!idsToRemove.empty())
1857 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1861 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1865 std::vector<int> pos2;
1866 DataArrayInt *pos3=0;
1867 DataArrayIntTuple *pos4=0;
1868 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1873 self->eraseTimeStepIds(&pos1,&pos1+1);
1880 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1885 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1889 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1893 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1895 return self->iterator();
1898 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1900 if(elt0 && PyList_Check(elt0))
1902 int sz=PyList_Size(elt0);
1903 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1904 int *pt=da->getPointer();
1905 for(int i=0;i<sz;i++,pt++)
1907 PyObject *elt1=PyList_GetItem(elt0,i);
1908 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1910 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1912 else if(elt0 && PySlice_Check(elt0))
1914 Py_ssize_t strt=2,stp=2,step=2;
1915 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1916 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1917 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1920 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1923 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1925 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1926 return self->changeMeshNames(modifTab);
1929 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1931 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1932 std::size_t sz=ret.size();
1933 PyObject *retPy=PyList_New(sz);
1934 for(std::size_t i=0;i<sz;i++)
1935 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1939 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1941 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1942 std::size_t sz=ret.size();
1943 PyObject *retPy=PyList_New(sz);
1944 for(std::size_t i=0;i<sz;i++)
1945 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1949 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1951 std::vector<MEDFileAnyTypeField1TS *> tmp;
1952 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1953 self->pushBackTimeSteps(tmp);
1956 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1958 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1959 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1960 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1961 std::size_t sz=ret.size();
1962 PyObject *retPy=PyList_New(sz);
1963 for(std::size_t i=0;i<sz;i++)
1965 std::size_t sz2=ret[i].size();
1966 PyObject *ret1Py=PyList_New(sz2);
1967 for(std::size_t j=0;j<sz2;j++)
1969 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1972 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1974 PyList_SetItem(retPy,i,ret1Py);
1979 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1981 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1982 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1983 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1984 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1985 if(ret2.size()!=ret.size())
1987 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1988 throw INTERP_KERNEL::Exception(oss.str().c_str());
1990 std::size_t sz=ret.size();
1991 PyObject *retPy=PyList_New(sz);
1992 for(std::size_t i=0;i<sz;i++)
1994 std::size_t sz2=ret[i].size();
1995 PyObject *ret0Py=PyTuple_New(2);
1996 PyObject *ret1Py=PyList_New(sz2);
1997 for(std::size_t j=0;j<sz2;j++)
1999 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2002 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2004 PyTuple_SetItem(ret0Py,0,ret1Py);
2005 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2006 PyList_SetItem(retPy,i,ret0Py);
2013 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2016 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2017 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2018 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2020 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2021 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2022 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2023 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2024 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2026 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2027 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2028 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2031 MEDFileFieldMultiTS()
2033 return MEDFileFieldMultiTS::New();
2036 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2038 return MEDFileFieldMultiTS::New(fileName,loadAll);
2041 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2043 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2046 std::string __str__() const throw(INTERP_KERNEL::Exception)
2048 return self->simpleRepr();
2051 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2053 DataArrayInt *ret1=0;
2054 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2055 PyObject *ret=PyTuple_New(2);
2056 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2057 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2061 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2063 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2064 std::vector< std::vector<TypeOfField> > typesF;
2065 std::vector< std::vector<std::string> > pfls;
2066 std::vector< std::vector<std::string> > locs;
2067 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2069 PyObject *ret2=PyList_New(sz);
2070 for(int i=0;i<sz;i++)
2072 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2073 const std::vector<TypeOfField>& typesFI=typesF[i];
2074 const std::vector<std::string>& pflsI=pfls[i];
2075 const std::vector<std::string>& locsI=locs[i];
2076 PyObject *elt=PyTuple_New(2);
2077 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2078 int sz2=ret[i].size();
2079 PyObject *elt2=PyList_New(sz2);
2080 for(int j=0;j<sz2;j++)
2082 PyObject *elt3=PyTuple_New(4);
2083 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2084 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2085 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2086 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2087 PyList_SetItem(elt2,j,elt3);
2089 PyTuple_SetItem(elt,1,elt2);
2090 PyList_SetItem(ret2,i,elt);
2094 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2096 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2102 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2104 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2105 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2108 PyObject *ret=PyTuple_New(2);
2109 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2110 std::size_t sz=elt1Cpp.size();
2111 PyObject *elt=PyList_New(sz);
2112 for(std::size_t i=0;i<sz;i++)
2114 PyObject *elt1=PyTuple_New(2);
2115 PyObject *elt2=PyTuple_New(2);
2116 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2117 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2118 PyObject *elt3=PyTuple_New(2);
2119 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2120 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2121 PyTuple_SetItem(elt1,0,elt2);
2122 PyTuple_SetItem(elt1,1,elt3);
2123 PyList_SetItem(elt,i,elt1);
2125 PyTuple_SetItem(ret,1,elt);
2131 class MEDFileFieldsIterator
2136 PyObject *next() throw(INTERP_KERNEL::Exception)
2138 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2140 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2143 PyErr_SetString(PyExc_StopIteration,"No more data.");
2150 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2153 static MEDFileIntFieldMultiTS *New();
2154 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2155 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2157 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2158 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2159 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2162 MEDFileIntFieldMultiTS()
2164 return MEDFileIntFieldMultiTS::New();
2167 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2169 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2172 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2174 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2177 std::string __str__() const throw(INTERP_KERNEL::Exception)
2179 return self->simpleRepr();
2182 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2184 DataArrayInt *ret1=0;
2185 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2186 PyObject *ret=PyTuple_New(2);
2187 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2188 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2194 DataArrayInt *ret1=0;
2195 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2196 PyObject *ret=PyTuple_New(2);
2197 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2204 DataArrayInt *ret1=0;
2205 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2206 PyObject *ret=PyTuple_New(2);
2207 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2214 DataArrayInt *ret1=0;
2215 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2216 PyObject *ret=PyTuple_New(2);
2217 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2218 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2224 DataArrayInt *ret1=0;
2225 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2226 PyObject *ret=PyTuple_New(2);
2227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2234 DataArrayInt *ret1=0;
2235 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2236 PyObject *ret=PyTuple_New(2);
2237 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2238 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2242 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2244 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2252 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2255 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2256 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2257 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2258 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2259 void loadArrays() throw(INTERP_KERNEL::Exception);
2260 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2261 void unloadArrays() throw(INTERP_KERNEL::Exception);
2262 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2263 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2264 int getNumberOfFields() const;
2265 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2266 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2268 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2269 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2270 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2271 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2272 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2273 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2274 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2275 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2276 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2281 return MEDFileFields::New();
2284 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2286 return MEDFileFields::New(fileName,loadAll);
2289 std::string __str__() const throw(INTERP_KERNEL::Exception)
2291 return self->simpleRepr();
2294 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2297 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2298 PyObject *ret=PyTuple_New(2);
2299 PyObject *ret_0=PyList_New(ret0.size());
2301 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2303 PyObject *elt=PyTuple_New(2);
2304 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2305 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2306 PyList_SetItem(ret_0,rk,elt);
2308 PyTuple_SetItem(ret,0,ret_0);
2309 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2310 PyTuple_SetItem(ret,1,ret_1);
2314 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2316 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2317 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2320 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2322 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2323 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2326 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2328 if(obj && PyList_Check(obj))
2330 int sz=PyList_Size(obj);
2331 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2332 int *pt=da->getPointer();
2333 for(int i=0;i<sz;i++,pt++)
2335 PyObject *elt1=PyList_GetItem(obj,i);
2336 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2338 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2341 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2344 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2346 self->setFieldAtPos(obj,field);
2350 int __len__() const throw(INTERP_KERNEL::Exception)
2352 return self->getNumberOfFields();
2355 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2357 return self->iterator();
2360 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2362 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2363 return self->changeMeshNames(modifTab);
2366 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2368 if(elt0 && PyInt_Check(elt0))
2370 return PyInt_AS_LONG(elt0);
2372 else if(elt0 && PyString_Check(elt0))
2373 return self->getPosFromFieldName(PyString_AsString(elt0));
2375 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2378 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2380 if(PyList_Check(elts))
2382 int sz=PyList_Size(elts);
2383 std::vector<int> ret(sz);
2384 for(int i=0;i<sz;i++)
2386 PyObject *elt=PyList_GetItem(elts,i);
2387 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2393 std::vector<int> ret(1);
2394 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2399 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2401 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2402 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2403 self->pushFields(tmp);
2406 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2408 if(elts && PySlice_Check(elts))
2410 Py_ssize_t strt=2,stp=2,step=2;
2411 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2412 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2413 self->destroyFieldsAtPos2(strt,stp,step);
2417 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2418 if(!idsToRemove.empty())
2419 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2425 class MEDFileParameter1TS : public RefCountObject
2428 void setIteration(int it);
2429 int getIteration() const;
2430 void setOrder(int order);
2431 int getOrder() const;
2432 void setTimeValue(double time);
2433 void setTime(int dt, int it, double time);
2434 double getTime(int& dt, int& it);
2435 double getTimeValue() const;
2438 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2441 void setValue(double val) throw(INTERP_KERNEL::Exception);
2442 double getValue() const throw(INTERP_KERNEL::Exception);
2443 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2446 std::string __str__() const throw(INTERP_KERNEL::Exception)
2448 return self->simpleRepr();
2453 class MEDFileParameterTinyInfo : public MEDFileWritable
2456 void setDescription(const std::string& name);
2457 std::string getDescription() const;
2458 void setTimeUnit(const std::string& unit);
2459 std::string getTimeUnit() const;
2462 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2465 static MEDFileParameterDouble1TS *New();
2466 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2467 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2468 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2469 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2470 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2471 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2472 std::string getName() const throw(INTERP_KERNEL::Exception);
2473 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2476 MEDFileParameterDouble1TS()
2478 return MEDFileParameterDouble1TS::New();
2481 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2483 return MEDFileParameterDouble1TS::New(fileName);
2486 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2488 return MEDFileParameterDouble1TS::New(fileName,paramName);
2491 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2493 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2496 std::string __str__() const throw(INTERP_KERNEL::Exception)
2498 return self->simpleRepr();
2501 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2504 bool ret0=self->isEqual(other,eps,what);
2505 PyObject *res=PyList_New(2);
2506 PyObject *ret0Py=ret0?Py_True:Py_False;
2508 PyList_SetItem(res,0,ret0Py);
2509 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2515 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2518 static MEDFileParameterMultiTS *New();
2519 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2520 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2521 std::string getName() const;
2522 void setName(const std::string& name);
2523 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2524 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2525 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2526 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2527 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2528 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2529 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2530 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2533 MEDFileParameterMultiTS()
2535 return MEDFileParameterMultiTS::New();
2538 MEDFileParameterMultiTS(const std::string& fileName)
2540 return MEDFileParameterMultiTS::New(fileName);
2543 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2545 return MEDFileParameterMultiTS::New(fileName,paramName);
2548 std::string __str__() const throw(INTERP_KERNEL::Exception)
2550 return self->simpleRepr();
2553 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2556 bool ret0=self->isEqual(other,eps,what);
2557 PyObject *res=PyList_New(2);
2558 PyObject *ret0Py=ret0?Py_True:Py_False;
2560 PyList_SetItem(res,0,ret0Py);
2561 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2565 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2569 std::vector<int> pos2;
2570 DataArrayInt *pos3=0;
2571 DataArrayIntTuple *pos4=0;
2572 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2577 self->eraseTimeStepIds(&pos1,&pos1+1);
2584 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2589 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2593 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2597 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2599 if(elt0 && PyInt_Check(elt0))
2601 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2604 else if(elt0 && PyTuple_Check(elt0))
2606 if(PyTuple_Size(elt0)==2)
2608 PyObject *o0=PyTuple_GetItem(elt0,0);
2609 PyObject *o1=PyTuple_GetItem(elt0,1);
2610 if(PyInt_Check(o0) && PyInt_Check(o1))
2612 int iter=PyInt_AS_LONG(o0);
2613 int order=PyInt_AS_LONG(o1);
2614 return self->getPosOfTimeStep(iter,order);
2617 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 !");
2620 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 !");
2622 else if(elt0 && PyFloat_Check(elt0))
2624 double val=PyFloat_AS_DOUBLE(elt0);
2625 return self->getPosGivenTime(val);
2628 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2631 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2633 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2639 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2641 if(PyList_Check(elts))
2643 int sz=PyList_Size(elts);
2644 std::vector<int> ret(sz);
2645 for(int i=0;i<sz;i++)
2647 PyObject *elt=PyList_GetItem(elts,i);
2648 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2654 std::vector<int> ret(1);
2655 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2660 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2662 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2663 if(!idsToRemove.empty())
2664 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2667 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2669 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2675 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2677 std::vector< std::pair<int,int> > res=self->getIterations();
2678 PyObject *ret=PyList_New(res.size());
2680 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2682 PyObject *elt=PyTuple_New(2);
2683 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2684 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2685 PyList_SetItem(ret,rk,elt);
2690 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2692 std::vector<double> res2;
2693 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2694 PyObject *ret=PyList_New(res.size());
2696 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2698 PyObject *elt=PyTuple_New(3);
2699 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2700 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2701 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2702 PyList_SetItem(ret,rk,elt);
2709 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2712 static MEDFileParameters *New();
2713 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2714 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2715 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2716 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2717 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2718 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2719 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2720 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2721 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2722 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2723 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2728 return MEDFileParameters::New();
2731 MEDFileParameters(const std::string& fileName)
2733 return MEDFileParameters::New(fileName);
2736 std::string __str__() const throw(INTERP_KERNEL::Exception)
2738 return self->simpleRepr();
2741 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2743 if(PyInt_Check(obj))
2745 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2750 else if(PyString_Check(obj))
2752 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2758 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2761 int __len__() const throw(INTERP_KERNEL::Exception)
2763 return self->getNumberOfParams();
2766 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2768 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2774 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2776 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2782 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2785 bool ret0=self->isEqual(other,eps,what);
2786 PyObject *res=PyList_New(2);
2787 PyObject *ret0Py=ret0?Py_True:Py_False;
2789 PyList_SetItem(res,0,ret0Py);
2790 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2796 class MEDFileData : public RefCountObject, public MEDFileWritable
2799 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2800 static MEDFileData *New();
2801 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2802 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2803 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2804 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2805 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2806 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2807 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2809 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2810 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2812 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2815 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2817 return MEDFileData::New(fileName);
2822 return MEDFileData::New();
2825 std::string __str__() const throw(INTERP_KERNEL::Exception)
2827 return self->simpleRepr();
2830 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2832 MEDFileMeshes *ret=self->getMeshes();
2838 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2840 MEDFileParameters *ret=self->getParams();
2846 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2848 MEDFileFields *ret=self->getFields();
2854 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2856 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2857 return self->changeMeshNames(modifTab);
2862 class SauvReader : public RefCountObject
2865 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2866 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2869 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2871 return SauvReader::New(fileName);
2876 class SauvWriter : public RefCountObject
2879 static SauvWriter * New();
2880 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2881 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2882 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2883 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2886 SauvWriter() throw(INTERP_KERNEL::Exception)
2888 return SauvWriter::New();
2895 class MEDFileMeshStruct;
2897 class MEDFileField1TSStructItem
2900 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2903 class MEDFileMeshStruct : public RefCountObject
2906 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2908 ~MEDFileMeshStruct();
2911 class MEDMeshMultiLev : public RefCountObject
2914 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2915 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2921 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2923 DataArrayInt *famIds(0);
2924 bool isWithoutCopy(false);
2925 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2926 PyObject *ret=PyTuple_New(2);
2927 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2929 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2930 PyTuple_SetItem(ret,1,ret1Py);
2934 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2936 DataArrayInt *numIds(0);
2937 bool isWithoutCopy(false);
2938 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2939 PyObject *ret=PyTuple_New(2);
2940 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2942 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2943 PyTuple_SetItem(ret,1,ret1Py);
2947 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2949 DataArrayInt *famIds(0);
2950 bool isWithoutCopy(false);
2951 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
2952 PyObject *ret=PyTuple_New(2);
2953 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2955 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2956 PyTuple_SetItem(ret,1,ret1Py);
2960 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2962 DataArrayInt *numIds(0);
2963 bool isWithoutCopy(false);
2964 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
2965 PyObject *ret=PyTuple_New(2);
2966 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2968 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2969 PyTuple_SetItem(ret,1,ret1Py);
2973 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
2975 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
2976 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
2977 PyObject *res(PyList_New(result.size()));
2978 for(int i=0;iL!=result.end(); i++, iL++)
2979 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2985 class MEDUMeshMultiLev : public MEDMeshMultiLev
2988 ~MEDUMeshMultiLev();
2992 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2994 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2995 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
2996 PyObject *ret0Py=ncc?Py_True:Py_False;
2998 PyObject *ret=PyTuple_New(7);
2999 PyTuple_SetItem(ret,0,ret0Py);
3000 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3001 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3002 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3003 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3004 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3005 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3011 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3014 ~MEDStructuredMeshMultiLev();
3017 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3020 ~MEDCMeshMultiLev();
3024 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3027 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3028 std::size_t sz(objs.size());
3029 PyObject *ret(PyTuple_New(2));
3030 PyObject *ret0=PyList_New(sz);
3031 for(std::size_t i=0;i<sz;i++)
3032 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3033 PyTuple_SetItem(ret,0,ret0);
3034 PyObject *ret1Py(isInternal?Py_True:Py_False);
3036 PyTuple_SetItem(ret,1,ret1Py);
3042 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3045 ~MEDCurveLinearMeshMultiLev();
3049 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3051 DataArrayDouble *ret0(0);
3052 std::vector<int> ret1;
3054 self->buildVTUArrays(ret0,ret1,ret2);
3055 std::size_t sz(ret1.size());
3056 PyObject *ret=PyTuple_New(3);
3057 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3058 PyObject *ret1Py=PyList_New(sz);
3059 for(std::size_t i=0;i<sz;i++)
3060 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3061 PyTuple_SetItem(ret,1,ret1Py);
3062 PyObject *ret2Py(ret2?Py_True:Py_False);
3064 PyTuple_SetItem(ret,2,ret2Py);
3070 class MEDFileFastCellSupportComparator : public RefCountObject
3073 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3074 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3075 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3076 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3078 ~MEDFileFastCellSupportComparator();
3082 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3084 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3085 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3086 PyObject *res(PyList_New(result.size()));
3087 for(int i=0;iL!=result.end(); i++, iL++)
3088 PyList_SetItem(res,i,PyInt_FromLong(*iL));