1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
101 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
102 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
103 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
104 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
105 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
111 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
112 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
113 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
114 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
115 %newobject ParaMEDMEM::MEDFileCMesh::New;
116 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
117 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
118 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
119 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
120 %newobject ParaMEDMEM::MEDFileMeshes::New;
121 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
122 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
123 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
124 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
125 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
127 %newobject ParaMEDMEM::MEDFileFields::New;
128 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
129 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
130 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
131 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
132 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
133 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
134 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
135 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
136 %newobject ParaMEDMEM::MEDFileFields::__iter__;
138 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
143 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
144 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
145 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
152 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
153 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
154 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
156 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
157 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
158 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
159 %newobject ParaMEDMEM::MEDFileField1TS::New;
160 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
161 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
162 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
163 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
164 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
165 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
166 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
167 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
168 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
170 %newobject ParaMEDMEM::MEDFileData::New;
171 %newobject ParaMEDMEM::MEDFileData::deepCpy;
172 %newobject ParaMEDMEM::MEDFileData::getMeshes;
173 %newobject ParaMEDMEM::MEDFileData::getFields;
174 %newobject ParaMEDMEM::MEDFileData::getParams;
176 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
177 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
178 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
179 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
180 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
181 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
182 %newobject ParaMEDMEM::MEDFileParameters::New;
183 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
184 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
185 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
186 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
188 %newobject ParaMEDMEM::SauvWriter::New;
189 %newobject ParaMEDMEM::SauvReader::New;
190 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
192 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
193 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
194 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
195 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
196 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
198 %feature("unref") MEDFileMesh "$this->decrRef();"
199 %feature("unref") MEDFileUMesh "$this->decrRef();"
200 %feature("unref") MEDFileCMesh "$this->decrRef();"
201 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
202 %feature("unref") MEDFileMeshes "$this->decrRef();"
203 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
204 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
205 %feature("unref") MEDFileField1TS "$this->decrRef();"
206 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
207 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
208 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
209 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
210 %feature("unref") MEDFileFields "$this->decrRef();"
211 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
212 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
213 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
214 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
215 %feature("unref") MEDFileParameters "$this->decrRef();"
216 %feature("unref") MEDFileData "$this->decrRef();"
217 %feature("unref") SauvReader "$this->decrRef();"
218 %feature("unref") SauvWriter "$this->decrRef();"
219 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
220 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
221 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
222 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
223 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
224 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
229 static bool HasXDR();
230 static std::string MEDFileVersionStr();
231 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
232 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
233 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
234 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
245 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
246 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
247 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
250 static PyObject *MEDFileVersion()
252 int major,minor,release;
253 MEDLoader::MEDFileVersion(major,minor,release);
254 PyObject *ret(PyTuple_New(3));
255 PyTuple_SetItem(ret,0,SWIG_From_int(major));
256 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
257 PyTuple_SetItem(ret,2,SWIG_From_int(release));
261 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
263 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
264 PyObject *ret=PyList_New(res.size());
266 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
268 PyObject *elt=PyTuple_New(2);
269 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
270 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
271 PyList_SetItem(ret,rk,elt);
276 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
278 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
279 PyObject *ret=PyList_New(res.size());
281 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
283 PyObject *elt=PyTuple_New(3);
284 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
285 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
286 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
287 PyList_SetItem(ret,rk,elt);
292 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
294 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
295 PyObject *ret=PyList_New(res.size());
297 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
299 PyObject *elt=PyTuple_New(2);
300 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
301 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
302 PyList_SetItem(ret,rk,elt);
306 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
308 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
309 PyObject *ret=PyList_New(res.size());
311 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
313 PyObject *elt=PyTuple_New(2);
314 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
315 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
316 PyList_SetItem(ret,rk,elt);
320 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
322 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
323 PyObject *ret=PyList_New(res.size());
325 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
327 PyObject *elt=PyTuple_New(2);
328 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
329 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
330 PyList_SetItem(ret,rk,elt);
334 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
336 int meshDim,spaceDim,numberOfNodes;
337 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
338 PyObject *ret=PyTuple_New(4);
339 PyObject *elt0=PyList_New(res.size());
341 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
343 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
345 PyObject *elt1=PyList_New(obj2.size());
346 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
348 PyObject *elt2=PyTuple_New(2);
349 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
350 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
351 PyList_SetItem(elt1,j,elt2);
353 PyList_SetItem(elt0,i,elt1);
355 PyTuple_SetItem(ret,0,elt0);
356 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
357 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
358 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
361 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
362 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
364 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
365 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
366 return convertFieldDoubleVecToPy(res);
368 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
370 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
371 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
372 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
374 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
376 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
377 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
378 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
380 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
382 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
383 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
384 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
386 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
388 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
390 PyObject *ret=PyList_New(size);
391 for(int i=0;i<size;i++)
392 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
395 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
397 std::vector<std::string> grps;
398 converPyListToVecString(li,grps);
399 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
401 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
403 std::vector<std::string> fams;
404 converPyListToVecString(li,fams);
405 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
408 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
409 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
410 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
411 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
412 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
413 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);
414 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);
415 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);
416 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);
417 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);
418 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
419 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
420 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
421 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
422 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
423 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
428 class MEDFileWritable
431 void copyOptionsFrom(const MEDFileWritable& other) const;
432 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
433 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
434 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
435 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
438 class MEDFileMeshReadSelector
441 MEDFileMeshReadSelector();
442 MEDFileMeshReadSelector(unsigned int code);
443 unsigned int getCode() const;
444 void setCode(unsigned int newCode);
445 bool isCellFamilyFieldReading() const;
446 bool isNodeFamilyFieldReading() const;
447 bool isCellNameFieldReading() const;
448 bool isNodeNameFieldReading() const;
449 bool isCellNumFieldReading() const;
450 bool isNodeNumFieldReading() const;
451 void setCellFamilyFieldReading(bool b);
452 void setNodeFamilyFieldReading(bool b);
453 void setCellNameFieldReading(bool b);
454 void setNodeNameFieldReading(bool b);
455 void setCellNumFieldReading(bool b);
456 void setNodeNumFieldReading(bool b);
459 std::string __str__() const throw(INTERP_KERNEL::Exception)
461 std::ostringstream oss;
466 std::string __repr__() const throw(INTERP_KERNEL::Exception)
468 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
474 class MEDFileMesh : public RefCountObject, public MEDFileWritable
477 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
478 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
479 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
480 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
481 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
482 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
483 void setName(const std::string& name);
484 std::string getName();
485 std::string getUnivName() const;
486 bool getUnivNameWrStatus() const;
487 void setUnivNameWrStatus(bool newStatus);
488 void setDescription(const std::string& name);
489 std::string getDescription() const;
490 void setOrder(int order);
491 int getOrder() const;
492 void setIteration(int it);
494 void setTimeValue(double time);
495 void setTime(int dt, int it, double time);
496 double getTimeValue() const;
497 void setTimeUnit(const std::string& unit);
498 std::string getTimeUnit() const;
499 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
500 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
501 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
502 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
503 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
504 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
505 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
506 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
507 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
508 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
509 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
510 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
512 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
513 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
514 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
515 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
516 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
517 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
518 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
519 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
520 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
521 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
522 void clearGrpMap() throw(INTERP_KERNEL::Exception);
523 void clearFamMap() throw(INTERP_KERNEL::Exception);
524 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
525 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
526 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
527 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
528 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
529 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
530 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
531 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
532 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
533 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
534 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
535 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
536 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
537 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
538 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
539 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
540 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
541 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
542 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
543 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
544 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
545 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
546 void setFamilyInfo(const std::map<std::string,int>& info);
547 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
548 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
549 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
550 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
551 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
552 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
553 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
554 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
555 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
556 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
557 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
558 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
559 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
560 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
561 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
562 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
563 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
564 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
565 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
566 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
567 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
569 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
570 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
571 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
572 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
573 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
583 std::string __str__() const throw(INTERP_KERNEL::Exception)
585 return self->simpleRepr();
588 PyObject *getTime() throw(INTERP_KERNEL::Exception)
591 double tmp0=self->getTime(tmp1,tmp2);
592 PyObject *res = PyList_New(3);
593 PyList_SetItem(res,0,SWIG_From_int(tmp1));
594 PyList_SetItem(res,1,SWIG_From_int(tmp2));
595 PyList_SetItem(res,2,SWIG_From_double(tmp0));
599 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
602 bool ret0=self->isEqual(other,eps,what);
603 PyObject *res=PyList_New(2);
604 PyObject *ret0Py=ret0?Py_True:Py_False;
606 PyList_SetItem(res,0,ret0Py);
607 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
611 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
613 std::vector<const DataArrayInt *> grps;
614 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
615 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
618 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
621 bool ret0=self->areFamsEqual(other,what);
622 PyObject *res=PyList_New(2);
623 PyObject *ret0Py=ret0?Py_True:Py_False;
625 PyList_SetItem(res,0,ret0Py);
626 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
630 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
633 bool ret0=self->areGrpsEqual(other,what);
634 PyObject *res=PyList_New(2);
635 PyObject *ret0Py=ret0?Py_True:Py_False;
637 PyList_SetItem(res,0,ret0Py);
638 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
642 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
644 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
645 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
646 PyObject *res=PyList_New(result.size());
647 for(int i=0;iL!=result.end(); i++, iL++)
648 PyList_SetItem(res,i,PyInt_FromLong(*iL));
652 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
654 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
655 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
656 PyObject *res=PyList_New(result.size());
657 for(int i=0;iL!=result.end(); i++, iL++)
658 PyList_SetItem(res,i,PyInt_FromLong(*iL));
662 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
664 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
667 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
670 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
672 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
675 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
678 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
680 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
683 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
686 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
688 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
691 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
694 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
697 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
698 PyObject *ret=PyTuple_New(2);
699 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
700 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
704 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
706 DataArrayInt *ret3=0;
707 std::vector<int> ret1,ret2;
708 bool ret0=self->unPolyze(ret1,ret2,ret3);
709 PyObject *ret=PyTuple_New(4);
710 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
712 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
713 for(int j=0;j<(int)ret1.size()/3;j++)
715 PyObject *retLev2=PyList_New(3);
716 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
717 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
718 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
719 PyList_SetItem(retLev1_0,j,retLev2);
721 PyTuple_SetItem(ret,1,retLev1_0);
723 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
724 for(int j=0;j<(int)ret2.size()/3;j++)
726 PyObject *retLev2=PyList_New(3);
727 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
728 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
729 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
730 PyList_SetItem(retLev1_1,j,retLev2);
732 PyTuple_SetItem(ret,2,retLev1_1);
734 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
740 class MEDFileUMesh : public MEDFileMesh
743 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
744 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
745 static MEDFileUMesh *New();
747 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
748 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
750 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
751 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
752 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
753 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
754 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
755 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
756 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
757 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
758 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
759 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
760 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
761 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
762 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
763 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
764 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
765 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
766 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
767 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
768 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
769 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
771 int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
772 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
773 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
774 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
775 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
776 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
777 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
778 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
779 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
780 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
781 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
782 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
783 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
784 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
787 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
789 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
792 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
794 return MEDFileUMesh::New(fileName,mrs);
799 return MEDFileUMesh::New();
803 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
805 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
808 static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
810 std::vector<int> typesCpp1;
811 convertPyToNewIntArr3(types,typesCpp1);
812 std::size_t sz(typesCpp1.size());
813 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
814 for(std::size_t ii=0;ii<sz;ii++)
815 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
816 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
819 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
820 {// put an empty dict in input to say to __new__ to call __init__...
821 PyObject *ret(PyTuple_New(1));
822 PyObject *ret0(PyDict_New());
823 PyTuple_SetItem(ret,0,ret0);
827 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
829 std::vector<double> a0;
831 std::vector<std::string> a2;
832 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
833 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
834 self->serialize(a0,a1,a2,a3,a4);
835 PyObject *ret(PyTuple_New(5));
836 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
837 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
839 PyObject *ret2(PyList_New(sz));
840 for(int i=0;i<sz;i++)
841 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
842 PyTuple_SetItem(ret,2,ret2);
844 PyObject *ret3(PyList_New(sz));
845 for(int i=0;i<sz;i++)
847 DataArrayInt *elt(a3[i]);
850 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
852 PyTuple_SetItem(ret,3,ret3);
853 DataArrayDouble *ret4(a4);
856 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
860 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
862 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
863 if(!PyTuple_Check(inp))
864 throw INTERP_KERNEL::Exception(MSG);
865 int sz(PyTuple_Size(inp));
867 throw INTERP_KERNEL::Exception(MSG);
868 std::vector<double> a0;
870 std::vector<std::string> a2;
871 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
872 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
874 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
876 fillArrayWithPyListDbl3(a0py,tmp,a0);
877 convertPyToNewIntArr3(a1py,a1);
878 fillStringVector(a2py,a2);
880 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
882 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
883 if(!SWIG_IsOK(status))
884 throw INTERP_KERNEL::Exception(MSG);
885 a4=reinterpret_cast<DataArrayDouble *>(argp);
886 if((DataArrayDouble *)a4)
889 std::vector< DataArrayInt * > a3Tmp;
890 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
891 std::size_t sz(a3Tmp.size());
893 for(std::size_t i=0;i<sz;i++)
899 self->unserialize(a0,a1,a2,a3,a4);
903 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
905 std::vector<const MEDCouplingUMesh *> ms;
906 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
907 self->setMeshes(ms,renum);
910 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
912 std::vector<const MEDCouplingUMesh *> ms;
913 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
914 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
917 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
919 std::vector<const MEDCouplingUMesh *> ms;
920 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
921 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
924 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
926 DataArrayDouble *ret=self->getCoords();
932 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
934 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
937 return const_cast<PartDefinition *>(ret);
940 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
942 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
943 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
944 PyObject *ret=PyTuple_New(3);
945 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
946 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
947 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
951 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
953 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
959 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
961 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
962 std::size_t sz(tmp.size());
963 PyObject *ret=PyList_New(sz);
964 for(std::size_t i=0;i<sz;i++)
968 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
975 class MEDFileStructuredMesh : public MEDFileMesh
980 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
982 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
990 class MEDFileCMesh : public MEDFileStructuredMesh
993 static MEDFileCMesh *New();
994 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
995 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
996 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
997 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1002 return MEDFileCMesh::New();
1005 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1007 return MEDFileCMesh::New(fileName,mrs);
1010 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1012 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1015 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1017 const MEDCouplingCMesh *tmp=self->getMesh();
1020 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1025 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1028 static MEDFileCurveLinearMesh *New();
1029 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1030 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1031 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1034 MEDFileCurveLinearMesh()
1036 return MEDFileCurveLinearMesh::New();
1039 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1041 return MEDFileCurveLinearMesh::New(fileName,mrs);
1044 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1046 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1049 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1051 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1054 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1059 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1062 static MEDFileMeshMultiTS *New();
1063 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1064 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1065 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1066 std::string getName() const throw(INTERP_KERNEL::Exception);
1067 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1068 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1071 MEDFileMeshMultiTS()
1073 return MEDFileMeshMultiTS::New();
1076 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1078 return MEDFileMeshMultiTS::New(fileName);
1081 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1083 return MEDFileMeshMultiTS::New(fileName,mName);
1086 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1088 MEDFileMesh *ret=self->getOneTimeStep();
1096 class MEDFileMeshesIterator
1101 PyObject *next() throw(INTERP_KERNEL::Exception)
1103 MEDFileMesh *ret=self->nextt();
1107 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1111 PyErr_SetString(PyExc_StopIteration,"No more data.");
1118 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1121 static MEDFileMeshes *New();
1122 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1123 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1124 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1125 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1126 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1128 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1129 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1130 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1131 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1136 return MEDFileMeshes::New();
1139 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1141 return MEDFileMeshes::New(fileName);
1144 std::string __str__() const throw(INTERP_KERNEL::Exception)
1146 return self->simpleRepr();
1149 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1151 if(PyInt_Check(obj))
1153 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1158 else if(PyString_Check(obj))
1160 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1166 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1169 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1171 self->setMeshAtPos(obj,mesh);
1175 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1177 return self->iterator();
1180 int __len__() const throw(INTERP_KERNEL::Exception)
1182 return self->getNumberOfMeshes();
1185 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1187 MEDFileMesh *ret=self->getMeshAtPos(i);
1192 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1194 MEDFileMesh *ret=self->getMeshWithName(mname);
1202 class MEDFileFieldLoc : public RefCountObject
1205 std::string getName() const;
1206 int getDimension() const;
1207 int getNumberOfGaussPoints() const;
1208 int getNumberOfPointsInCells() const;
1209 const std::vector<double>& getRefCoords() const;
1210 const std::vector<double>& getGaussCoords() const;
1211 const std::vector<double>& getGaussWeights() const;
1212 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1215 std::string __str__() const throw(INTERP_KERNEL::Exception)
1217 return self->repr();
1222 class MEDFileFieldGlobsReal
1225 void resetContent();
1226 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1227 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1228 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1229 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1230 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1231 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1232 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1233 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1234 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1235 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1236 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1237 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1238 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1239 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1240 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1241 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1242 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1243 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1244 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1245 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1246 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1247 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1248 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1249 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1250 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1251 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1254 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1256 const DataArrayInt *ret=self->getProfile(pflName);
1259 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1262 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1264 const DataArrayInt *ret=self->getProfileFromId(pflId);
1267 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1270 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1272 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1275 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1278 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1280 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1283 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1286 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1288 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1289 return convertVecPairVecStToPy(ret);
1292 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1294 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1295 return convertVecPairVecStToPy(ret);
1298 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1300 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1301 self->changePflsNames(v);
1304 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1306 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1307 self->changePflsRefsNamesGen(v);
1310 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1312 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1313 self->changePflsNamesInStruct(v);
1316 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1318 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1319 self->changeLocsNames(v);
1322 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1324 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1325 self->changeLocsRefsNamesGen(v);
1328 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1330 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1331 self->changeLocsNamesInStruct(v);
1334 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1336 std::ostringstream oss;
1337 self->simpleReprGlobs(oss);
1343 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1346 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1347 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1348 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1349 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1350 void loadArrays() throw(INTERP_KERNEL::Exception);
1351 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1352 void unloadArrays() throw(INTERP_KERNEL::Exception);
1353 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1354 int getDimension() const throw(INTERP_KERNEL::Exception);
1355 int getIteration() const throw(INTERP_KERNEL::Exception);
1356 int getOrder() const throw(INTERP_KERNEL::Exception);
1357 std::string getName() throw(INTERP_KERNEL::Exception);
1358 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1359 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1360 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1361 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1362 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1363 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1364 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1365 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1366 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1367 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1368 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1369 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1370 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1371 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1372 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1375 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1378 double tmp0=self->getTime(tmp1,tmp2);
1379 PyObject *res = PyList_New(3);
1380 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1381 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1382 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1386 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1388 std::pair<int,int> res=self->getDtIt();
1389 PyObject *elt=PyTuple_New(2);
1390 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1391 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1395 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1397 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1400 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1402 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1405 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1407 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1408 return self->changeMeshNames(modifTab);
1411 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1413 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1414 PyObject *ret2=PyList_New(ret.size());
1415 for(int i=0;i<(int)ret.size();i++)
1416 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1420 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1422 std::vector<int> ret1;
1423 int ret0=self->getNonEmptyLevels(mname,ret1);
1424 PyObject *elt=PyTuple_New(2);
1425 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1426 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1430 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1432 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1433 std::vector< std::vector<TypeOfField> > typesF;
1434 std::vector< std::vector<std::string> > pfls;
1435 std::vector< std::vector<std::string> > locs;
1436 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1438 PyObject *ret2=PyList_New(sz);
1439 for(int i=0;i<sz;i++)
1441 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1442 const std::vector<TypeOfField>& typesFI=typesF[i];
1443 const std::vector<std::string>& pflsI=pfls[i];
1444 const std::vector<std::string>& locsI=locs[i];
1445 PyObject *elt=PyTuple_New(2);
1446 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1447 int sz2=ret[i].size();
1448 PyObject *elt2=PyList_New(sz2);
1449 for(int j=0;j<sz2;j++)
1451 PyObject *elt3=PyTuple_New(4);
1452 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1453 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));
1454 PyTuple_SetItem(elt3,1,elt4);
1455 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1456 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1457 PyList_SetItem(elt2,j,elt3);
1459 PyTuple_SetItem(elt,1,elt2);
1460 PyList_SetItem(ret2,i,elt);
1465 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1467 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1468 std::size_t sz=ret.size();
1469 PyObject *retPy=PyList_New(sz);
1470 for(std::size_t i=0;i<sz;i++)
1471 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1475 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1477 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1478 std::size_t sz=ret.size();
1479 PyObject *retPy=PyList_New(sz);
1480 for(std::size_t i=0;i<sz;i++)
1481 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1485 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1487 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1488 std::size_t sz=ret.size();
1489 PyObject *retPy=PyList_New(sz);
1490 for(std::size_t i=0;i<sz;i++)
1491 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1497 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1500 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1501 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1502 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1503 static MEDFileField1TS *New();
1504 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1505 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1506 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1507 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1508 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1509 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1511 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1512 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1513 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1514 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1517 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1519 return MEDFileField1TS::New(fileName,loadAll);
1522 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1524 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1527 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1529 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1534 return MEDFileField1TS::New();
1537 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1539 const DataArrayDouble *arr=0;
1541 arr=field->getArray();
1542 self->copyTinyInfoFrom(field,arr);
1545 std::string __str__() const throw(INTERP_KERNEL::Exception)
1547 return self->simpleRepr();
1550 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1552 DataArrayInt *ret1=0;
1553 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1554 PyObject *ret=PyTuple_New(2);
1555 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1556 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1560 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1562 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1563 std::vector< std::vector<TypeOfField> > typesF;
1564 std::vector< std::vector<std::string> > pfls;
1565 std::vector< std::vector<std::string> > locs;
1566 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1568 PyObject *ret2=PyList_New(sz);
1569 for(int i=0;i<sz;i++)
1571 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1572 const std::vector<TypeOfField>& typesFI=typesF[i];
1573 const std::vector<std::string>& pflsI=pfls[i];
1574 const std::vector<std::string>& locsI=locs[i];
1575 PyObject *elt=PyTuple_New(2);
1576 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1577 int sz2=ret[i].size();
1578 PyObject *elt2=PyList_New(sz2);
1579 for(int j=0;j<sz2;j++)
1581 PyObject *elt3=PyTuple_New(4);
1582 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1583 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1584 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1585 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1586 PyList_SetItem(elt2,j,elt3);
1588 PyTuple_SetItem(elt,1,elt2);
1589 PyList_SetItem(ret2,i,elt);
1594 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1596 DataArrayDouble *ret=self->getUndergroundDataArray();
1602 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1604 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1605 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1608 PyObject *ret=PyTuple_New(2);
1609 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1610 std::size_t sz=elt1Cpp.size();
1611 PyObject *elt=PyList_New(sz);
1612 for(std::size_t i=0;i<sz;i++)
1614 PyObject *elt1=PyTuple_New(2);
1615 PyObject *elt2=PyTuple_New(2);
1616 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1617 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1618 PyObject *elt3=PyTuple_New(2);
1619 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1620 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1621 PyTuple_SetItem(elt1,0,elt2);
1622 PyTuple_SetItem(elt1,1,elt3);
1623 PyList_SetItem(elt,i,elt1);
1625 PyTuple_SetItem(ret,1,elt);
1631 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1634 static MEDFileIntField1TS *New();
1635 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1636 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1637 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1638 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1640 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1641 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1644 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1646 return MEDFileIntField1TS::New();
1649 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1651 return MEDFileIntField1TS::New(fileName,loadAll);
1654 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1656 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1659 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1661 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1664 std::string __str__() const throw(INTERP_KERNEL::Exception)
1666 return self->simpleRepr();
1669 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1671 DataArrayInt *ret1=0;
1672 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1673 PyObject *ret=PyTuple_New(2);
1674 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1675 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1679 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1681 DataArrayInt *ret1=0;
1682 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1683 PyObject *ret=PyTuple_New(2);
1684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1689 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1691 DataArrayInt *ret1=0;
1692 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1693 PyObject *ret=PyTuple_New(2);
1694 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1695 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1699 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1701 DataArrayInt *ret1=0;
1702 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1703 PyObject *ret=PyTuple_New(2);
1704 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1705 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1709 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1711 DataArrayInt *ret1=0;
1712 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1713 PyObject *ret=PyTuple_New(2);
1714 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1715 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1719 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1721 DataArrayInt *ret1=0;
1722 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1723 PyObject *ret=PyTuple_New(2);
1724 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1725 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1729 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1731 DataArrayInt *ret=self->getUndergroundDataArray();
1739 class MEDFileAnyTypeFieldMultiTSIterator
1744 PyObject *next() throw(INTERP_KERNEL::Exception)
1746 MEDFileAnyTypeField1TS *ret=self->nextt();
1748 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1751 PyErr_SetString(PyExc_StopIteration,"No more data.");
1758 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1761 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1762 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1763 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1764 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1765 std::string getName() const throw(INTERP_KERNEL::Exception);
1766 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1767 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1768 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1769 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1770 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1771 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1772 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1773 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1774 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1775 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1776 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1777 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1778 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1779 void loadArrays() throw(INTERP_KERNEL::Exception);
1780 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1781 void unloadArrays() throw(INTERP_KERNEL::Exception);
1782 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1784 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1785 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1786 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1787 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1788 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1791 int __len__() const throw(INTERP_KERNEL::Exception)
1793 return self->getNumberOfTS();
1796 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1798 if(elt0 && PyInt_Check(elt0))
1800 int pos=PyInt_AS_LONG(elt0);
1803 else if(elt0 && PyTuple_Check(elt0))
1805 if(PyTuple_Size(elt0)==2)
1807 PyObject *o0=PyTuple_GetItem(elt0,0);
1808 PyObject *o1=PyTuple_GetItem(elt0,1);
1809 if(PyInt_Check(o0) && PyInt_Check(o1))
1811 int iter=PyInt_AS_LONG(o0);
1812 int order=PyInt_AS_LONG(o1);
1813 return self->getPosOfTimeStep(iter,order);
1816 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 !");
1819 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 !");
1821 else if(elt0 && PyFloat_Check(elt0))
1823 double val=PyFloat_AS_DOUBLE(elt0);
1824 return self->getPosGivenTime(val);
1827 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1830 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1832 std::vector< std::pair<int,int> > res=self->getIterations();
1833 PyObject *ret=PyList_New(res.size());
1835 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1837 PyObject *elt=PyTuple_New(2);
1838 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1839 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1840 PyList_SetItem(ret,rk,elt);
1845 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1847 std::vector<double> ret1;
1848 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1849 std::size_t sz=ret.size();
1850 PyObject *ret2=PyList_New(sz);
1851 for(std::size_t i=0;i<sz;i++)
1853 PyObject *elt=PyTuple_New(3);
1854 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1855 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1856 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1857 PyList_SetItem(ret2,i,elt);
1862 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1864 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1865 PyObject *ret2=PyList_New(ret.size());
1866 for(int i=0;i<(int)ret.size();i++)
1868 const std::vector<TypeOfField>& rett=ret[i];
1869 PyObject *ret3=PyList_New(rett.size());
1870 for(int j=0;j<(int)rett.size();j++)
1871 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1872 PyList_SetItem(ret2,i,ret3);
1877 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1879 std::vector<int> ret1;
1880 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1881 PyObject *elt=PyTuple_New(2);
1882 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1883 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1887 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1889 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1890 std::vector< std::vector<TypeOfField> > typesF;
1891 std::vector< std::vector<std::string> > pfls;
1892 std::vector< std::vector<std::string> > locs;
1893 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1895 PyObject *ret2=PyList_New(sz);
1896 for(int i=0;i<sz;i++)
1898 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1899 const std::vector<TypeOfField>& typesFI=typesF[i];
1900 const std::vector<std::string>& pflsI=pfls[i];
1901 const std::vector<std::string>& locsI=locs[i];
1902 PyObject *elt=PyTuple_New(2);
1903 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1904 int sz2=ret[i].size();
1905 PyObject *elt2=PyList_New(sz2);
1906 for(int j=0;j<sz2;j++)
1908 PyObject *elt3=PyTuple_New(4);
1909 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1910 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));
1911 PyTuple_SetItem(elt3,1,elt4);
1912 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1913 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1914 PyList_SetItem(elt2,j,elt3);
1916 PyTuple_SetItem(elt,1,elt2);
1917 PyList_SetItem(ret2,i,elt);
1922 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1924 if(PyList_Check(elts))
1926 int sz=PyList_Size(elts);
1927 std::vector<int> ret(sz);
1928 for(int i=0;i<sz;i++)
1930 PyObject *elt=PyList_GetItem(elts,i);
1931 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1937 std::vector<int> ret(1);
1938 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1943 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1945 if(PySlice_Check(elts))
1947 Py_ssize_t strt=2,stp=2,step=2;
1948 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1949 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1950 self->eraseTimeStepIds2(strt,stp,step);
1954 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1955 if(!idsToRemove.empty())
1956 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1960 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1964 std::vector<int> pos2;
1965 DataArrayInt *pos3=0;
1966 DataArrayIntTuple *pos4=0;
1967 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1972 self->eraseTimeStepIds(&pos1,&pos1+1);
1979 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1984 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1988 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1992 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1994 return self->iterator();
1997 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1999 if(elt0 && PyList_Check(elt0))
2001 int sz=PyList_Size(elt0);
2002 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2003 int *pt=da->getPointer();
2004 for(int i=0;i<sz;i++,pt++)
2006 PyObject *elt1=PyList_GetItem(elt0,i);
2007 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2009 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2011 else if(elt0 && PySlice_Check(elt0))
2013 Py_ssize_t strt=2,stp=2,step=2;
2014 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2015 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2016 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2019 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2022 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2024 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2025 return self->changeMeshNames(modifTab);
2028 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2030 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2031 std::size_t sz=ret.size();
2032 PyObject *retPy=PyList_New(sz);
2033 for(std::size_t i=0;i<sz;i++)
2034 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2038 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2040 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2041 std::size_t sz=ret.size();
2042 PyObject *retPy=PyList_New(sz);
2043 for(std::size_t i=0;i<sz;i++)
2044 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2048 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2050 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2051 std::size_t sz=ret.size();
2052 PyObject *retPy=PyList_New(sz);
2053 for(std::size_t i=0;i<sz;i++)
2054 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2058 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2060 std::vector<MEDFileAnyTypeField1TS *> tmp;
2061 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2062 self->pushBackTimeSteps(tmp);
2065 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2067 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2068 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2069 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2070 std::size_t sz=ret.size();
2071 PyObject *retPy=PyList_New(sz);
2072 for(std::size_t i=0;i<sz;i++)
2074 std::size_t sz2=ret[i].size();
2075 PyObject *ret1Py=PyList_New(sz2);
2076 for(std::size_t j=0;j<sz2;j++)
2078 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2081 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2083 PyList_SetItem(retPy,i,ret1Py);
2088 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2090 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2091 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2092 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2093 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2094 if(ret2.size()!=ret.size())
2096 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2097 throw INTERP_KERNEL::Exception(oss.str().c_str());
2099 std::size_t sz=ret.size();
2100 PyObject *retPy=PyList_New(sz);
2101 for(std::size_t i=0;i<sz;i++)
2103 std::size_t sz2=ret[i].size();
2104 PyObject *ret0Py=PyTuple_New(2);
2105 PyObject *ret1Py=PyList_New(sz2);
2106 for(std::size_t j=0;j<sz2;j++)
2108 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2111 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2113 PyTuple_SetItem(ret0Py,0,ret1Py);
2114 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2115 PyList_SetItem(retPy,i,ret0Py);
2122 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2125 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2126 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2127 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2129 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2130 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2131 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2132 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2133 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2135 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2136 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2137 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2140 MEDFileFieldMultiTS()
2142 return MEDFileFieldMultiTS::New();
2145 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2147 return MEDFileFieldMultiTS::New(fileName,loadAll);
2150 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2152 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2155 std::string __str__() const throw(INTERP_KERNEL::Exception)
2157 return self->simpleRepr();
2160 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2162 DataArrayInt *ret1=0;
2163 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2164 PyObject *ret=PyTuple_New(2);
2165 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 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 *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2172 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2173 std::vector< std::vector<TypeOfField> > typesF;
2174 std::vector< std::vector<std::string> > pfls;
2175 std::vector< std::vector<std::string> > locs;
2176 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2178 PyObject *ret2=PyList_New(sz);
2179 for(int i=0;i<sz;i++)
2181 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2182 const std::vector<TypeOfField>& typesFI=typesF[i];
2183 const std::vector<std::string>& pflsI=pfls[i];
2184 const std::vector<std::string>& locsI=locs[i];
2185 PyObject *elt=PyTuple_New(2);
2186 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2187 int sz2=ret[i].size();
2188 PyObject *elt2=PyList_New(sz2);
2189 for(int j=0;j<sz2;j++)
2191 PyObject *elt3=PyTuple_New(4);
2192 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2193 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2194 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2195 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2196 PyList_SetItem(elt2,j,elt3);
2198 PyTuple_SetItem(elt,1,elt2);
2199 PyList_SetItem(ret2,i,elt);
2203 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2205 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2211 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2213 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2214 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2217 PyObject *ret=PyTuple_New(2);
2218 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2219 std::size_t sz=elt1Cpp.size();
2220 PyObject *elt=PyList_New(sz);
2221 for(std::size_t i=0;i<sz;i++)
2223 PyObject *elt1=PyTuple_New(2);
2224 PyObject *elt2=PyTuple_New(2);
2225 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2226 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2227 PyObject *elt3=PyTuple_New(2);
2228 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2229 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2230 PyTuple_SetItem(elt1,0,elt2);
2231 PyTuple_SetItem(elt1,1,elt3);
2232 PyList_SetItem(elt,i,elt1);
2234 PyTuple_SetItem(ret,1,elt);
2240 class MEDFileFieldsIterator
2245 PyObject *next() throw(INTERP_KERNEL::Exception)
2247 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2249 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2252 PyErr_SetString(PyExc_StopIteration,"No more data.");
2259 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2262 static MEDFileIntFieldMultiTS *New();
2263 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2264 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2266 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2267 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2268 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2271 MEDFileIntFieldMultiTS()
2273 return MEDFileIntFieldMultiTS::New();
2276 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2278 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2281 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2283 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2286 std::string __str__() const throw(INTERP_KERNEL::Exception)
2288 return self->simpleRepr();
2291 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2293 DataArrayInt *ret1=0;
2294 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2295 PyObject *ret=PyTuple_New(2);
2296 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2297 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2301 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2303 DataArrayInt *ret1=0;
2304 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2305 PyObject *ret=PyTuple_New(2);
2306 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2307 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2311 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2313 DataArrayInt *ret1=0;
2314 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2315 PyObject *ret=PyTuple_New(2);
2316 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2317 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2321 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2323 DataArrayInt *ret1=0;
2324 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2325 PyObject *ret=PyTuple_New(2);
2326 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2327 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2331 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2333 DataArrayInt *ret1=0;
2334 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2335 PyObject *ret=PyTuple_New(2);
2336 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2337 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2341 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2343 DataArrayInt *ret1=0;
2344 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2345 PyObject *ret=PyTuple_New(2);
2346 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2351 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2353 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2361 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2364 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2365 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2366 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2367 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2368 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2369 void loadArrays() throw(INTERP_KERNEL::Exception);
2370 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2371 void unloadArrays() throw(INTERP_KERNEL::Exception);
2372 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2373 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2374 int getNumberOfFields() const;
2375 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2376 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2378 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2379 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2380 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2381 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2382 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2383 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2384 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2385 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2386 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2391 return MEDFileFields::New();
2394 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2396 return MEDFileFields::New(fileName,loadAll);
2399 std::string __str__() const throw(INTERP_KERNEL::Exception)
2401 return self->simpleRepr();
2404 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2407 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2408 PyObject *ret=PyTuple_New(2);
2409 PyObject *ret_0=PyList_New(ret0.size());
2411 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2413 PyObject *elt=PyTuple_New(2);
2414 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2415 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2416 PyList_SetItem(ret_0,rk,elt);
2418 PyTuple_SetItem(ret,0,ret_0);
2419 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2420 PyTuple_SetItem(ret,1,ret_1);
2424 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2426 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2427 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2430 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2432 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2433 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2436 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2438 if(obj && PyList_Check(obj))
2440 int sz=PyList_Size(obj);
2441 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2442 int *pt=da->getPointer();
2443 for(int i=0;i<sz;i++,pt++)
2445 PyObject *elt1=PyList_GetItem(obj,i);
2446 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2448 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2451 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2454 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2456 self->setFieldAtPos(obj,field);
2460 int __len__() const throw(INTERP_KERNEL::Exception)
2462 return self->getNumberOfFields();
2465 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2467 return self->iterator();
2470 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2472 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2473 return self->changeMeshNames(modifTab);
2476 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2478 if(elt0 && PyInt_Check(elt0))
2480 return PyInt_AS_LONG(elt0);
2482 else if(elt0 && PyString_Check(elt0))
2483 return self->getPosFromFieldName(PyString_AsString(elt0));
2485 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2488 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2490 if(PyList_Check(elts))
2492 int sz=PyList_Size(elts);
2493 std::vector<int> ret(sz);
2494 for(int i=0;i<sz;i++)
2496 PyObject *elt=PyList_GetItem(elts,i);
2497 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2503 std::vector<int> ret(1);
2504 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2509 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2511 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2512 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2513 self->pushFields(tmp);
2516 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2518 if(elts && PySlice_Check(elts))
2520 Py_ssize_t strt=2,stp=2,step=2;
2521 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2522 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2523 self->destroyFieldsAtPos2(strt,stp,step);
2527 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2528 if(!idsToRemove.empty())
2529 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2535 class MEDFileParameter1TS : public RefCountObject
2538 void setIteration(int it);
2539 int getIteration() const;
2540 void setOrder(int order);
2541 int getOrder() const;
2542 void setTimeValue(double time);
2543 void setTime(int dt, int it, double time);
2544 double getTime(int& dt, int& it);
2545 double getTimeValue() const;
2548 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2551 void setValue(double val) throw(INTERP_KERNEL::Exception);
2552 double getValue() const throw(INTERP_KERNEL::Exception);
2553 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2556 std::string __str__() const throw(INTERP_KERNEL::Exception)
2558 return self->simpleRepr();
2563 class MEDFileParameterTinyInfo : public MEDFileWritable
2566 void setDescription(const std::string& name);
2567 std::string getDescription() const;
2568 void setTimeUnit(const std::string& unit);
2569 std::string getTimeUnit() const;
2572 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2575 static MEDFileParameterDouble1TS *New();
2576 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2577 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2578 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2579 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2580 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2581 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2582 std::string getName() const throw(INTERP_KERNEL::Exception);
2583 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2586 MEDFileParameterDouble1TS()
2588 return MEDFileParameterDouble1TS::New();
2591 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2593 return MEDFileParameterDouble1TS::New(fileName);
2596 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2598 return MEDFileParameterDouble1TS::New(fileName,paramName);
2601 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2603 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2606 std::string __str__() const throw(INTERP_KERNEL::Exception)
2608 return self->simpleRepr();
2611 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2614 bool ret0=self->isEqual(other,eps,what);
2615 PyObject *res=PyList_New(2);
2616 PyObject *ret0Py=ret0?Py_True:Py_False;
2618 PyList_SetItem(res,0,ret0Py);
2619 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2625 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2628 static MEDFileParameterMultiTS *New();
2629 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2630 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2631 std::string getName() const;
2632 void setName(const std::string& name);
2633 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2634 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2635 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2636 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2637 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2638 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2639 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2640 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2643 MEDFileParameterMultiTS()
2645 return MEDFileParameterMultiTS::New();
2648 MEDFileParameterMultiTS(const std::string& fileName)
2650 return MEDFileParameterMultiTS::New(fileName);
2653 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2655 return MEDFileParameterMultiTS::New(fileName,paramName);
2658 std::string __str__() const throw(INTERP_KERNEL::Exception)
2660 return self->simpleRepr();
2663 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2666 bool ret0=self->isEqual(other,eps,what);
2667 PyObject *res=PyList_New(2);
2668 PyObject *ret0Py=ret0?Py_True:Py_False;
2670 PyList_SetItem(res,0,ret0Py);
2671 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2675 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2679 std::vector<int> pos2;
2680 DataArrayInt *pos3=0;
2681 DataArrayIntTuple *pos4=0;
2682 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2687 self->eraseTimeStepIds(&pos1,&pos1+1);
2694 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2699 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2703 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2707 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2709 if(elt0 && PyInt_Check(elt0))
2711 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2714 else if(elt0 && PyTuple_Check(elt0))
2716 if(PyTuple_Size(elt0)==2)
2718 PyObject *o0=PyTuple_GetItem(elt0,0);
2719 PyObject *o1=PyTuple_GetItem(elt0,1);
2720 if(PyInt_Check(o0) && PyInt_Check(o1))
2722 int iter=PyInt_AS_LONG(o0);
2723 int order=PyInt_AS_LONG(o1);
2724 return self->getPosOfTimeStep(iter,order);
2727 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 !");
2730 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 !");
2732 else if(elt0 && PyFloat_Check(elt0))
2734 double val=PyFloat_AS_DOUBLE(elt0);
2735 return self->getPosGivenTime(val);
2738 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2741 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2743 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2749 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2751 if(PyList_Check(elts))
2753 int sz=PyList_Size(elts);
2754 std::vector<int> ret(sz);
2755 for(int i=0;i<sz;i++)
2757 PyObject *elt=PyList_GetItem(elts,i);
2758 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2764 std::vector<int> ret(1);
2765 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2770 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2772 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2773 if(!idsToRemove.empty())
2774 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2777 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2779 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2785 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2787 std::vector< std::pair<int,int> > res=self->getIterations();
2788 PyObject *ret=PyList_New(res.size());
2790 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2792 PyObject *elt=PyTuple_New(2);
2793 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2794 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2795 PyList_SetItem(ret,rk,elt);
2800 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2802 std::vector<double> res2;
2803 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2804 PyObject *ret=PyList_New(res.size());
2806 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2808 PyObject *elt=PyTuple_New(3);
2809 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2810 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2811 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2812 PyList_SetItem(ret,rk,elt);
2819 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2822 static MEDFileParameters *New();
2823 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2824 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2825 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2826 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2827 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2828 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2829 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2830 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2831 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2832 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2833 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2838 return MEDFileParameters::New();
2841 MEDFileParameters(const std::string& fileName)
2843 return MEDFileParameters::New(fileName);
2846 std::string __str__() const throw(INTERP_KERNEL::Exception)
2848 return self->simpleRepr();
2851 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2853 if(PyInt_Check(obj))
2855 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2860 else if(PyString_Check(obj))
2862 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2868 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2871 int __len__() const throw(INTERP_KERNEL::Exception)
2873 return self->getNumberOfParams();
2876 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2878 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2884 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2886 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2892 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2895 bool ret0=self->isEqual(other,eps,what);
2896 PyObject *res=PyList_New(2);
2897 PyObject *ret0Py=ret0?Py_True:Py_False;
2899 PyList_SetItem(res,0,ret0Py);
2900 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2906 class MEDFileData : public RefCountObject, public MEDFileWritable
2909 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2910 static MEDFileData *New();
2911 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2912 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2913 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2914 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2915 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2916 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2917 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2919 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2920 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2922 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2925 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2927 return MEDFileData::New(fileName);
2932 return MEDFileData::New();
2935 std::string __str__() const throw(INTERP_KERNEL::Exception)
2937 return self->simpleRepr();
2940 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2942 MEDFileMeshes *ret=self->getMeshes();
2948 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2950 MEDFileParameters *ret=self->getParams();
2956 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2958 MEDFileFields *ret=self->getFields();
2964 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2966 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2967 return self->changeMeshNames(modifTab);
2972 class SauvReader : public RefCountObject
2975 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2976 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2979 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2981 return SauvReader::New(fileName);
2986 class SauvWriter : public RefCountObject
2989 static SauvWriter * New();
2990 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2991 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2992 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2993 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2996 SauvWriter() throw(INTERP_KERNEL::Exception)
2998 return SauvWriter::New();
3005 class MEDFileMeshStruct;
3007 class MEDFileField1TSStructItem
3010 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3013 class MEDFileMeshStruct : public RefCountObject
3016 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3018 ~MEDFileMeshStruct();
3021 class MEDMeshMultiLev : public RefCountObject
3024 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3025 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3031 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3033 DataArrayInt *famIds(0);
3034 bool isWithoutCopy(false);
3035 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3036 PyObject *ret=PyTuple_New(2);
3037 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3039 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3040 PyTuple_SetItem(ret,1,ret1Py);
3044 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3046 DataArrayInt *numIds(0);
3047 bool isWithoutCopy(false);
3048 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3049 PyObject *ret=PyTuple_New(2);
3050 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3052 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3053 PyTuple_SetItem(ret,1,ret1Py);
3057 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3059 DataArrayInt *famIds(0);
3060 bool isWithoutCopy(false);
3061 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3062 PyObject *ret=PyTuple_New(2);
3063 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3065 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3066 PyTuple_SetItem(ret,1,ret1Py);
3070 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3072 DataArrayInt *numIds(0);
3073 bool isWithoutCopy(false);
3074 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3075 PyObject *ret=PyTuple_New(2);
3076 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3078 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3079 PyTuple_SetItem(ret,1,ret1Py);
3083 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3085 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3086 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3087 PyObject *res(PyList_New(result.size()));
3088 for(int i=0;iL!=result.end(); i++, iL++)
3089 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3095 class MEDUMeshMultiLev : public MEDMeshMultiLev
3098 ~MEDUMeshMultiLev();
3102 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3104 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3105 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3106 PyObject *ret0Py=ncc?Py_True:Py_False;
3108 PyObject *ret=PyTuple_New(7);
3109 PyTuple_SetItem(ret,0,ret0Py);
3110 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3111 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3112 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3113 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3114 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3115 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3121 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3124 ~MEDStructuredMeshMultiLev();
3127 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3130 ~MEDCMeshMultiLev();
3134 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3137 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3138 std::size_t sz(objs.size());
3139 PyObject *ret(PyTuple_New(2));
3140 PyObject *ret0=PyList_New(sz);
3141 for(std::size_t i=0;i<sz;i++)
3142 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3143 PyTuple_SetItem(ret,0,ret0);
3144 PyObject *ret1Py(isInternal?Py_True:Py_False);
3146 PyTuple_SetItem(ret,1,ret1Py);
3152 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3155 ~MEDCurveLinearMeshMultiLev();
3159 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3161 DataArrayDouble *ret0(0);
3162 std::vector<int> ret1;
3164 self->buildVTUArrays(ret0,ret1,ret2);
3165 std::size_t sz(ret1.size());
3166 PyObject *ret=PyTuple_New(3);
3167 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3168 PyObject *ret1Py=PyList_New(sz);
3169 for(std::size_t i=0;i<sz;i++)
3170 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3171 PyTuple_SetItem(ret,1,ret1Py);
3172 PyObject *ret2Py(ret2?Py_True:Py_False);
3174 PyTuple_SetItem(ret,2,ret2Py);
3180 class MEDFileFastCellSupportComparator : public RefCountObject
3183 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3184 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3185 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3186 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3188 ~MEDFileFastCellSupportComparator();
3192 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3194 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3195 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3196 PyObject *res(PyList_New(result.size()));
3197 for(int i=0;iL!=result.end(); i++, iL++)
3198 PyList_SetItem(res,i,PyInt_FromLong(*iL));