1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
101 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
102 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
103 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
104 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
105 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
111 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
112 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
113 %newobject ParaMEDMEM::MEDFileCMesh::New;
114 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
115 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
116 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
117 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
118 %newobject ParaMEDMEM::MEDFileMeshes::New;
119 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
120 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
121 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
122 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
123 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
125 %newobject ParaMEDMEM::MEDFileFields::New;
126 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
127 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
128 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
129 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
130 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
131 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
132 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
133 %newobject ParaMEDMEM::MEDFileFields::__iter__;
135 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
136 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
137 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
138 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
142 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
143 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
144 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
145 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
149 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
150 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
151 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
153 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
154 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
155 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
156 %newobject ParaMEDMEM::MEDFileField1TS::New;
157 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
158 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
159 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
160 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
161 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
162 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
163 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
164 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
165 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
167 %newobject ParaMEDMEM::MEDFileData::New;
168 %newobject ParaMEDMEM::MEDFileData::deepCpy;
169 %newobject ParaMEDMEM::MEDFileData::getMeshes;
170 %newobject ParaMEDMEM::MEDFileData::getFields;
171 %newobject ParaMEDMEM::MEDFileData::getParams;
173 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
174 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
175 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
176 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
177 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
178 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
179 %newobject ParaMEDMEM::MEDFileParameters::New;
180 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
181 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
182 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
183 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
185 %newobject ParaMEDMEM::SauvWriter::New;
186 %newobject ParaMEDMEM::SauvReader::New;
187 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
189 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
190 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
191 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
192 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
193 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
195 %feature("unref") MEDFileMesh "$this->decrRef();"
196 %feature("unref") MEDFileUMesh "$this->decrRef();"
197 %feature("unref") MEDFileCMesh "$this->decrRef();"
198 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
199 %feature("unref") MEDFileMeshes "$this->decrRef();"
200 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
201 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
202 %feature("unref") MEDFileField1TS "$this->decrRef();"
203 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
204 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
205 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
207 %feature("unref") MEDFileFields "$this->decrRef();"
208 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
209 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
210 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
211 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
212 %feature("unref") MEDFileParameters "$this->decrRef();"
213 %feature("unref") MEDFileData "$this->decrRef();"
214 %feature("unref") SauvReader "$this->decrRef();"
215 %feature("unref") SauvWriter "$this->decrRef();"
216 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
217 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
218 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
219 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
220 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
221 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
226 static bool HasXDR();
227 static std::string MEDFileVersionStr();
228 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
229 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
230 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
231 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
243 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
244 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
247 static PyObject *MEDFileVersion()
249 int major,minor,release;
250 MEDLoader::MEDFileVersion(major,minor,release);
251 PyObject *ret(PyTuple_New(3));
252 PyTuple_SetItem(ret,0,SWIG_From_int(major));
253 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
254 PyTuple_SetItem(ret,2,SWIG_From_int(release));
258 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
260 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
261 PyObject *ret=PyList_New(res.size());
263 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
265 PyObject *elt=PyTuple_New(2);
266 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
267 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
268 PyList_SetItem(ret,rk,elt);
273 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
275 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
276 PyObject *ret=PyList_New(res.size());
278 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
280 PyObject *elt=PyTuple_New(3);
281 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
282 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
283 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
284 PyList_SetItem(ret,rk,elt);
289 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
291 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
292 PyObject *ret=PyList_New(res.size());
294 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
296 PyObject *elt=PyTuple_New(2);
297 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
298 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
299 PyList_SetItem(ret,rk,elt);
303 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
305 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
306 PyObject *ret=PyList_New(res.size());
308 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
310 PyObject *elt=PyTuple_New(2);
311 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
312 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
313 PyList_SetItem(ret,rk,elt);
317 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
319 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
320 PyObject *ret=PyList_New(res.size());
322 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
324 PyObject *elt=PyTuple_New(2);
325 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
326 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
327 PyList_SetItem(ret,rk,elt);
331 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
333 int meshDim,spaceDim,numberOfNodes;
334 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
335 PyObject *ret=PyTuple_New(4);
336 PyObject *elt0=PyList_New(res.size());
338 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
340 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
342 PyObject *elt1=PyList_New(obj2.size());
343 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
345 PyObject *elt2=PyTuple_New(2);
346 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
347 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
348 PyList_SetItem(elt1,j,elt2);
350 PyList_SetItem(elt0,i,elt1);
352 PyTuple_SetItem(ret,0,elt0);
353 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
354 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
355 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
358 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
359 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
361 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
362 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
363 return convertFieldDoubleVecToPy(res);
365 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
367 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
368 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
369 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
371 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
373 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
374 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
375 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
377 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
379 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
380 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
381 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
383 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
385 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
387 PyObject *ret=PyList_New(size);
388 for(int i=0;i<size;i++)
389 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
392 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
394 std::vector<std::string> grps;
395 converPyListToVecString(li,grps);
396 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
398 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
400 std::vector<std::string> fams;
401 converPyListToVecString(li,fams);
402 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
405 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
406 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
407 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
408 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
409 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
410 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);
411 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);
412 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);
413 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);
414 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);
415 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
416 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
417 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
418 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
419 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
420 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
425 class MEDFileWritable
428 void copyOptionsFrom(const MEDFileWritable& other) const;
429 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
430 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
431 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
432 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
435 class MEDFileMeshReadSelector
438 MEDFileMeshReadSelector();
439 MEDFileMeshReadSelector(unsigned int code);
440 unsigned int getCode() const;
441 void setCode(unsigned int newCode);
442 bool isCellFamilyFieldReading() const;
443 bool isNodeFamilyFieldReading() const;
444 bool isCellNameFieldReading() const;
445 bool isNodeNameFieldReading() const;
446 bool isCellNumFieldReading() const;
447 bool isNodeNumFieldReading() const;
448 void setCellFamilyFieldReading(bool b);
449 void setNodeFamilyFieldReading(bool b);
450 void setCellNameFieldReading(bool b);
451 void setNodeNameFieldReading(bool b);
452 void setCellNumFieldReading(bool b);
453 void setNodeNumFieldReading(bool b);
456 std::string __str__() const throw(INTERP_KERNEL::Exception)
458 std::ostringstream oss;
463 std::string __repr__() const throw(INTERP_KERNEL::Exception)
465 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
471 class MEDFileMesh : public RefCountObject, public MEDFileWritable
474 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
475 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
476 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
477 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
478 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
479 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
480 void setName(const std::string& name);
481 std::string getName();
482 std::string getUnivName() const;
483 bool getUnivNameWrStatus() const;
484 void setUnivNameWrStatus(bool newStatus);
485 void setDescription(const std::string& name);
486 std::string getDescription() const;
487 void setOrder(int order);
488 int getOrder() const;
489 void setIteration(int it);
491 void setTimeValue(double time);
492 void setTime(int dt, int it, double time);
493 double getTimeValue() const;
494 void setTimeUnit(const std::string& unit);
495 std::string getTimeUnit() const;
496 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
497 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
498 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
499 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
500 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
501 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
502 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
503 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
504 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
505 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
506 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
507 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
509 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
510 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
511 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
512 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
513 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
514 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
515 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
516 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
517 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
518 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
519 void clearGrpMap() throw(INTERP_KERNEL::Exception);
520 void clearFamMap() throw(INTERP_KERNEL::Exception);
521 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
522 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
523 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
524 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
525 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
526 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
527 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
528 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
529 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
530 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
531 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
532 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
533 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
534 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
535 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
536 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
537 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
538 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
539 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
540 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
541 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
542 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
543 void setFamilyInfo(const std::map<std::string,int>& info);
544 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
545 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
546 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
547 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
548 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
549 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
550 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
551 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
552 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
553 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
554 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
555 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
556 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
557 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
558 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
559 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
560 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
561 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
562 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
563 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
564 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
566 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
567 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
568 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
569 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
570 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
571 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
572 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
573 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
580 std::string __str__() const throw(INTERP_KERNEL::Exception)
582 return self->simpleRepr();
585 PyObject *getTime() throw(INTERP_KERNEL::Exception)
588 double tmp0=self->getTime(tmp1,tmp2);
589 PyObject *res = PyList_New(3);
590 PyList_SetItem(res,0,SWIG_From_int(tmp1));
591 PyList_SetItem(res,1,SWIG_From_int(tmp2));
592 PyList_SetItem(res,2,SWIG_From_double(tmp0));
596 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
599 bool ret0=self->isEqual(other,eps,what);
600 PyObject *res=PyList_New(2);
601 PyObject *ret0Py=ret0?Py_True:Py_False;
603 PyList_SetItem(res,0,ret0Py);
604 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
608 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
611 bool ret0=self->areFamsEqual(other,what);
612 PyObject *res=PyList_New(2);
613 PyObject *ret0Py=ret0?Py_True:Py_False;
615 PyList_SetItem(res,0,ret0Py);
616 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
620 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
623 bool ret0=self->areGrpsEqual(other,what);
624 PyObject *res=PyList_New(2);
625 PyObject *ret0Py=ret0?Py_True:Py_False;
627 PyList_SetItem(res,0,ret0Py);
628 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
632 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
634 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
635 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
636 PyObject *res=PyList_New(result.size());
637 for(int i=0;iL!=result.end(); i++, iL++)
638 PyList_SetItem(res,i,PyInt_FromLong(*iL));
642 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
644 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
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 *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
654 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
657 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
660 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
662 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
665 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
668 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
670 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
673 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
676 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
679 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
680 PyObject *ret=PyTuple_New(2);
681 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
682 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
686 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
688 DataArrayInt *ret3=0;
689 std::vector<int> ret1,ret2;
690 bool ret0=self->unPolyze(ret1,ret2,ret3);
691 PyObject *ret=PyTuple_New(4);
692 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
694 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
695 for(int j=0;j<(int)ret1.size()/3;j++)
697 PyObject *retLev2=PyList_New(3);
698 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
699 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
700 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
701 PyList_SetItem(retLev1_0,j,retLev2);
703 PyTuple_SetItem(ret,1,retLev1_0);
705 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
706 for(int j=0;j<(int)ret2.size()/3;j++)
708 PyObject *retLev2=PyList_New(3);
709 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
710 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
711 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
712 PyList_SetItem(retLev1_1,j,retLev2);
714 PyTuple_SetItem(ret,2,retLev1_1);
716 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
722 class MEDFileUMesh : public MEDFileMesh
725 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
726 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
727 static MEDFileUMesh *New();
729 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
731 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
732 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
733 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
734 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
735 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
736 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
737 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
738 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
739 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
740 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
741 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
742 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
743 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
744 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
745 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
746 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
747 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
748 DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
749 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
750 DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
751 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
752 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
753 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
754 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
755 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
756 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
757 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
759 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
760 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
761 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
762 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
763 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
764 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
765 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
766 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
767 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
768 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
769 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
770 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
773 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
775 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
778 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
780 return MEDFileUMesh::New(fileName,mrs);
785 return MEDFileUMesh::New();
788 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)
790 std::vector<int> typesCpp1;
791 convertPyToNewIntArr3(types,typesCpp1);
792 std::size_t sz(typesCpp1.size());
793 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
794 for(std::size_t ii=0;ii<sz;ii++)
795 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
796 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
799 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
801 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
804 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
807 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
809 std::vector<const DataArrayInt *> grps;
810 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
811 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
814 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
816 std::vector<const MEDCouplingUMesh *> ms;
817 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
818 self->setMeshes(ms,renum);
821 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
823 std::vector<const MEDCouplingUMesh *> ms;
824 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
825 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
828 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
830 std::vector<const MEDCouplingUMesh *> ms;
831 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
832 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
835 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
837 DataArrayDouble *ret=self->getCoords();
843 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
845 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
846 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
847 PyObject *ret=PyTuple_New(3);
848 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
849 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
850 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
854 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
856 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
862 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
864 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
865 std::size_t sz(tmp.size());
866 PyObject *ret=PyList_New(sz);
867 for(std::size_t i=0;i<sz;i++)
871 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
878 class MEDFileStructuredMesh : public MEDFileMesh
883 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
885 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
893 class MEDFileCMesh : public MEDFileStructuredMesh
896 static MEDFileCMesh *New();
897 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
898 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
899 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
900 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
905 return MEDFileCMesh::New();
908 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
910 return MEDFileCMesh::New(fileName,mrs);
913 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
915 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
918 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
920 const MEDCouplingCMesh *tmp=self->getMesh();
923 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
928 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
931 static MEDFileCurveLinearMesh *New();
932 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
933 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
934 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
937 MEDFileCurveLinearMesh()
939 return MEDFileCurveLinearMesh::New();
942 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
944 return MEDFileCurveLinearMesh::New(fileName,mrs);
947 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
949 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
952 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
954 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
957 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
962 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
965 static MEDFileMeshMultiTS *New();
966 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
967 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
968 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
969 std::string getName() const throw(INTERP_KERNEL::Exception);
970 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
971 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
976 return MEDFileMeshMultiTS::New();
979 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
981 return MEDFileMeshMultiTS::New(fileName);
984 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
986 return MEDFileMeshMultiTS::New(fileName,mName);
989 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
991 MEDFileMesh *ret=self->getOneTimeStep();
999 class MEDFileMeshesIterator
1004 PyObject *next() throw(INTERP_KERNEL::Exception)
1006 MEDFileMesh *ret=self->nextt();
1010 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1014 PyErr_SetString(PyExc_StopIteration,"No more data.");
1021 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1024 static MEDFileMeshes *New();
1025 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1026 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1027 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1028 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1029 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1031 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1032 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1033 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1034 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1039 return MEDFileMeshes::New();
1042 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1044 return MEDFileMeshes::New(fileName);
1047 std::string __str__() const throw(INTERP_KERNEL::Exception)
1049 return self->simpleRepr();
1052 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1054 if(PyInt_Check(obj))
1056 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1061 else if(PyString_Check(obj))
1063 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1069 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1072 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1074 self->setMeshAtPos(obj,mesh);
1078 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1080 return self->iterator();
1083 int __len__() const throw(INTERP_KERNEL::Exception)
1085 return self->getNumberOfMeshes();
1088 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1090 MEDFileMesh *ret=self->getMeshAtPos(i);
1095 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1097 MEDFileMesh *ret=self->getMeshWithName(mname);
1105 class MEDFileFieldLoc : public RefCountObject
1108 std::string getName() const;
1109 int getDimension() const;
1110 int getNumberOfGaussPoints() const;
1111 int getNumberOfPointsInCells() const;
1112 const std::vector<double>& getRefCoords() const;
1113 const std::vector<double>& getGaussCoords() const;
1114 const std::vector<double>& getGaussWeights() const;
1115 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1118 std::string __str__() const throw(INTERP_KERNEL::Exception)
1120 return self->repr();
1125 class MEDFileFieldGlobsReal
1128 void resetContent();
1129 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1130 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1131 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1132 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1133 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1134 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1135 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1136 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1137 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1138 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1139 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1140 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1141 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1142 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1143 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1144 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1145 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1146 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1147 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1148 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1149 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1150 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1151 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1152 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1153 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1154 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1157 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1159 const DataArrayInt *ret=self->getProfile(pflName);
1162 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1165 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1167 const DataArrayInt *ret=self->getProfileFromId(pflId);
1170 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1173 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1175 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1178 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1181 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1183 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1186 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1189 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1191 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1192 return convertVecPairVecStToPy(ret);
1195 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1197 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1198 return convertVecPairVecStToPy(ret);
1201 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1203 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1204 self->changePflsNames(v);
1207 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1209 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1210 self->changePflsRefsNamesGen(v);
1213 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1215 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1216 self->changePflsNamesInStruct(v);
1219 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1221 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1222 self->changeLocsNames(v);
1225 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1227 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1228 self->changeLocsRefsNamesGen(v);
1231 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1233 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1234 self->changeLocsNamesInStruct(v);
1237 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1239 std::ostringstream oss;
1240 self->simpleReprGlobs(oss);
1246 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1249 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1250 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1251 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1252 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1253 void loadArrays() throw(INTERP_KERNEL::Exception);
1254 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1255 void unloadArrays() throw(INTERP_KERNEL::Exception);
1256 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1257 int getDimension() const throw(INTERP_KERNEL::Exception);
1258 int getIteration() const throw(INTERP_KERNEL::Exception);
1259 int getOrder() const throw(INTERP_KERNEL::Exception);
1260 std::string getName() throw(INTERP_KERNEL::Exception);
1261 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1262 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1263 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1264 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1265 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1266 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1267 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1268 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1269 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1270 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1271 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1272 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1273 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1274 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1277 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1280 double tmp0=self->getTime(tmp1,tmp2);
1281 PyObject *res = PyList_New(3);
1282 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1283 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1284 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1288 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1290 std::pair<int,int> res=self->getDtIt();
1291 PyObject *elt=PyTuple_New(2);
1292 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1293 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1297 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1299 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1302 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1304 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1307 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1309 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1310 return self->changeMeshNames(modifTab);
1313 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1315 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1316 PyObject *ret2=PyList_New(ret.size());
1317 for(int i=0;i<(int)ret.size();i++)
1318 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1322 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1324 std::vector<int> ret1;
1325 int ret0=self->getNonEmptyLevels(mname,ret1);
1326 PyObject *elt=PyTuple_New(2);
1327 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1328 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1332 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1334 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1335 std::vector< std::vector<TypeOfField> > typesF;
1336 std::vector< std::vector<std::string> > pfls;
1337 std::vector< std::vector<std::string> > locs;
1338 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1340 PyObject *ret2=PyList_New(sz);
1341 for(int i=0;i<sz;i++)
1343 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1344 const std::vector<TypeOfField>& typesFI=typesF[i];
1345 const std::vector<std::string>& pflsI=pfls[i];
1346 const std::vector<std::string>& locsI=locs[i];
1347 PyObject *elt=PyTuple_New(2);
1348 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1349 int sz2=ret[i].size();
1350 PyObject *elt2=PyList_New(sz2);
1351 for(int j=0;j<sz2;j++)
1353 PyObject *elt3=PyTuple_New(4);
1354 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1355 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));
1356 PyTuple_SetItem(elt3,1,elt4);
1357 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1358 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1359 PyList_SetItem(elt2,j,elt3);
1361 PyTuple_SetItem(elt,1,elt2);
1362 PyList_SetItem(ret2,i,elt);
1367 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1369 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1370 std::size_t sz=ret.size();
1371 PyObject *retPy=PyList_New(sz);
1372 for(std::size_t i=0;i<sz;i++)
1373 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1377 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1379 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1380 std::size_t sz=ret.size();
1381 PyObject *retPy=PyList_New(sz);
1382 for(std::size_t i=0;i<sz;i++)
1383 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1389 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1392 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1393 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1394 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1395 static MEDFileField1TS *New();
1396 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1397 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1398 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1399 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1400 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1401 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1403 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1404 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1405 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1406 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1409 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1411 return MEDFileField1TS::New(fileName,loadAll);
1414 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1416 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1419 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1421 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1426 return MEDFileField1TS::New();
1429 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1431 const DataArrayDouble *arr=0;
1433 arr=field->getArray();
1434 self->copyTinyInfoFrom(field,arr);
1437 std::string __str__() const throw(INTERP_KERNEL::Exception)
1439 return self->simpleRepr();
1442 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1444 DataArrayInt *ret1=0;
1445 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1446 PyObject *ret=PyTuple_New(2);
1447 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1448 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1452 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1454 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1455 std::vector< std::vector<TypeOfField> > typesF;
1456 std::vector< std::vector<std::string> > pfls;
1457 std::vector< std::vector<std::string> > locs;
1458 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1460 PyObject *ret2=PyList_New(sz);
1461 for(int i=0;i<sz;i++)
1463 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1464 const std::vector<TypeOfField>& typesFI=typesF[i];
1465 const std::vector<std::string>& pflsI=pfls[i];
1466 const std::vector<std::string>& locsI=locs[i];
1467 PyObject *elt=PyTuple_New(2);
1468 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1469 int sz2=ret[i].size();
1470 PyObject *elt2=PyList_New(sz2);
1471 for(int j=0;j<sz2;j++)
1473 PyObject *elt3=PyTuple_New(4);
1474 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1475 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1476 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1477 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1478 PyList_SetItem(elt2,j,elt3);
1480 PyTuple_SetItem(elt,1,elt2);
1481 PyList_SetItem(ret2,i,elt);
1486 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1488 DataArrayDouble *ret=self->getUndergroundDataArray();
1494 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1496 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1497 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1500 PyObject *ret=PyTuple_New(2);
1501 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1502 std::size_t sz=elt1Cpp.size();
1503 PyObject *elt=PyList_New(sz);
1504 for(std::size_t i=0;i<sz;i++)
1506 PyObject *elt1=PyTuple_New(2);
1507 PyObject *elt2=PyTuple_New(2);
1508 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1509 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1510 PyObject *elt3=PyTuple_New(2);
1511 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1512 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1513 PyTuple_SetItem(elt1,0,elt2);
1514 PyTuple_SetItem(elt1,1,elt3);
1515 PyList_SetItem(elt,i,elt1);
1517 PyTuple_SetItem(ret,1,elt);
1523 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1526 static MEDFileIntField1TS *New();
1527 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1528 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1529 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1530 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1532 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1533 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1536 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1538 return MEDFileIntField1TS::New();
1541 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1543 return MEDFileIntField1TS::New(fileName,loadAll);
1546 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1548 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1551 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1553 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1556 std::string __str__() const throw(INTERP_KERNEL::Exception)
1558 return self->simpleRepr();
1561 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1563 DataArrayInt *ret1=0;
1564 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1565 PyObject *ret=PyTuple_New(2);
1566 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1567 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1571 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1573 DataArrayInt *ret1=0;
1574 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1575 PyObject *ret=PyTuple_New(2);
1576 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1577 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1581 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1583 DataArrayInt *ret1=0;
1584 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1585 PyObject *ret=PyTuple_New(2);
1586 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1587 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1591 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1593 DataArrayInt *ret1=0;
1594 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1595 PyObject *ret=PyTuple_New(2);
1596 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1597 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1601 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1603 DataArrayInt *ret1=0;
1604 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1605 PyObject *ret=PyTuple_New(2);
1606 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1607 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1611 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1613 DataArrayInt *ret1=0;
1614 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1615 PyObject *ret=PyTuple_New(2);
1616 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1617 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1621 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1623 DataArrayInt *ret=self->getUndergroundDataArray();
1631 class MEDFileAnyTypeFieldMultiTSIterator
1636 PyObject *next() throw(INTERP_KERNEL::Exception)
1638 MEDFileAnyTypeField1TS *ret=self->nextt();
1640 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1643 PyErr_SetString(PyExc_StopIteration,"No more data.");
1650 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1653 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1654 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1655 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1656 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1657 std::string getName() const throw(INTERP_KERNEL::Exception);
1658 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1659 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1660 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1661 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1662 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1663 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1664 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1665 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1666 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1667 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1668 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1669 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1670 void loadArrays() throw(INTERP_KERNEL::Exception);
1671 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1672 void unloadArrays() throw(INTERP_KERNEL::Exception);
1673 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1675 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1676 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1677 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1678 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1679 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1682 int __len__() const throw(INTERP_KERNEL::Exception)
1684 return self->getNumberOfTS();
1687 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1689 if(elt0 && PyInt_Check(elt0))
1691 int pos=PyInt_AS_LONG(elt0);
1694 else if(elt0 && PyTuple_Check(elt0))
1696 if(PyTuple_Size(elt0)==2)
1698 PyObject *o0=PyTuple_GetItem(elt0,0);
1699 PyObject *o1=PyTuple_GetItem(elt0,1);
1700 if(PyInt_Check(o0) && PyInt_Check(o1))
1702 int iter=PyInt_AS_LONG(o0);
1703 int order=PyInt_AS_LONG(o1);
1704 return self->getPosOfTimeStep(iter,order);
1707 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 !");
1710 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 !");
1712 else if(elt0 && PyFloat_Check(elt0))
1714 double val=PyFloat_AS_DOUBLE(elt0);
1715 return self->getPosGivenTime(val);
1718 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1721 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1723 std::vector< std::pair<int,int> > res=self->getIterations();
1724 PyObject *ret=PyList_New(res.size());
1726 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1728 PyObject *elt=PyTuple_New(2);
1729 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1730 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1731 PyList_SetItem(ret,rk,elt);
1736 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1738 std::vector<double> ret1;
1739 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1740 std::size_t sz=ret.size();
1741 PyObject *ret2=PyList_New(sz);
1742 for(std::size_t i=0;i<sz;i++)
1744 PyObject *elt=PyTuple_New(3);
1745 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1746 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1747 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1748 PyList_SetItem(ret2,i,elt);
1753 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1755 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1756 PyObject *ret2=PyList_New(ret.size());
1757 for(int i=0;i<(int)ret.size();i++)
1759 const std::vector<TypeOfField>& rett=ret[i];
1760 PyObject *ret3=PyList_New(rett.size());
1761 for(int j=0;j<(int)rett.size();j++)
1762 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1763 PyList_SetItem(ret2,i,ret3);
1768 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1770 std::vector<int> ret1;
1771 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1772 PyObject *elt=PyTuple_New(2);
1773 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1774 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1778 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1780 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1781 std::vector< std::vector<TypeOfField> > typesF;
1782 std::vector< std::vector<std::string> > pfls;
1783 std::vector< std::vector<std::string> > locs;
1784 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1786 PyObject *ret2=PyList_New(sz);
1787 for(int i=0;i<sz;i++)
1789 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1790 const std::vector<TypeOfField>& typesFI=typesF[i];
1791 const std::vector<std::string>& pflsI=pfls[i];
1792 const std::vector<std::string>& locsI=locs[i];
1793 PyObject *elt=PyTuple_New(2);
1794 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1795 int sz2=ret[i].size();
1796 PyObject *elt2=PyList_New(sz2);
1797 for(int j=0;j<sz2;j++)
1799 PyObject *elt3=PyTuple_New(4);
1800 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1801 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));
1802 PyTuple_SetItem(elt3,1,elt4);
1803 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1804 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1805 PyList_SetItem(elt2,j,elt3);
1807 PyTuple_SetItem(elt,1,elt2);
1808 PyList_SetItem(ret2,i,elt);
1813 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1815 if(PyList_Check(elts))
1817 int sz=PyList_Size(elts);
1818 std::vector<int> ret(sz);
1819 for(int i=0;i<sz;i++)
1821 PyObject *elt=PyList_GetItem(elts,i);
1822 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1828 std::vector<int> ret(1);
1829 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1834 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1836 if(PySlice_Check(elts))
1838 Py_ssize_t strt=2,stp=2,step=2;
1839 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1840 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1841 self->eraseTimeStepIds2(strt,stp,step);
1845 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1846 if(!idsToRemove.empty())
1847 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1851 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1855 std::vector<int> pos2;
1856 DataArrayInt *pos3=0;
1857 DataArrayIntTuple *pos4=0;
1858 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1863 self->eraseTimeStepIds(&pos1,&pos1+1);
1870 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1875 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1879 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1883 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1885 return self->iterator();
1888 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1890 if(elt0 && PyList_Check(elt0))
1892 int sz=PyList_Size(elt0);
1893 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1894 int *pt=da->getPointer();
1895 for(int i=0;i<sz;i++,pt++)
1897 PyObject *elt1=PyList_GetItem(elt0,i);
1898 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1900 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1902 else if(elt0 && PySlice_Check(elt0))
1904 Py_ssize_t strt=2,stp=2,step=2;
1905 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1906 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1907 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1910 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1913 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1915 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1916 return self->changeMeshNames(modifTab);
1919 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1921 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1922 std::size_t sz=ret.size();
1923 PyObject *retPy=PyList_New(sz);
1924 for(std::size_t i=0;i<sz;i++)
1925 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1929 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1931 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1932 std::size_t sz=ret.size();
1933 PyObject *retPy=PyList_New(sz);
1934 for(std::size_t i=0;i<sz;i++)
1935 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1939 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1941 std::vector<MEDFileAnyTypeField1TS *> tmp;
1942 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1943 self->pushBackTimeSteps(tmp);
1946 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1948 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1949 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1950 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1951 std::size_t sz=ret.size();
1952 PyObject *retPy=PyList_New(sz);
1953 for(std::size_t i=0;i<sz;i++)
1955 std::size_t sz2=ret[i].size();
1956 PyObject *ret1Py=PyList_New(sz2);
1957 for(std::size_t j=0;j<sz2;j++)
1959 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1962 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1964 PyList_SetItem(retPy,i,ret1Py);
1969 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1971 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1972 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1973 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1974 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1975 if(ret2.size()!=ret.size())
1977 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1978 throw INTERP_KERNEL::Exception(oss.str().c_str());
1980 std::size_t sz=ret.size();
1981 PyObject *retPy=PyList_New(sz);
1982 for(std::size_t i=0;i<sz;i++)
1984 std::size_t sz2=ret[i].size();
1985 PyObject *ret0Py=PyTuple_New(2);
1986 PyObject *ret1Py=PyList_New(sz2);
1987 for(std::size_t j=0;j<sz2;j++)
1989 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1992 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1994 PyTuple_SetItem(ret0Py,0,ret1Py);
1995 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1996 PyList_SetItem(retPy,i,ret0Py);
2003 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2006 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2007 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2008 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2010 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2011 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2012 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2013 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2014 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2016 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2017 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2018 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2021 MEDFileFieldMultiTS()
2023 return MEDFileFieldMultiTS::New();
2026 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2028 return MEDFileFieldMultiTS::New(fileName,loadAll);
2031 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2033 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2036 std::string __str__() const throw(INTERP_KERNEL::Exception)
2038 return self->simpleRepr();
2041 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2043 DataArrayInt *ret1=0;
2044 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2045 PyObject *ret=PyTuple_New(2);
2046 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2047 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2051 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2053 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2054 std::vector< std::vector<TypeOfField> > typesF;
2055 std::vector< std::vector<std::string> > pfls;
2056 std::vector< std::vector<std::string> > locs;
2057 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2059 PyObject *ret2=PyList_New(sz);
2060 for(int i=0;i<sz;i++)
2062 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2063 const std::vector<TypeOfField>& typesFI=typesF[i];
2064 const std::vector<std::string>& pflsI=pfls[i];
2065 const std::vector<std::string>& locsI=locs[i];
2066 PyObject *elt=PyTuple_New(2);
2067 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2068 int sz2=ret[i].size();
2069 PyObject *elt2=PyList_New(sz2);
2070 for(int j=0;j<sz2;j++)
2072 PyObject *elt3=PyTuple_New(4);
2073 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2074 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2075 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2076 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2077 PyList_SetItem(elt2,j,elt3);
2079 PyTuple_SetItem(elt,1,elt2);
2080 PyList_SetItem(ret2,i,elt);
2084 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2086 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2092 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2094 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2095 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2098 PyObject *ret=PyTuple_New(2);
2099 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2100 std::size_t sz=elt1Cpp.size();
2101 PyObject *elt=PyList_New(sz);
2102 for(std::size_t i=0;i<sz;i++)
2104 PyObject *elt1=PyTuple_New(2);
2105 PyObject *elt2=PyTuple_New(2);
2106 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2107 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2108 PyObject *elt3=PyTuple_New(2);
2109 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2110 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2111 PyTuple_SetItem(elt1,0,elt2);
2112 PyTuple_SetItem(elt1,1,elt3);
2113 PyList_SetItem(elt,i,elt1);
2115 PyTuple_SetItem(ret,1,elt);
2121 class MEDFileFieldsIterator
2126 PyObject *next() throw(INTERP_KERNEL::Exception)
2128 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2130 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2133 PyErr_SetString(PyExc_StopIteration,"No more data.");
2140 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2143 static MEDFileIntFieldMultiTS *New();
2144 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2145 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2147 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2148 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2149 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2152 MEDFileIntFieldMultiTS()
2154 return MEDFileIntFieldMultiTS::New();
2157 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2159 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2162 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2164 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2167 std::string __str__() const throw(INTERP_KERNEL::Exception)
2169 return self->simpleRepr();
2172 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2174 DataArrayInt *ret1=0;
2175 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2176 PyObject *ret=PyTuple_New(2);
2177 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2178 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2182 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2184 DataArrayInt *ret1=0;
2185 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2186 PyObject *ret=PyTuple_New(2);
2187 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2188 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2194 DataArrayInt *ret1=0;
2195 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2196 PyObject *ret=PyTuple_New(2);
2197 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2198 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2202 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2204 DataArrayInt *ret1=0;
2205 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2206 PyObject *ret=PyTuple_New(2);
2207 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2208 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2212 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2214 DataArrayInt *ret1=0;
2215 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2216 PyObject *ret=PyTuple_New(2);
2217 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2218 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2222 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2224 DataArrayInt *ret1=0;
2225 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2226 PyObject *ret=PyTuple_New(2);
2227 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2228 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2232 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2234 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2242 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2245 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2246 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2247 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2248 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2249 void loadArrays() throw(INTERP_KERNEL::Exception);
2250 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2251 void unloadArrays() throw(INTERP_KERNEL::Exception);
2252 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2253 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2254 int getNumberOfFields() const;
2255 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2256 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2258 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2259 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2260 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2261 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2262 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2263 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2264 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2265 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2266 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2271 return MEDFileFields::New();
2274 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2276 return MEDFileFields::New(fileName,loadAll);
2279 std::string __str__() const throw(INTERP_KERNEL::Exception)
2281 return self->simpleRepr();
2284 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2287 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2288 PyObject *ret=PyTuple_New(2);
2289 PyObject *ret_0=PyList_New(ret0.size());
2291 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2293 PyObject *elt=PyTuple_New(2);
2294 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2295 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2296 PyList_SetItem(ret_0,rk,elt);
2298 PyTuple_SetItem(ret,0,ret_0);
2299 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2300 PyTuple_SetItem(ret,1,ret_1);
2304 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2306 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2307 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2310 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2312 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2313 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2316 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2318 if(obj && PyList_Check(obj))
2320 int sz=PyList_Size(obj);
2321 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2322 int *pt=da->getPointer();
2323 for(int i=0;i<sz;i++,pt++)
2325 PyObject *elt1=PyList_GetItem(obj,i);
2326 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2328 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2331 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2334 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2336 self->setFieldAtPos(obj,field);
2340 int __len__() const throw(INTERP_KERNEL::Exception)
2342 return self->getNumberOfFields();
2345 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2347 return self->iterator();
2350 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2352 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2353 return self->changeMeshNames(modifTab);
2356 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2358 if(elt0 && PyInt_Check(elt0))
2360 return PyInt_AS_LONG(elt0);
2362 else if(elt0 && PyString_Check(elt0))
2363 return self->getPosFromFieldName(PyString_AsString(elt0));
2365 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2368 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2370 if(PyList_Check(elts))
2372 int sz=PyList_Size(elts);
2373 std::vector<int> ret(sz);
2374 for(int i=0;i<sz;i++)
2376 PyObject *elt=PyList_GetItem(elts,i);
2377 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2383 std::vector<int> ret(1);
2384 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2389 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2391 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2392 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2393 self->pushFields(tmp);
2396 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2398 if(elts && PySlice_Check(elts))
2400 Py_ssize_t strt=2,stp=2,step=2;
2401 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2402 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2403 self->destroyFieldsAtPos2(strt,stp,step);
2407 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2408 if(!idsToRemove.empty())
2409 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2415 class MEDFileParameter1TS : public RefCountObject
2418 void setIteration(int it);
2419 int getIteration() const;
2420 void setOrder(int order);
2421 int getOrder() const;
2422 void setTimeValue(double time);
2423 void setTime(int dt, int it, double time);
2424 double getTime(int& dt, int& it);
2425 double getTimeValue() const;
2428 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2431 void setValue(double val) throw(INTERP_KERNEL::Exception);
2432 double getValue() const throw(INTERP_KERNEL::Exception);
2433 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2436 std::string __str__() const throw(INTERP_KERNEL::Exception)
2438 return self->simpleRepr();
2443 class MEDFileParameterTinyInfo : public MEDFileWritable
2446 void setDescription(const std::string& name);
2447 std::string getDescription() const;
2448 void setTimeUnit(const std::string& unit);
2449 std::string getTimeUnit() const;
2452 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2455 static MEDFileParameterDouble1TS *New();
2456 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2457 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2458 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2459 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2460 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2461 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2462 std::string getName() const throw(INTERP_KERNEL::Exception);
2463 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2466 MEDFileParameterDouble1TS()
2468 return MEDFileParameterDouble1TS::New();
2471 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2473 return MEDFileParameterDouble1TS::New(fileName);
2476 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2478 return MEDFileParameterDouble1TS::New(fileName,paramName);
2481 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2483 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2486 std::string __str__() const throw(INTERP_KERNEL::Exception)
2488 return self->simpleRepr();
2491 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2494 bool ret0=self->isEqual(other,eps,what);
2495 PyObject *res=PyList_New(2);
2496 PyObject *ret0Py=ret0?Py_True:Py_False;
2498 PyList_SetItem(res,0,ret0Py);
2499 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2505 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2508 static MEDFileParameterMultiTS *New();
2509 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2510 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2511 std::string getName() const;
2512 void setName(const std::string& name);
2513 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2514 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2515 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2516 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2517 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2518 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2519 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2520 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2523 MEDFileParameterMultiTS()
2525 return MEDFileParameterMultiTS::New();
2528 MEDFileParameterMultiTS(const std::string& fileName)
2530 return MEDFileParameterMultiTS::New(fileName);
2533 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2535 return MEDFileParameterMultiTS::New(fileName,paramName);
2538 std::string __str__() const throw(INTERP_KERNEL::Exception)
2540 return self->simpleRepr();
2543 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2546 bool ret0=self->isEqual(other,eps,what);
2547 PyObject *res=PyList_New(2);
2548 PyObject *ret0Py=ret0?Py_True:Py_False;
2550 PyList_SetItem(res,0,ret0Py);
2551 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2555 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2559 std::vector<int> pos2;
2560 DataArrayInt *pos3=0;
2561 DataArrayIntTuple *pos4=0;
2562 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2567 self->eraseTimeStepIds(&pos1,&pos1+1);
2574 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2579 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2583 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2587 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2589 if(elt0 && PyInt_Check(elt0))
2591 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2594 else if(elt0 && PyTuple_Check(elt0))
2596 if(PyTuple_Size(elt0)==2)
2598 PyObject *o0=PyTuple_GetItem(elt0,0);
2599 PyObject *o1=PyTuple_GetItem(elt0,1);
2600 if(PyInt_Check(o0) && PyInt_Check(o1))
2602 int iter=PyInt_AS_LONG(o0);
2603 int order=PyInt_AS_LONG(o1);
2604 return self->getPosOfTimeStep(iter,order);
2607 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 !");
2610 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 !");
2612 else if(elt0 && PyFloat_Check(elt0))
2614 double val=PyFloat_AS_DOUBLE(elt0);
2615 return self->getPosGivenTime(val);
2618 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2621 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2623 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2629 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2631 if(PyList_Check(elts))
2633 int sz=PyList_Size(elts);
2634 std::vector<int> ret(sz);
2635 for(int i=0;i<sz;i++)
2637 PyObject *elt=PyList_GetItem(elts,i);
2638 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2644 std::vector<int> ret(1);
2645 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2650 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2652 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2653 if(!idsToRemove.empty())
2654 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2657 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2659 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2665 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2667 std::vector< std::pair<int,int> > res=self->getIterations();
2668 PyObject *ret=PyList_New(res.size());
2670 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2672 PyObject *elt=PyTuple_New(2);
2673 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2674 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2675 PyList_SetItem(ret,rk,elt);
2680 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2682 std::vector<double> res2;
2683 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2684 PyObject *ret=PyList_New(res.size());
2686 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2688 PyObject *elt=PyTuple_New(3);
2689 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2690 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2691 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2692 PyList_SetItem(ret,rk,elt);
2699 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2702 static MEDFileParameters *New();
2703 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2704 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2705 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2706 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2707 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2708 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2709 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2710 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2711 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2712 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2713 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2718 return MEDFileParameters::New();
2721 MEDFileParameters(const std::string& fileName)
2723 return MEDFileParameters::New(fileName);
2726 std::string __str__() const throw(INTERP_KERNEL::Exception)
2728 return self->simpleRepr();
2731 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2733 if(PyInt_Check(obj))
2735 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2740 else if(PyString_Check(obj))
2742 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2748 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2751 int __len__() const throw(INTERP_KERNEL::Exception)
2753 return self->getNumberOfParams();
2756 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2758 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2764 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2766 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2772 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2775 bool ret0=self->isEqual(other,eps,what);
2776 PyObject *res=PyList_New(2);
2777 PyObject *ret0Py=ret0?Py_True:Py_False;
2779 PyList_SetItem(res,0,ret0Py);
2780 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2786 class MEDFileData : public RefCountObject, public MEDFileWritable
2789 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2790 static MEDFileData *New();
2791 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2792 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2793 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2794 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2795 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2796 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2797 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2799 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2800 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2802 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2805 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2807 return MEDFileData::New(fileName);
2812 return MEDFileData::New();
2815 std::string __str__() const throw(INTERP_KERNEL::Exception)
2817 return self->simpleRepr();
2820 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2822 MEDFileMeshes *ret=self->getMeshes();
2828 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2830 MEDFileParameters *ret=self->getParams();
2836 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2838 MEDFileFields *ret=self->getFields();
2844 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2846 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2847 return self->changeMeshNames(modifTab);
2852 class SauvReader : public RefCountObject
2855 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2856 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2859 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2861 return SauvReader::New(fileName);
2866 class SauvWriter : public RefCountObject
2869 static SauvWriter * New();
2870 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2871 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2872 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2873 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2876 SauvWriter() throw(INTERP_KERNEL::Exception)
2878 return SauvWriter::New();
2885 class MEDFileMeshStruct;
2887 class MEDFileField1TSStructItem
2890 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2893 class MEDFileMeshStruct : public RefCountObject
2896 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2898 ~MEDFileMeshStruct();
2901 class MEDMeshMultiLev : public RefCountObject
2904 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2905 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2911 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2913 DataArrayInt *famIds(0);
2914 bool isWithoutCopy(false);
2915 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2916 PyObject *ret=PyTuple_New(2);
2917 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2919 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2920 PyTuple_SetItem(ret,1,ret1Py);
2924 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2926 DataArrayInt *numIds(0);
2927 bool isWithoutCopy(false);
2928 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2929 PyObject *ret=PyTuple_New(2);
2930 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2932 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2933 PyTuple_SetItem(ret,1,ret1Py);
2937 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2939 DataArrayInt *famIds(0);
2940 bool isWithoutCopy(false);
2941 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
2942 PyObject *ret=PyTuple_New(2);
2943 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2945 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2946 PyTuple_SetItem(ret,1,ret1Py);
2950 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2952 DataArrayInt *numIds(0);
2953 bool isWithoutCopy(false);
2954 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
2955 PyObject *ret=PyTuple_New(2);
2956 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2958 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2959 PyTuple_SetItem(ret,1,ret1Py);
2963 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
2965 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
2966 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
2967 PyObject *res(PyList_New(result.size()));
2968 for(int i=0;iL!=result.end(); i++, iL++)
2969 PyList_SetItem(res,i,PyInt_FromLong(*iL));
2975 class MEDUMeshMultiLev : public MEDMeshMultiLev
2978 ~MEDUMeshMultiLev();
2982 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2984 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2985 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
2986 PyObject *ret0Py=ncc?Py_True:Py_False;
2988 PyObject *ret=PyTuple_New(7);
2989 PyTuple_SetItem(ret,0,ret0Py);
2990 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2991 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2992 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2993 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2994 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2995 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3001 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3004 ~MEDStructuredMeshMultiLev();
3007 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3010 ~MEDCMeshMultiLev();
3014 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3017 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3018 std::size_t sz(objs.size());
3019 PyObject *ret(PyTuple_New(2));
3020 PyObject *ret0=PyList_New(sz);
3021 for(std::size_t i=0;i<sz;i++)
3022 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3023 PyTuple_SetItem(ret,0,ret0);
3024 PyObject *ret1Py(isInternal?Py_True:Py_False);
3026 PyTuple_SetItem(ret,1,ret1Py);
3032 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3035 ~MEDCurveLinearMeshMultiLev();
3039 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3041 DataArrayDouble *ret0(0);
3042 std::vector<int> ret1;
3044 self->buildVTUArrays(ret0,ret1,ret2);
3045 std::size_t sz(ret1.size());
3046 PyObject *ret=PyTuple_New(3);
3047 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3048 PyObject *ret1Py=PyList_New(sz);
3049 for(std::size_t i=0;i<sz;i++)
3050 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3051 PyTuple_SetItem(ret,1,ret1Py);
3052 PyObject *ret2Py(ret2?Py_True:Py_False);
3054 PyTuple_SetItem(ret,2,ret2Py);
3060 class MEDFileFastCellSupportComparator : public RefCountObject
3063 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3064 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3065 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3066 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3068 ~MEDFileFastCellSupportComparator();
3072 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3074 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3075 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3076 PyObject *res(PyList_New(result.size()));
3077 for(int i=0;iL!=result.end(); i++, iL++)
3078 PyList_SetItem(res,i,PyInt_FromLong(*iL));