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::getCoords;
99 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
100 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
101 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
102 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
103 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
104 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
105 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
110 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
111 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
112 %newobject ParaMEDMEM::MEDFileCMesh::New;
113 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
114 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
115 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
116 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
117 %newobject ParaMEDMEM::MEDFileMeshes::New;
118 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
119 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
120 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
121 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
122 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
124 %newobject ParaMEDMEM::MEDFileFields::New;
125 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
126 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
127 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
128 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
129 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
130 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
131 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
132 %newobject ParaMEDMEM::MEDFileFields::__iter__;
134 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
135 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
136 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
137 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
138 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
141 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
142 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
143 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
144 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
145 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
148 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
149 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
150 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
152 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
153 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
154 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
155 %newobject ParaMEDMEM::MEDFileField1TS::New;
156 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
157 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
158 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
159 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
160 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
161 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
162 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
163 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
164 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
166 %newobject ParaMEDMEM::MEDFileData::New;
167 %newobject ParaMEDMEM::MEDFileData::deepCpy;
168 %newobject ParaMEDMEM::MEDFileData::getMeshes;
169 %newobject ParaMEDMEM::MEDFileData::getFields;
170 %newobject ParaMEDMEM::MEDFileData::getParams;
172 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
173 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
174 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
175 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
176 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
177 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
178 %newobject ParaMEDMEM::MEDFileParameters::New;
179 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
180 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
181 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
182 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
184 %newobject ParaMEDMEM::SauvWriter::New;
185 %newobject ParaMEDMEM::SauvReader::New;
186 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
188 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
189 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
190 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
191 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
192 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
194 %feature("unref") MEDFileMesh "$this->decrRef();"
195 %feature("unref") MEDFileUMesh "$this->decrRef();"
196 %feature("unref") MEDFileCMesh "$this->decrRef();"
197 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
198 %feature("unref") MEDFileMeshes "$this->decrRef();"
199 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
200 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
201 %feature("unref") MEDFileField1TS "$this->decrRef();"
202 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
203 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
204 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
205 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileFields "$this->decrRef();"
207 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
208 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
209 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
210 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
211 %feature("unref") MEDFileParameters "$this->decrRef();"
212 %feature("unref") MEDFileData "$this->decrRef();"
213 %feature("unref") SauvReader "$this->decrRef();"
214 %feature("unref") SauvWriter "$this->decrRef();"
215 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
216 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
217 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
218 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
219 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
220 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
225 static bool HasXDR();
226 static std::string MEDFileVersionStr();
227 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
228 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
229 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
230 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
231 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
242 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
243 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
246 static PyObject *MEDFileVersion()
248 int major,minor,release;
249 MEDLoader::MEDFileVersion(major,minor,release);
250 PyObject *ret(PyTuple_New(3));
251 PyTuple_SetItem(ret,0,SWIG_From_int(major));
252 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
253 PyTuple_SetItem(ret,2,SWIG_From_int(release));
257 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
259 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
260 PyObject *ret=PyList_New(res.size());
262 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
264 PyObject *elt=PyTuple_New(2);
265 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
266 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
267 PyList_SetItem(ret,rk,elt);
272 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
274 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
275 PyObject *ret=PyList_New(res.size());
277 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
279 PyObject *elt=PyTuple_New(3);
280 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
281 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
282 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
283 PyList_SetItem(ret,rk,elt);
288 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
290 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
291 PyObject *ret=PyList_New(res.size());
293 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
295 PyObject *elt=PyTuple_New(2);
296 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
297 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
298 PyList_SetItem(ret,rk,elt);
302 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
304 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
305 PyObject *ret=PyList_New(res.size());
307 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
309 PyObject *elt=PyTuple_New(2);
310 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
311 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
312 PyList_SetItem(ret,rk,elt);
316 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
318 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
319 PyObject *ret=PyList_New(res.size());
321 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
323 PyObject *elt=PyTuple_New(2);
324 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
325 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
326 PyList_SetItem(ret,rk,elt);
330 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
332 int meshDim,spaceDim,numberOfNodes;
333 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
334 PyObject *ret=PyTuple_New(4);
335 PyObject *elt0=PyList_New(res.size());
337 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
339 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
341 PyObject *elt1=PyList_New(obj2.size());
342 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
344 PyObject *elt2=PyTuple_New(2);
345 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
346 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
347 PyList_SetItem(elt1,j,elt2);
349 PyList_SetItem(elt0,i,elt1);
351 PyTuple_SetItem(ret,0,elt0);
352 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
353 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
354 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
357 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
358 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
360 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
361 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
362 return convertFieldDoubleVecToPy(res);
364 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
366 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
367 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
368 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
370 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
372 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
373 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
374 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
376 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
378 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
379 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
380 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
382 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
384 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
386 PyObject *ret=PyList_New(size);
387 for(int i=0;i<size;i++)
388 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
391 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
393 std::vector<std::string> grps;
394 converPyListToVecString(li,grps);
395 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
397 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
399 std::vector<std::string> fams;
400 converPyListToVecString(li,fams);
401 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
404 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
405 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
406 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
407 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
408 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
409 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);
410 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);
411 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);
412 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);
413 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);
414 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
415 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
416 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
417 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
418 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
419 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
424 class MEDFileWritable
427 void copyOptionsFrom(const MEDFileWritable& other) const;
428 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
429 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
430 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
431 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
434 class MEDFileMeshReadSelector
437 MEDFileMeshReadSelector();
438 MEDFileMeshReadSelector(unsigned int code);
439 unsigned int getCode() const;
440 void setCode(unsigned int newCode);
441 bool isCellFamilyFieldReading() const;
442 bool isNodeFamilyFieldReading() const;
443 bool isCellNameFieldReading() const;
444 bool isNodeNameFieldReading() const;
445 bool isCellNumFieldReading() const;
446 bool isNodeNumFieldReading() const;
447 void setCellFamilyFieldReading(bool b);
448 void setNodeFamilyFieldReading(bool b);
449 void setCellNameFieldReading(bool b);
450 void setNodeNameFieldReading(bool b);
451 void setCellNumFieldReading(bool b);
452 void setNodeNumFieldReading(bool b);
455 std::string __str__() const throw(INTERP_KERNEL::Exception)
457 std::ostringstream oss;
462 std::string __repr__() const throw(INTERP_KERNEL::Exception)
464 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
470 class MEDFileMesh : public RefCountObject, public MEDFileWritable
473 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
474 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
475 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
476 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
477 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
478 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
479 void setName(const std::string& name);
480 std::string getName();
481 std::string getUnivName() const;
482 bool getUnivNameWrStatus() const;
483 void setUnivNameWrStatus(bool newStatus);
484 void setDescription(const std::string& name);
485 std::string getDescription() const;
486 void setOrder(int order);
487 int getOrder() const;
488 void setIteration(int it);
490 void setTimeValue(double time);
491 void setTime(int dt, int it, double time);
492 double getTimeValue() const;
493 void setTimeUnit(const std::string& unit);
494 std::string getTimeUnit() const;
495 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
496 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
497 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
498 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
499 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
500 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
501 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
502 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
503 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
504 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
505 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
506 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
508 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
509 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
510 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
511 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
512 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
513 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
514 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
515 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
516 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
517 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
518 void clearGrpMap() throw(INTERP_KERNEL::Exception);
519 void clearFamMap() throw(INTERP_KERNEL::Exception);
520 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
521 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
522 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
523 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
524 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
525 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
526 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
527 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
528 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
529 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
530 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
531 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
532 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
533 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
534 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
535 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
536 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
537 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
538 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
539 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
540 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
541 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
542 void setFamilyInfo(const std::map<std::string,int>& info);
543 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
544 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
545 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
546 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
547 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
548 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
549 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
550 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
551 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
552 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
553 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
554 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
555 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
556 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
557 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
558 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
559 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
560 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
561 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
562 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
563 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
565 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
566 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
567 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
568 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
569 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
570 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
571 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
572 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
573 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 std::string __str__() const throw(INTERP_KERNEL::Exception)
581 return self->simpleRepr();
584 PyObject *getTime() throw(INTERP_KERNEL::Exception)
587 double tmp0=self->getTime(tmp1,tmp2);
588 PyObject *res = PyList_New(3);
589 PyList_SetItem(res,0,SWIG_From_int(tmp1));
590 PyList_SetItem(res,1,SWIG_From_int(tmp2));
591 PyList_SetItem(res,2,SWIG_From_double(tmp0));
595 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
598 bool ret0=self->isEqual(other,eps,what);
599 PyObject *res=PyList_New(2);
600 PyObject *ret0Py=ret0?Py_True:Py_False;
602 PyList_SetItem(res,0,ret0Py);
603 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
607 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
610 bool ret0=self->areFamsEqual(other,what);
611 PyObject *res=PyList_New(2);
612 PyObject *ret0Py=ret0?Py_True:Py_False;
614 PyList_SetItem(res,0,ret0Py);
615 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
619 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
622 bool ret0=self->areGrpsEqual(other,what);
623 PyObject *res=PyList_New(2);
624 PyObject *ret0Py=ret0?Py_True:Py_False;
626 PyList_SetItem(res,0,ret0Py);
627 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
631 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
633 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
634 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
635 PyObject *res=PyList_New(result.size());
636 for(int i=0;iL!=result.end(); i++, iL++)
637 PyList_SetItem(res,i,PyInt_FromLong(*iL));
641 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
643 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
644 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
645 PyObject *res=PyList_New(result.size());
646 for(int i=0;iL!=result.end(); i++, iL++)
647 PyList_SetItem(res,i,PyInt_FromLong(*iL));
651 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
653 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
656 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
659 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
661 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
664 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
667 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
669 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
672 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
675 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
678 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
679 PyObject *ret=PyTuple_New(2);
680 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
681 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
685 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
687 DataArrayInt *ret3=0;
688 std::vector<int> ret1,ret2;
689 bool ret0=self->unPolyze(ret1,ret2,ret3);
690 PyObject *ret=PyTuple_New(4);
691 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
693 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
694 for(int j=0;j<(int)ret1.size()/3;j++)
696 PyObject *retLev2=PyList_New(3);
697 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
698 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
699 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
700 PyList_SetItem(retLev1_0,j,retLev2);
702 PyTuple_SetItem(ret,1,retLev1_0);
704 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
705 for(int j=0;j<(int)ret2.size()/3;j++)
707 PyObject *retLev2=PyList_New(3);
708 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
709 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
710 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
711 PyList_SetItem(retLev1_1,j,retLev2);
713 PyTuple_SetItem(ret,2,retLev1_1);
715 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
721 class MEDFileUMesh : public MEDFileMesh
724 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
725 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
726 static MEDFileUMesh *New();
728 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
730 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
731 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
732 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
733 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
734 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
735 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
736 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
737 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
738 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
739 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
740 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
741 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
742 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
743 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
744 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
745 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
746 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
747 DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
748 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
749 DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
750 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
751 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
752 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
753 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
754 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
755 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
756 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
758 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
759 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
760 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
761 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
762 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
763 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
764 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
765 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
766 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
767 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
768 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
769 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
772 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
774 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
777 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
779 return MEDFileUMesh::New(fileName,mrs);
784 return MEDFileUMesh::New();
787 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
789 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
792 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
795 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
797 std::vector<const DataArrayInt *> grps;
798 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
799 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
802 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
804 std::vector<const MEDCouplingUMesh *> ms;
805 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
806 self->setMeshes(ms,renum);
809 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
811 std::vector<const MEDCouplingUMesh *> ms;
812 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
813 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
816 void setGroupsOnSetMesh(int meshDimRelToMax, 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->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
823 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
825 DataArrayDouble *ret=self->getCoords();
831 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
833 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
834 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
835 PyObject *ret=PyTuple_New(3);
836 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
837 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
838 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
842 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
844 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
850 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
852 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
853 std::size_t sz(tmp.size());
854 PyObject *ret=PyList_New(sz);
855 for(std::size_t i=0;i<sz;i++)
859 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
866 class MEDFileStructuredMesh : public MEDFileMesh
871 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
873 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
881 class MEDFileCMesh : public MEDFileStructuredMesh
884 static MEDFileCMesh *New();
885 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
886 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
887 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
888 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
893 return MEDFileCMesh::New();
896 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
898 return MEDFileCMesh::New(fileName,mrs);
901 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
903 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
906 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
908 const MEDCouplingCMesh *tmp=self->getMesh();
911 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
916 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
919 static MEDFileCurveLinearMesh *New();
920 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
921 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
922 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
925 MEDFileCurveLinearMesh()
927 return MEDFileCurveLinearMesh::New();
930 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
932 return MEDFileCurveLinearMesh::New(fileName,mrs);
935 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
937 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
940 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
942 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
945 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
950 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
953 static MEDFileMeshMultiTS *New();
954 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
955 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
956 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
957 std::string getName() const throw(INTERP_KERNEL::Exception);
958 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
959 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
964 return MEDFileMeshMultiTS::New();
967 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
969 return MEDFileMeshMultiTS::New(fileName);
972 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
974 return MEDFileMeshMultiTS::New(fileName,mName);
977 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
979 MEDFileMesh *ret=self->getOneTimeStep();
987 class MEDFileMeshesIterator
992 PyObject *next() throw(INTERP_KERNEL::Exception)
994 MEDFileMesh *ret=self->nextt();
998 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1002 PyErr_SetString(PyExc_StopIteration,"No more data.");
1009 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1012 static MEDFileMeshes *New();
1013 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1014 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1015 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1016 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1017 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1019 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1020 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1021 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1022 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1027 return MEDFileMeshes::New();
1030 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1032 return MEDFileMeshes::New(fileName);
1035 std::string __str__() const throw(INTERP_KERNEL::Exception)
1037 return self->simpleRepr();
1040 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1042 if(PyInt_Check(obj))
1044 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1049 else if(PyString_Check(obj))
1051 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1057 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1060 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1062 self->setMeshAtPos(obj,mesh);
1066 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1068 return self->iterator();
1071 int __len__() const throw(INTERP_KERNEL::Exception)
1073 return self->getNumberOfMeshes();
1076 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1078 MEDFileMesh *ret=self->getMeshAtPos(i);
1083 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1085 MEDFileMesh *ret=self->getMeshWithName(mname);
1093 class MEDFileFieldLoc : public RefCountObject
1096 std::string getName() const;
1097 int getDimension() const;
1098 int getNumberOfGaussPoints() const;
1099 int getNumberOfPointsInCells() const;
1100 const std::vector<double>& getRefCoords() const;
1101 const std::vector<double>& getGaussCoords() const;
1102 const std::vector<double>& getGaussWeights() const;
1103 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1106 std::string __str__() const throw(INTERP_KERNEL::Exception)
1108 return self->repr();
1113 class MEDFileFieldGlobsReal
1116 void resetContent();
1117 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1118 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1119 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1120 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1121 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1122 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1123 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1124 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1125 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1126 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1127 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1128 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1129 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1130 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1131 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1132 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1133 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1134 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1135 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1136 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1137 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1138 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1139 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1140 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1141 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1142 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1145 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1147 const DataArrayInt *ret=self->getProfile(pflName);
1150 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1153 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1155 const DataArrayInt *ret=self->getProfileFromId(pflId);
1158 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1161 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1163 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1166 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1169 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1171 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1174 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1177 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1179 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1180 return convertVecPairVecStToPy(ret);
1183 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1185 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1186 return convertVecPairVecStToPy(ret);
1189 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1191 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1192 self->changePflsNames(v);
1195 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1197 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1198 self->changePflsRefsNamesGen(v);
1201 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1203 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1204 self->changePflsNamesInStruct(v);
1207 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1209 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1210 self->changeLocsNames(v);
1213 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1215 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1216 self->changeLocsRefsNamesGen(v);
1219 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1221 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1222 self->changeLocsNamesInStruct(v);
1225 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1227 std::ostringstream oss;
1228 self->simpleReprGlobs(oss);
1234 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1237 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1238 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1239 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1240 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1241 void loadArrays() throw(INTERP_KERNEL::Exception);
1242 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1243 void unloadArrays() throw(INTERP_KERNEL::Exception);
1244 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1245 int getDimension() const throw(INTERP_KERNEL::Exception);
1246 int getIteration() const throw(INTERP_KERNEL::Exception);
1247 int getOrder() const throw(INTERP_KERNEL::Exception);
1248 std::string getName() throw(INTERP_KERNEL::Exception);
1249 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1250 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1251 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1252 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1253 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1254 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1255 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1256 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1257 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1258 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1259 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1260 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1261 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1262 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1265 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1268 double tmp0=self->getTime(tmp1,tmp2);
1269 PyObject *res = PyList_New(3);
1270 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1271 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1272 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1276 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1278 std::pair<int,int> res=self->getDtIt();
1279 PyObject *elt=PyTuple_New(2);
1280 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1281 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1285 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1287 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1290 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1292 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1295 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1297 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1298 return self->changeMeshNames(modifTab);
1301 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1303 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1304 PyObject *ret2=PyList_New(ret.size());
1305 for(int i=0;i<(int)ret.size();i++)
1306 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1310 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1312 std::vector<int> ret1;
1313 int ret0=self->getNonEmptyLevels(mname,ret1);
1314 PyObject *elt=PyTuple_New(2);
1315 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1316 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1320 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1322 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1323 std::vector< std::vector<TypeOfField> > typesF;
1324 std::vector< std::vector<std::string> > pfls;
1325 std::vector< std::vector<std::string> > locs;
1326 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1328 PyObject *ret2=PyList_New(sz);
1329 for(int i=0;i<sz;i++)
1331 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1332 const std::vector<TypeOfField>& typesFI=typesF[i];
1333 const std::vector<std::string>& pflsI=pfls[i];
1334 const std::vector<std::string>& locsI=locs[i];
1335 PyObject *elt=PyTuple_New(2);
1336 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1337 int sz2=ret[i].size();
1338 PyObject *elt2=PyList_New(sz2);
1339 for(int j=0;j<sz2;j++)
1341 PyObject *elt3=PyTuple_New(4);
1342 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1343 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));
1344 PyTuple_SetItem(elt3,1,elt4);
1345 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1346 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1347 PyList_SetItem(elt2,j,elt3);
1349 PyTuple_SetItem(elt,1,elt2);
1350 PyList_SetItem(ret2,i,elt);
1355 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1357 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1358 std::size_t sz=ret.size();
1359 PyObject *retPy=PyList_New(sz);
1360 for(std::size_t i=0;i<sz;i++)
1361 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1365 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1367 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1368 std::size_t sz=ret.size();
1369 PyObject *retPy=PyList_New(sz);
1370 for(std::size_t i=0;i<sz;i++)
1371 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1377 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1380 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1381 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1382 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1383 static MEDFileField1TS *New();
1384 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1385 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1386 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1387 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1388 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1389 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1391 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1392 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1393 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1394 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1397 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1399 return MEDFileField1TS::New(fileName,loadAll);
1402 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1404 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1407 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1409 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1414 return MEDFileField1TS::New();
1417 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1419 const DataArrayDouble *arr=0;
1421 arr=field->getArray();
1422 self->copyTinyInfoFrom(field,arr);
1425 std::string __str__() const throw(INTERP_KERNEL::Exception)
1427 return self->simpleRepr();
1430 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1432 DataArrayInt *ret1=0;
1433 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1434 PyObject *ret=PyTuple_New(2);
1435 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1436 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1440 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1442 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1443 std::vector< std::vector<TypeOfField> > typesF;
1444 std::vector< std::vector<std::string> > pfls;
1445 std::vector< std::vector<std::string> > locs;
1446 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1448 PyObject *ret2=PyList_New(sz);
1449 for(int i=0;i<sz;i++)
1451 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1452 const std::vector<TypeOfField>& typesFI=typesF[i];
1453 const std::vector<std::string>& pflsI=pfls[i];
1454 const std::vector<std::string>& locsI=locs[i];
1455 PyObject *elt=PyTuple_New(2);
1456 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1457 int sz2=ret[i].size();
1458 PyObject *elt2=PyList_New(sz2);
1459 for(int j=0;j<sz2;j++)
1461 PyObject *elt3=PyTuple_New(4);
1462 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1463 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1464 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1465 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1466 PyList_SetItem(elt2,j,elt3);
1468 PyTuple_SetItem(elt,1,elt2);
1469 PyList_SetItem(ret2,i,elt);
1474 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1476 DataArrayDouble *ret=self->getUndergroundDataArray();
1482 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1484 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1485 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1488 PyObject *ret=PyTuple_New(2);
1489 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1490 std::size_t sz=elt1Cpp.size();
1491 PyObject *elt=PyList_New(sz);
1492 for(std::size_t i=0;i<sz;i++)
1494 PyObject *elt1=PyTuple_New(2);
1495 PyObject *elt2=PyTuple_New(2);
1496 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1497 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1498 PyObject *elt3=PyTuple_New(2);
1499 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1500 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1501 PyTuple_SetItem(elt1,0,elt2);
1502 PyTuple_SetItem(elt1,1,elt3);
1503 PyList_SetItem(elt,i,elt1);
1505 PyTuple_SetItem(ret,1,elt);
1511 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1514 static MEDFileIntField1TS *New();
1515 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1516 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1517 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1518 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1520 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1521 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1524 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1526 return MEDFileIntField1TS::New();
1529 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1531 return MEDFileIntField1TS::New(fileName,loadAll);
1534 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1536 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1539 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1541 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1544 std::string __str__() const throw(INTERP_KERNEL::Exception)
1546 return self->simpleRepr();
1549 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1551 DataArrayInt *ret1=0;
1552 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1553 PyObject *ret=PyTuple_New(2);
1554 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1555 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1559 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1561 DataArrayInt *ret1=0;
1562 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1563 PyObject *ret=PyTuple_New(2);
1564 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1565 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1569 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1571 DataArrayInt *ret1=0;
1572 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1573 PyObject *ret=PyTuple_New(2);
1574 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1575 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1579 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1581 DataArrayInt *ret1=0;
1582 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1583 PyObject *ret=PyTuple_New(2);
1584 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1585 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1589 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1591 DataArrayInt *ret1=0;
1592 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1593 PyObject *ret=PyTuple_New(2);
1594 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1595 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1599 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1601 DataArrayInt *ret1=0;
1602 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1603 PyObject *ret=PyTuple_New(2);
1604 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1605 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1609 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1611 DataArrayInt *ret=self->getUndergroundDataArray();
1619 class MEDFileAnyTypeFieldMultiTSIterator
1624 PyObject *next() throw(INTERP_KERNEL::Exception)
1626 MEDFileAnyTypeField1TS *ret=self->nextt();
1628 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1631 PyErr_SetString(PyExc_StopIteration,"No more data.");
1638 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1641 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1642 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1643 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1644 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1645 std::string getName() const throw(INTERP_KERNEL::Exception);
1646 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1647 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1648 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1649 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1650 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1651 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1652 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1653 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1654 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1655 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1656 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1657 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1658 void loadArrays() throw(INTERP_KERNEL::Exception);
1659 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1660 void unloadArrays() throw(INTERP_KERNEL::Exception);
1661 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1663 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1664 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1665 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1666 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1667 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1670 int __len__() const throw(INTERP_KERNEL::Exception)
1672 return self->getNumberOfTS();
1675 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1677 if(elt0 && PyInt_Check(elt0))
1679 int pos=PyInt_AS_LONG(elt0);
1682 else if(elt0 && PyTuple_Check(elt0))
1684 if(PyTuple_Size(elt0)==2)
1686 PyObject *o0=PyTuple_GetItem(elt0,0);
1687 PyObject *o1=PyTuple_GetItem(elt0,1);
1688 if(PyInt_Check(o0) && PyInt_Check(o1))
1690 int iter=PyInt_AS_LONG(o0);
1691 int order=PyInt_AS_LONG(o1);
1692 return self->getPosOfTimeStep(iter,order);
1695 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 !");
1698 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 !");
1700 else if(elt0 && PyFloat_Check(elt0))
1702 double val=PyFloat_AS_DOUBLE(elt0);
1703 return self->getPosGivenTime(val);
1706 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1709 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1711 std::vector< std::pair<int,int> > res=self->getIterations();
1712 PyObject *ret=PyList_New(res.size());
1714 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1716 PyObject *elt=PyTuple_New(2);
1717 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1718 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1719 PyList_SetItem(ret,rk,elt);
1724 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1726 std::vector<double> ret1;
1727 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1728 std::size_t sz=ret.size();
1729 PyObject *ret2=PyList_New(sz);
1730 for(std::size_t i=0;i<sz;i++)
1732 PyObject *elt=PyTuple_New(3);
1733 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1734 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1735 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1736 PyList_SetItem(ret2,i,elt);
1741 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1743 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1744 PyObject *ret2=PyList_New(ret.size());
1745 for(int i=0;i<(int)ret.size();i++)
1747 const std::vector<TypeOfField>& rett=ret[i];
1748 PyObject *ret3=PyList_New(rett.size());
1749 for(int j=0;j<(int)rett.size();j++)
1750 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1751 PyList_SetItem(ret2,i,ret3);
1756 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1758 std::vector<int> ret1;
1759 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1760 PyObject *elt=PyTuple_New(2);
1761 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1762 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1766 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1768 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1769 std::vector< std::vector<TypeOfField> > typesF;
1770 std::vector< std::vector<std::string> > pfls;
1771 std::vector< std::vector<std::string> > locs;
1772 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1774 PyObject *ret2=PyList_New(sz);
1775 for(int i=0;i<sz;i++)
1777 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1778 const std::vector<TypeOfField>& typesFI=typesF[i];
1779 const std::vector<std::string>& pflsI=pfls[i];
1780 const std::vector<std::string>& locsI=locs[i];
1781 PyObject *elt=PyTuple_New(2);
1782 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1783 int sz2=ret[i].size();
1784 PyObject *elt2=PyList_New(sz2);
1785 for(int j=0;j<sz2;j++)
1787 PyObject *elt3=PyTuple_New(4);
1788 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1789 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));
1790 PyTuple_SetItem(elt3,1,elt4);
1791 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1792 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1793 PyList_SetItem(elt2,j,elt3);
1795 PyTuple_SetItem(elt,1,elt2);
1796 PyList_SetItem(ret2,i,elt);
1801 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1803 if(PyList_Check(elts))
1805 int sz=PyList_Size(elts);
1806 std::vector<int> ret(sz);
1807 for(int i=0;i<sz;i++)
1809 PyObject *elt=PyList_GetItem(elts,i);
1810 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1816 std::vector<int> ret(1);
1817 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1822 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1824 if(PySlice_Check(elts))
1826 Py_ssize_t strt=2,stp=2,step=2;
1827 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1828 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1829 self->eraseTimeStepIds2(strt,stp,step);
1833 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1834 if(!idsToRemove.empty())
1835 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1839 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1843 std::vector<int> pos2;
1844 DataArrayInt *pos3=0;
1845 DataArrayIntTuple *pos4=0;
1846 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1851 self->eraseTimeStepIds(&pos1,&pos1+1);
1858 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1863 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1867 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1871 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1873 return self->iterator();
1876 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1878 if(elt0 && PyList_Check(elt0))
1880 int sz=PyList_Size(elt0);
1881 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1882 int *pt=da->getPointer();
1883 for(int i=0;i<sz;i++,pt++)
1885 PyObject *elt1=PyList_GetItem(elt0,i);
1886 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1888 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1890 else if(elt0 && PySlice_Check(elt0))
1892 Py_ssize_t strt=2,stp=2,step=2;
1893 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1894 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1895 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1898 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1901 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1903 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1904 return self->changeMeshNames(modifTab);
1907 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1909 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1910 std::size_t sz=ret.size();
1911 PyObject *retPy=PyList_New(sz);
1912 for(std::size_t i=0;i<sz;i++)
1913 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1917 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1919 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1920 std::size_t sz=ret.size();
1921 PyObject *retPy=PyList_New(sz);
1922 for(std::size_t i=0;i<sz;i++)
1923 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1927 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1929 std::vector<MEDFileAnyTypeField1TS *> tmp;
1930 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1931 self->pushBackTimeSteps(tmp);
1934 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1936 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1937 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1938 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1939 std::size_t sz=ret.size();
1940 PyObject *retPy=PyList_New(sz);
1941 for(std::size_t i=0;i<sz;i++)
1943 std::size_t sz2=ret[i].size();
1944 PyObject *ret1Py=PyList_New(sz2);
1945 for(std::size_t j=0;j<sz2;j++)
1947 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1950 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1952 PyList_SetItem(retPy,i,ret1Py);
1957 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1959 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1960 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1961 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1962 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1963 if(ret2.size()!=ret.size())
1965 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1966 throw INTERP_KERNEL::Exception(oss.str().c_str());
1968 std::size_t sz=ret.size();
1969 PyObject *retPy=PyList_New(sz);
1970 for(std::size_t i=0;i<sz;i++)
1972 std::size_t sz2=ret[i].size();
1973 PyObject *ret0Py=PyTuple_New(2);
1974 PyObject *ret1Py=PyList_New(sz2);
1975 for(std::size_t j=0;j<sz2;j++)
1977 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1980 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1982 PyTuple_SetItem(ret0Py,0,ret1Py);
1983 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1984 PyList_SetItem(retPy,i,ret0Py);
1991 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1994 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1995 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1996 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1998 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1999 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2000 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2001 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2002 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2004 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2005 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2006 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2009 MEDFileFieldMultiTS()
2011 return MEDFileFieldMultiTS::New();
2014 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2016 return MEDFileFieldMultiTS::New(fileName,loadAll);
2019 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2021 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2024 std::string __str__() const throw(INTERP_KERNEL::Exception)
2026 return self->simpleRepr();
2029 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2031 DataArrayInt *ret1=0;
2032 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2033 PyObject *ret=PyTuple_New(2);
2034 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2035 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2039 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2041 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2042 std::vector< std::vector<TypeOfField> > typesF;
2043 std::vector< std::vector<std::string> > pfls;
2044 std::vector< std::vector<std::string> > locs;
2045 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2047 PyObject *ret2=PyList_New(sz);
2048 for(int i=0;i<sz;i++)
2050 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2051 const std::vector<TypeOfField>& typesFI=typesF[i];
2052 const std::vector<std::string>& pflsI=pfls[i];
2053 const std::vector<std::string>& locsI=locs[i];
2054 PyObject *elt=PyTuple_New(2);
2055 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2056 int sz2=ret[i].size();
2057 PyObject *elt2=PyList_New(sz2);
2058 for(int j=0;j<sz2;j++)
2060 PyObject *elt3=PyTuple_New(4);
2061 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2062 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2063 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2064 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2065 PyList_SetItem(elt2,j,elt3);
2067 PyTuple_SetItem(elt,1,elt2);
2068 PyList_SetItem(ret2,i,elt);
2072 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2074 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2080 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2082 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2083 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2086 PyObject *ret=PyTuple_New(2);
2087 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2088 std::size_t sz=elt1Cpp.size();
2089 PyObject *elt=PyList_New(sz);
2090 for(std::size_t i=0;i<sz;i++)
2092 PyObject *elt1=PyTuple_New(2);
2093 PyObject *elt2=PyTuple_New(2);
2094 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2095 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2096 PyObject *elt3=PyTuple_New(2);
2097 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2098 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2099 PyTuple_SetItem(elt1,0,elt2);
2100 PyTuple_SetItem(elt1,1,elt3);
2101 PyList_SetItem(elt,i,elt1);
2103 PyTuple_SetItem(ret,1,elt);
2109 class MEDFileFieldsIterator
2114 PyObject *next() throw(INTERP_KERNEL::Exception)
2116 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2118 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2121 PyErr_SetString(PyExc_StopIteration,"No more data.");
2128 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2131 static MEDFileIntFieldMultiTS *New();
2132 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2133 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2135 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2136 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2137 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2140 MEDFileIntFieldMultiTS()
2142 return MEDFileIntFieldMultiTS::New();
2145 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2147 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2150 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2152 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2155 std::string __str__() const throw(INTERP_KERNEL::Exception)
2157 return self->simpleRepr();
2160 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2162 DataArrayInt *ret1=0;
2163 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2164 PyObject *ret=PyTuple_New(2);
2165 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2166 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2170 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2172 DataArrayInt *ret1=0;
2173 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2174 PyObject *ret=PyTuple_New(2);
2175 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2176 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2180 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2182 DataArrayInt *ret1=0;
2183 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2184 PyObject *ret=PyTuple_New(2);
2185 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2186 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2190 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2192 DataArrayInt *ret1=0;
2193 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2194 PyObject *ret=PyTuple_New(2);
2195 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2196 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2200 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2202 DataArrayInt *ret1=0;
2203 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2204 PyObject *ret=PyTuple_New(2);
2205 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2206 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2212 DataArrayInt *ret1=0;
2213 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2214 PyObject *ret=PyTuple_New(2);
2215 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2216 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2220 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2222 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2230 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2233 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2234 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2235 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2236 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2237 void loadArrays() throw(INTERP_KERNEL::Exception);
2238 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2239 void unloadArrays() throw(INTERP_KERNEL::Exception);
2240 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2241 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2242 int getNumberOfFields() const;
2243 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2244 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2246 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2247 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2248 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2249 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2250 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2251 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2252 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2253 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2254 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2259 return MEDFileFields::New();
2262 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2264 return MEDFileFields::New(fileName,loadAll);
2267 std::string __str__() const throw(INTERP_KERNEL::Exception)
2269 return self->simpleRepr();
2272 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2275 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2276 PyObject *ret=PyTuple_New(2);
2277 PyObject *ret_0=PyList_New(ret0.size());
2279 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2281 PyObject *elt=PyTuple_New(2);
2282 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2283 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2284 PyList_SetItem(ret_0,rk,elt);
2286 PyTuple_SetItem(ret,0,ret_0);
2287 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2288 PyTuple_SetItem(ret,1,ret_1);
2292 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2294 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2295 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2298 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2300 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2301 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2304 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2306 if(obj && PyList_Check(obj))
2308 int sz=PyList_Size(obj);
2309 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2310 int *pt=da->getPointer();
2311 for(int i=0;i<sz;i++,pt++)
2313 PyObject *elt1=PyList_GetItem(obj,i);
2314 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2316 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2319 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2322 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2324 self->setFieldAtPos(obj,field);
2328 int __len__() const throw(INTERP_KERNEL::Exception)
2330 return self->getNumberOfFields();
2333 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2335 return self->iterator();
2338 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2340 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2341 return self->changeMeshNames(modifTab);
2344 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2346 if(elt0 && PyInt_Check(elt0))
2348 return PyInt_AS_LONG(elt0);
2350 else if(elt0 && PyString_Check(elt0))
2351 return self->getPosFromFieldName(PyString_AsString(elt0));
2353 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2356 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2358 if(PyList_Check(elts))
2360 int sz=PyList_Size(elts);
2361 std::vector<int> ret(sz);
2362 for(int i=0;i<sz;i++)
2364 PyObject *elt=PyList_GetItem(elts,i);
2365 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2371 std::vector<int> ret(1);
2372 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2377 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2379 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2380 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2381 self->pushFields(tmp);
2384 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2386 if(elts && PySlice_Check(elts))
2388 Py_ssize_t strt=2,stp=2,step=2;
2389 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2390 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2391 self->destroyFieldsAtPos2(strt,stp,step);
2395 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2396 if(!idsToRemove.empty())
2397 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2403 class MEDFileParameter1TS : public RefCountObject
2406 void setIteration(int it);
2407 int getIteration() const;
2408 void setOrder(int order);
2409 int getOrder() const;
2410 void setTimeValue(double time);
2411 void setTime(int dt, int it, double time);
2412 double getTime(int& dt, int& it);
2413 double getTimeValue() const;
2416 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2419 void setValue(double val) throw(INTERP_KERNEL::Exception);
2420 double getValue() const throw(INTERP_KERNEL::Exception);
2421 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2424 std::string __str__() const throw(INTERP_KERNEL::Exception)
2426 return self->simpleRepr();
2431 class MEDFileParameterTinyInfo : public MEDFileWritable
2434 void setDescription(const std::string& name);
2435 std::string getDescription() const;
2436 void setTimeUnit(const std::string& unit);
2437 std::string getTimeUnit() const;
2440 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2443 static MEDFileParameterDouble1TS *New();
2444 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2445 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2446 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2447 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2448 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2449 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2450 std::string getName() const throw(INTERP_KERNEL::Exception);
2451 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2454 MEDFileParameterDouble1TS()
2456 return MEDFileParameterDouble1TS::New();
2459 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2461 return MEDFileParameterDouble1TS::New(fileName);
2464 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2466 return MEDFileParameterDouble1TS::New(fileName,paramName);
2469 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2471 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2474 std::string __str__() const throw(INTERP_KERNEL::Exception)
2476 return self->simpleRepr();
2479 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2482 bool ret0=self->isEqual(other,eps,what);
2483 PyObject *res=PyList_New(2);
2484 PyObject *ret0Py=ret0?Py_True:Py_False;
2486 PyList_SetItem(res,0,ret0Py);
2487 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2493 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2496 static MEDFileParameterMultiTS *New();
2497 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2498 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2499 std::string getName() const;
2500 void setName(const std::string& name);
2501 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2502 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2503 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2504 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2505 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2506 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2507 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2508 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2511 MEDFileParameterMultiTS()
2513 return MEDFileParameterMultiTS::New();
2516 MEDFileParameterMultiTS(const std::string& fileName)
2518 return MEDFileParameterMultiTS::New(fileName);
2521 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2523 return MEDFileParameterMultiTS::New(fileName,paramName);
2526 std::string __str__() const throw(INTERP_KERNEL::Exception)
2528 return self->simpleRepr();
2531 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2534 bool ret0=self->isEqual(other,eps,what);
2535 PyObject *res=PyList_New(2);
2536 PyObject *ret0Py=ret0?Py_True:Py_False;
2538 PyList_SetItem(res,0,ret0Py);
2539 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2543 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2547 std::vector<int> pos2;
2548 DataArrayInt *pos3=0;
2549 DataArrayIntTuple *pos4=0;
2550 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2555 self->eraseTimeStepIds(&pos1,&pos1+1);
2562 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2567 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2571 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2575 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2577 if(elt0 && PyInt_Check(elt0))
2579 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2582 else if(elt0 && PyTuple_Check(elt0))
2584 if(PyTuple_Size(elt0)==2)
2586 PyObject *o0=PyTuple_GetItem(elt0,0);
2587 PyObject *o1=PyTuple_GetItem(elt0,1);
2588 if(PyInt_Check(o0) && PyInt_Check(o1))
2590 int iter=PyInt_AS_LONG(o0);
2591 int order=PyInt_AS_LONG(o1);
2592 return self->getPosOfTimeStep(iter,order);
2595 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 !");
2598 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 !");
2600 else if(elt0 && PyFloat_Check(elt0))
2602 double val=PyFloat_AS_DOUBLE(elt0);
2603 return self->getPosGivenTime(val);
2606 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2609 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2611 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2617 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2619 if(PyList_Check(elts))
2621 int sz=PyList_Size(elts);
2622 std::vector<int> ret(sz);
2623 for(int i=0;i<sz;i++)
2625 PyObject *elt=PyList_GetItem(elts,i);
2626 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2632 std::vector<int> ret(1);
2633 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2638 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2640 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2641 if(!idsToRemove.empty())
2642 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2645 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2647 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2653 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2655 std::vector< std::pair<int,int> > res=self->getIterations();
2656 PyObject *ret=PyList_New(res.size());
2658 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2660 PyObject *elt=PyTuple_New(2);
2661 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2662 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2663 PyList_SetItem(ret,rk,elt);
2668 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2670 std::vector<double> res2;
2671 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2672 PyObject *ret=PyList_New(res.size());
2674 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2676 PyObject *elt=PyTuple_New(3);
2677 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2678 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2679 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2680 PyList_SetItem(ret,rk,elt);
2687 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2690 static MEDFileParameters *New();
2691 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2692 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2693 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2694 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2695 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2696 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2697 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2698 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2699 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2700 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2701 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2706 return MEDFileParameters::New();
2709 MEDFileParameters(const std::string& fileName)
2711 return MEDFileParameters::New(fileName);
2714 std::string __str__() const throw(INTERP_KERNEL::Exception)
2716 return self->simpleRepr();
2719 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2721 if(PyInt_Check(obj))
2723 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2728 else if(PyString_Check(obj))
2730 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2736 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2739 int __len__() const throw(INTERP_KERNEL::Exception)
2741 return self->getNumberOfParams();
2744 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2746 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2752 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2754 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2760 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2763 bool ret0=self->isEqual(other,eps,what);
2764 PyObject *res=PyList_New(2);
2765 PyObject *ret0Py=ret0?Py_True:Py_False;
2767 PyList_SetItem(res,0,ret0Py);
2768 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2774 class MEDFileData : public RefCountObject, public MEDFileWritable
2777 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2778 static MEDFileData *New();
2779 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2780 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2781 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2782 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2783 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2784 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2785 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2787 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2788 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2790 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2793 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2795 return MEDFileData::New(fileName);
2800 return MEDFileData::New();
2803 std::string __str__() const throw(INTERP_KERNEL::Exception)
2805 return self->simpleRepr();
2808 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2810 MEDFileMeshes *ret=self->getMeshes();
2816 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2818 MEDFileParameters *ret=self->getParams();
2824 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2826 MEDFileFields *ret=self->getFields();
2832 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2834 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2835 return self->changeMeshNames(modifTab);
2840 class SauvReader : public RefCountObject
2843 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2844 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2847 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2849 return SauvReader::New(fileName);
2854 class SauvWriter : public RefCountObject
2857 static SauvWriter * New();
2858 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2859 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2860 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2861 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2864 SauvWriter() throw(INTERP_KERNEL::Exception)
2866 return SauvWriter::New();
2873 class MEDFileMeshStruct;
2875 class MEDFileField1TSStructItem
2878 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2881 class MEDFileMeshStruct : public RefCountObject
2884 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2886 ~MEDFileMeshStruct();
2889 class MEDMeshMultiLev : public RefCountObject
2892 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2893 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2899 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2901 DataArrayInt *famIds(0);
2902 bool isWithoutCopy(false);
2903 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2904 PyObject *ret=PyTuple_New(2);
2905 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2907 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2908 PyTuple_SetItem(ret,1,ret1Py);
2912 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2914 DataArrayInt *numIds(0);
2915 bool isWithoutCopy(false);
2916 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2917 PyObject *ret=PyTuple_New(2);
2918 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2920 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2921 PyTuple_SetItem(ret,1,ret1Py);
2925 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2927 DataArrayInt *famIds(0);
2928 bool isWithoutCopy(false);
2929 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
2930 PyObject *ret=PyTuple_New(2);
2931 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2933 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2934 PyTuple_SetItem(ret,1,ret1Py);
2938 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2940 DataArrayInt *numIds(0);
2941 bool isWithoutCopy(false);
2942 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
2943 PyObject *ret=PyTuple_New(2);
2944 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2946 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2947 PyTuple_SetItem(ret,1,ret1Py);
2951 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
2953 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
2954 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
2955 PyObject *res(PyList_New(result.size()));
2956 for(int i=0;iL!=result.end(); i++, iL++)
2957 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2963 class MEDUMeshMultiLev : public MEDMeshMultiLev
2966 ~MEDUMeshMultiLev();
2970 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2972 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2973 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
2974 PyObject *ret0Py=ncc?Py_True:Py_False;
2976 PyObject *ret=PyTuple_New(7);
2977 PyTuple_SetItem(ret,0,ret0Py);
2978 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2979 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2980 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2981 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2982 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2983 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2989 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2992 ~MEDStructuredMeshMultiLev();
2995 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2998 ~MEDCMeshMultiLev();
3002 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3005 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3006 std::size_t sz(objs.size());
3007 PyObject *ret(PyTuple_New(2));
3008 PyObject *ret0=PyList_New(sz);
3009 for(std::size_t i=0;i<sz;i++)
3010 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3011 PyTuple_SetItem(ret,0,ret0);
3012 PyObject *ret1Py(isInternal?Py_True:Py_False);
3014 PyTuple_SetItem(ret,1,ret1Py);
3020 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3023 ~MEDCurveLinearMeshMultiLev();
3027 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3029 DataArrayDouble *ret0(0);
3030 std::vector<int> ret1;
3032 self->buildVTUArrays(ret0,ret1,ret2);
3033 std::size_t sz(ret1.size());
3034 PyObject *ret=PyTuple_New(3);
3035 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3036 PyObject *ret1Py=PyList_New(sz);
3037 for(std::size_t i=0;i<sz;i++)
3038 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3039 PyTuple_SetItem(ret,1,ret1Py);
3040 PyObject *ret2Py(ret2?Py_True:Py_False);
3042 PyTuple_SetItem(ret,2,ret2Py);
3048 class MEDFileFastCellSupportComparator : public RefCountObject
3051 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3052 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3053 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3054 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3056 ~MEDFileFastCellSupportComparator();
3060 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3062 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3063 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3064 PyObject *res(PyList_New(result.size()));
3065 for(int i=0;iL!=result.end(); i++, iL++)
3066 PyList_SetItem(res,i,PyInt_FromLong(*iL));