1 // Copyright (C) 2007-2013 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.
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::ReadField;
76 %newobject MEDLoader::ReadFieldCell;
77 %newobject MEDLoader::ReadFieldNode;
78 %newobject MEDLoader::ReadFieldGauss;
79 %newobject MEDLoader::ReadFieldGaussNE;
80 %newobject ParaMEDMEM::MEDFileMesh::New;
81 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
82 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
83 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
85 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
94 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
95 %newobject ParaMEDMEM::MEDFileUMesh::New;
96 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
97 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
98 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
99 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
100 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
101 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
102 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
103 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
104 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
105 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
106 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
108 %newobject ParaMEDMEM::MEDFileCMesh::New;
109 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
110 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
111 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
112 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
113 %newobject ParaMEDMEM::MEDFileMeshes::New;
114 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
115 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
116 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
117 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
118 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
120 %newobject ParaMEDMEM::MEDFileFields::New;
121 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
122 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
123 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
124 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
125 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
126 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
127 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
128 %newobject ParaMEDMEM::MEDFileFields::__iter__;
130 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
131 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
132 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
133 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
134 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
135 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
136 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
137 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
138 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
139 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
140 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
141 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
142 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
143 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
144 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
145 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
146 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
148 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
149 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
150 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
151 %newobject ParaMEDMEM::MEDFileField1TS::New;
152 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
153 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
154 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
155 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
156 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
157 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
158 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
159 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
160 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
162 %newobject ParaMEDMEM::MEDFileData::New;
163 %newobject ParaMEDMEM::MEDFileData::deepCpy;
164 %newobject ParaMEDMEM::MEDFileData::getMeshes;
165 %newobject ParaMEDMEM::MEDFileData::getFields;
166 %newobject ParaMEDMEM::MEDFileData::getParams;
168 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
169 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
170 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
171 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
172 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
173 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
174 %newobject ParaMEDMEM::MEDFileParameters::New;
175 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
176 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
177 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
178 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
180 %newobject ParaMEDMEM::SauvWriter::New;
181 %newobject ParaMEDMEM::SauvReader::New;
182 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
184 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
185 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
186 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
187 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
188 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
190 %feature("unref") MEDFileMesh "$this->decrRef();"
191 %feature("unref") MEDFileUMesh "$this->decrRef();"
192 %feature("unref") MEDFileCMesh "$this->decrRef();"
193 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
194 %feature("unref") MEDFileMeshes "$this->decrRef();"
195 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
196 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
197 %feature("unref") MEDFileField1TS "$this->decrRef();"
198 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
199 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
200 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
201 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
202 %feature("unref") MEDFileFields "$this->decrRef();"
203 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
204 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
205 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
206 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
207 %feature("unref") MEDFileParameters "$this->decrRef();"
208 %feature("unref") MEDFileData "$this->decrRef();"
209 %feature("unref") SauvReader "$this->decrRef();"
210 %feature("unref") SauvWriter "$this->decrRef();"
211 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
212 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
213 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
214 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
215 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
216 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
221 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
222 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
223 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
224 static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
225 static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
226 static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
227 static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
228 static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
229 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
230 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
231 static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
236 static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
239 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
241 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
242 PyObject *ret=PyList_New(res.size());
244 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
246 PyObject *elt=PyTuple_New(2);
247 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
248 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
249 PyList_SetItem(ret,rk,elt);
254 static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
256 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
257 PyObject *ret=PyList_New(res.size());
259 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
261 PyObject *elt=PyTuple_New(3);
262 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
263 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
264 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
265 PyList_SetItem(ret,rk,elt);
270 static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
272 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
273 PyObject *ret=PyList_New(res.size());
275 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
277 PyObject *elt=PyTuple_New(2);
278 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
279 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
280 PyList_SetItem(ret,rk,elt);
284 static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
286 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
287 PyObject *ret=PyList_New(res.size());
289 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
291 PyObject *elt=PyTuple_New(2);
292 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
293 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
294 PyList_SetItem(ret,rk,elt);
298 static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
300 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
301 PyObject *ret=PyList_New(res.size());
303 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
305 PyObject *elt=PyTuple_New(2);
306 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
307 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
308 PyList_SetItem(ret,rk,elt);
312 static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
314 int meshDim,spaceDim,numberOfNodes;
315 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
316 PyObject *ret=PyTuple_New(4);
317 PyObject *elt0=PyList_New(res.size());
319 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
321 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
323 PyObject *elt1=PyList_New(obj2.size());
324 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
326 PyObject *elt2=PyTuple_New(2);
327 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
328 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
329 PyList_SetItem(elt1,j,elt2);
331 PyList_SetItem(elt0,i,elt1);
333 PyTuple_SetItem(ret,0,elt0);
334 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
335 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
336 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
339 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
340 const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
342 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
343 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
344 return convertFieldDoubleVecToPy(res);
346 static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
348 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
349 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
350 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
352 static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
354 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
355 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
356 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
358 static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
360 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
361 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
362 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
364 static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
366 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
368 PyObject *ret=PyList_New(size);
369 for(int i=0;i<size;i++)
370 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
373 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
375 std::vector<std::string> grps;
376 converPyListToVecString(li,grps);
377 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
379 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
381 std::vector<std::string> fams;
382 converPyListToVecString(li,fams);
383 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
386 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
387 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
388 static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
389 static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
390 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
391 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
392 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
393 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
394 static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
395 static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
396 static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
397 static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
398 static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
403 class MEDFileWritable
406 void copyOptionsFrom(const MEDFileWritable& other) const;
407 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
408 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
409 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
410 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
413 class MEDFileMeshReadSelector
416 MEDFileMeshReadSelector();
417 MEDFileMeshReadSelector(unsigned int code);
418 unsigned int getCode() const;
419 void setCode(unsigned int newCode);
420 bool isCellFamilyFieldReading() const;
421 bool isNodeFamilyFieldReading() const;
422 bool isCellNameFieldReading() const;
423 bool isNodeNameFieldReading() const;
424 bool isCellNumFieldReading() const;
425 bool isNodeNumFieldReading() const;
426 void setCellFamilyFieldReading(bool b);
427 void setNodeFamilyFieldReading(bool b);
428 void setCellNameFieldReading(bool b);
429 void setNodeNameFieldReading(bool b);
430 void setCellNumFieldReading(bool b);
431 void setNodeNumFieldReading(bool b);
434 std::string __str__() const throw(INTERP_KERNEL::Exception)
436 std::ostringstream oss;
441 std::string __repr__() const throw(INTERP_KERNEL::Exception)
443 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
449 class MEDFileMesh : public RefCountObject, public MEDFileWritable
452 static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
453 static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
454 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
455 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
456 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
457 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
458 void setName(const char *name);
459 std::string getName();
460 const char *getUnivName() const;
461 bool getUnivNameWrStatus() const;
462 void setUnivNameWrStatus(bool newStatus);
463 void setDescription(const char *name);
464 std::string getDescription() const;
465 void setOrder(int order);
466 int getOrder() const;
467 void setIteration(int it);
469 void setTimeValue(double time);
470 void setTime(int dt, int it, double time);
471 double getTimeValue() const;
472 void setTimeUnit(const char *unit);
473 const char *getTimeUnit() const;
474 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
475 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
476 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
477 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
478 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
479 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
480 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
481 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
482 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
484 bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
485 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
486 bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
487 void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
488 void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
489 void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
490 void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
491 virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
492 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
493 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
494 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
495 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
496 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
497 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
498 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
499 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
500 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
501 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
502 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
503 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
504 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
505 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
506 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
507 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
508 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
509 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
510 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
511 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
512 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
513 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
514 void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
515 void setFamilyInfo(const std::map<std::string,int>& info);
516 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
517 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
518 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
519 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
520 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
521 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
522 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
523 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
524 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
525 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
526 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
527 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
528 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
529 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
530 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
531 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
532 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
533 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
534 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
535 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
536 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
538 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
539 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
540 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
541 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
542 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
543 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
544 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
545 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
546 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
547 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
548 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
549 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
552 std::string __str__() const throw(INTERP_KERNEL::Exception)
554 return self->simpleRepr();
557 PyObject *getTime() throw(INTERP_KERNEL::Exception)
560 double tmp0=self->getTime(tmp1,tmp2);
561 PyObject *res = PyList_New(3);
562 PyList_SetItem(res,0,SWIG_From_int(tmp1));
563 PyList_SetItem(res,1,SWIG_From_int(tmp2));
564 PyList_SetItem(res,2,SWIG_From_double(tmp0));
568 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
571 bool ret0=self->isEqual(other,eps,what);
572 PyObject *res=PyList_New(2);
573 PyObject *ret0Py=ret0?Py_True:Py_False;
575 PyList_SetItem(res,0,ret0Py);
576 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
580 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
583 bool ret0=self->areFamsEqual(other,what);
584 PyObject *res=PyList_New(2);
585 PyObject *ret0Py=ret0?Py_True:Py_False;
587 PyList_SetItem(res,0,ret0Py);
588 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
592 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
595 bool ret0=self->areGrpsEqual(other,what);
596 PyObject *res=PyList_New(2);
597 PyObject *ret0Py=ret0?Py_True:Py_False;
599 PyList_SetItem(res,0,ret0Py);
600 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
604 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
606 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
609 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
612 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
614 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
617 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
620 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
622 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
625 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
628 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
631 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
632 PyObject *ret=PyTuple_New(2);
633 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
634 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
638 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
640 DataArrayInt *ret3=0;
641 std::vector<int> ret1,ret2;
642 bool ret0=self->unPolyze(ret1,ret2,ret3);
643 PyObject *ret=PyTuple_New(4);
644 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
646 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
647 for(int j=0;j<(int)ret1.size()/3;j++)
649 PyObject *retLev2=PyList_New(3);
650 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
651 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
652 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
653 PyList_SetItem(retLev1_0,j,retLev2);
655 PyTuple_SetItem(ret,1,retLev1_0);
657 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
658 for(int j=0;j<(int)ret2.size()/3;j++)
660 PyObject *retLev2=PyList_New(3);
661 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
662 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
663 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
664 PyList_SetItem(retLev1_1,j,retLev2);
666 PyTuple_SetItem(ret,2,retLev1_1);
668 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
674 class MEDFileUMesh : public MEDFileMesh
677 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
678 static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
679 static MEDFileUMesh *New();
681 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
683 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
684 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
685 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
686 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
687 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
688 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
689 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
690 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
691 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
692 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
693 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
694 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
695 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
696 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
697 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
698 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
699 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
700 DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
701 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
702 DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
703 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
704 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
705 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
706 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
707 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
708 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
710 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
711 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
712 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
713 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
714 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
715 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
716 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
717 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
718 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
721 MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
723 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
726 MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
728 return MEDFileUMesh::New(fileName,mrs);
733 return MEDFileUMesh::New();
736 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
738 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
741 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
744 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
746 std::vector<const DataArrayInt *> grps;
747 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
748 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
751 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
753 std::vector<const MEDCouplingUMesh *> ms;
754 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
755 self->setMeshes(ms,renum);
758 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
760 std::vector<const MEDCouplingUMesh *> ms;
761 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
762 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
765 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
767 std::vector<const MEDCouplingUMesh *> ms;
768 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
769 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
772 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
774 DataArrayDouble *ret=self->getCoords();
780 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
782 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
783 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
784 PyObject *ret=PyTuple_New(3);
785 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
786 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
787 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
791 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
793 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
799 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
801 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
802 std::size_t sz(tmp.size());
803 PyObject *ret=PyList_New(sz);
804 for(std::size_t i=0;i<sz;i++)
808 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
815 class MEDFileStructuredMesh : public MEDFileMesh
819 class MEDFileCMesh : public MEDFileStructuredMesh
822 static MEDFileCMesh *New();
823 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
824 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
825 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
830 return MEDFileCMesh::New();
833 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
835 return MEDFileCMesh::New(fileName,mrs);
838 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
840 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
843 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
845 const MEDCouplingCMesh *tmp=self->getMesh();
848 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
853 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
856 static MEDFileCurveLinearMesh *New();
857 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
858 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
859 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
862 MEDFileCurveLinearMesh()
864 return MEDFileCurveLinearMesh::New();
867 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
869 return MEDFileCurveLinearMesh::New(fileName,mrs);
872 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
874 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
877 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
879 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
882 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
887 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
890 static MEDFileMeshMultiTS *New();
891 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
892 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
893 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
894 std::string getName() const throw(INTERP_KERNEL::Exception);
895 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
896 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
901 return MEDFileMeshMultiTS::New();
904 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
906 return MEDFileMeshMultiTS::New(fileName);
909 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
911 return MEDFileMeshMultiTS::New(fileName,mName);
914 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
916 MEDFileMesh *ret=self->getOneTimeStep();
924 class MEDFileMeshesIterator
929 PyObject *next() throw(INTERP_KERNEL::Exception)
931 MEDFileMesh *ret=self->nextt();
935 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
939 PyErr_SetString(PyExc_StopIteration,"No more data.");
946 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
949 static MEDFileMeshes *New();
950 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
951 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
952 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
953 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
954 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
956 void resize(int newSize) throw(INTERP_KERNEL::Exception);
957 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
958 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
959 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
964 return MEDFileMeshes::New();
967 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
969 return MEDFileMeshes::New(fileName);
972 std::string __str__() const throw(INTERP_KERNEL::Exception)
974 return self->simpleRepr();
977 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
981 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
986 else if(PyString_Check(obj))
988 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
994 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
997 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
999 self->setMeshAtPos(obj,mesh);
1003 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1005 return self->iterator();
1008 int __len__() const throw(INTERP_KERNEL::Exception)
1010 return self->getNumberOfMeshes();
1013 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1015 MEDFileMesh *ret=self->getMeshAtPos(i);
1020 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1022 MEDFileMesh *ret=self->getMeshWithName(mname);
1030 class MEDFileFieldLoc : public RefCountObject
1033 std::string getName() const;
1034 int getDimension() const;
1035 int getNumberOfGaussPoints() const;
1036 int getNumberOfPointsInCells() const;
1037 const std::vector<double>& getRefCoords() const;
1038 const std::vector<double>& getGaussCoords() const;
1039 const std::vector<double>& getGaussWeights() const;
1040 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1043 std::string __str__() const throw(INTERP_KERNEL::Exception)
1045 return self->repr();
1050 class MEDFileFieldGlobsReal
1053 void resetContent();
1054 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1055 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1056 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1057 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1058 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1059 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1060 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1061 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1062 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1063 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1064 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1065 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1066 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1067 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1068 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1069 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1070 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1071 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1072 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1073 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1074 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1075 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1076 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1077 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1078 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1079 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1082 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1084 const DataArrayInt *ret=self->getProfile(pflName);
1087 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1090 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1092 const DataArrayInt *ret=self->getProfileFromId(pflId);
1095 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1098 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1100 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1103 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1106 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1108 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1111 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1114 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1116 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1117 return convertVecPairVecStToPy(ret);
1120 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1122 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1123 return convertVecPairVecStToPy(ret);
1126 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1128 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1129 self->changePflsNames(v);
1132 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1134 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1135 self->changePflsRefsNamesGen(v);
1138 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1140 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1141 self->changePflsNamesInStruct(v);
1144 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1146 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1147 self->changeLocsNames(v);
1150 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1152 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1153 self->changeLocsRefsNamesGen(v);
1156 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1158 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1159 self->changeLocsNamesInStruct(v);
1162 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1164 std::ostringstream oss;
1165 self->simpleReprGlobs(oss);
1171 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1174 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1175 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1176 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1177 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1178 void loadArrays() throw(INTERP_KERNEL::Exception);
1179 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1180 void unloadArrays() throw(INTERP_KERNEL::Exception);
1181 int getDimension() const throw(INTERP_KERNEL::Exception);
1182 int getIteration() const throw(INTERP_KERNEL::Exception);
1183 int getOrder() const throw(INTERP_KERNEL::Exception);
1184 std::string getName() throw(INTERP_KERNEL::Exception);
1185 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1186 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1187 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1188 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1189 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1190 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1191 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1192 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1193 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1194 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1195 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1196 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1197 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1198 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1201 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1204 double tmp0=self->getTime(tmp1,tmp2);
1205 PyObject *res = PyList_New(3);
1206 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1207 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1208 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1212 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1214 std::pair<int,int> res=self->getDtIt();
1215 PyObject *elt=PyTuple_New(2);
1216 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1217 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1221 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1223 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1226 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1228 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1231 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1233 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1234 return self->changeMeshNames(modifTab);
1237 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1239 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1240 PyObject *ret2=PyList_New(ret.size());
1241 for(int i=0;i<(int)ret.size();i++)
1242 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1246 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1248 std::vector<int> ret1;
1249 int ret0=self->getNonEmptyLevels(mname,ret1);
1250 PyObject *elt=PyTuple_New(2);
1251 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1252 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1256 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1258 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1259 std::vector< std::vector<TypeOfField> > typesF;
1260 std::vector< std::vector<std::string> > pfls;
1261 std::vector< std::vector<std::string> > locs;
1262 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1264 PyObject *ret2=PyList_New(sz);
1265 for(int i=0;i<sz;i++)
1267 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1268 const std::vector<TypeOfField>& typesFI=typesF[i];
1269 const std::vector<std::string>& pflsI=pfls[i];
1270 const std::vector<std::string>& locsI=locs[i];
1271 PyObject *elt=PyTuple_New(2);
1272 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1273 int sz2=ret[i].size();
1274 PyObject *elt2=PyList_New(sz2);
1275 for(int j=0;j<sz2;j++)
1277 PyObject *elt3=PyTuple_New(4);
1278 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1279 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));
1280 PyTuple_SetItem(elt3,1,elt4);
1281 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1282 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1283 PyList_SetItem(elt2,j,elt3);
1285 PyTuple_SetItem(elt,1,elt2);
1286 PyList_SetItem(ret2,i,elt);
1291 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1293 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1294 std::size_t sz=ret.size();
1295 PyObject *retPy=PyList_New(sz);
1296 for(std::size_t i=0;i<sz;i++)
1297 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1301 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1303 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1304 std::size_t sz=ret.size();
1305 PyObject *retPy=PyList_New(sz);
1306 for(std::size_t i=0;i<sz;i++)
1307 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1313 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1316 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1317 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1318 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1319 static MEDFileField1TS *New();
1320 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1321 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1322 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1323 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1324 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1325 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1327 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1328 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1329 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1330 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1333 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1335 return MEDFileField1TS::New(fileName,loadAll);
1338 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1340 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1343 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1345 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1350 return MEDFileField1TS::New();
1353 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1355 const DataArrayDouble *arr=0;
1357 arr=field->getArray();
1358 self->copyTinyInfoFrom(field,arr);
1361 std::string __str__() const throw(INTERP_KERNEL::Exception)
1363 return self->simpleRepr();
1366 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1368 DataArrayInt *ret1=0;
1369 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1370 PyObject *ret=PyTuple_New(2);
1371 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1372 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1376 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1378 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1379 std::vector< std::vector<TypeOfField> > typesF;
1380 std::vector< std::vector<std::string> > pfls;
1381 std::vector< std::vector<std::string> > locs;
1382 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1384 PyObject *ret2=PyList_New(sz);
1385 for(int i=0;i<sz;i++)
1387 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1388 const std::vector<TypeOfField>& typesFI=typesF[i];
1389 const std::vector<std::string>& pflsI=pfls[i];
1390 const std::vector<std::string>& locsI=locs[i];
1391 PyObject *elt=PyTuple_New(2);
1392 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1393 int sz2=ret[i].size();
1394 PyObject *elt2=PyList_New(sz2);
1395 for(int j=0;j<sz2;j++)
1397 PyObject *elt3=PyTuple_New(4);
1398 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1399 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1400 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1401 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1402 PyList_SetItem(elt2,j,elt3);
1404 PyTuple_SetItem(elt,1,elt2);
1405 PyList_SetItem(ret2,i,elt);
1410 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1412 DataArrayDouble *ret=self->getUndergroundDataArray();
1418 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1420 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1421 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1424 PyObject *ret=PyTuple_New(2);
1425 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1426 std::size_t sz=elt1Cpp.size();
1427 PyObject *elt=PyList_New(sz);
1428 for(std::size_t i=0;i<sz;i++)
1430 PyObject *elt1=PyTuple_New(2);
1431 PyObject *elt2=PyTuple_New(2);
1432 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1433 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1434 PyObject *elt3=PyTuple_New(2);
1435 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1436 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1437 PyTuple_SetItem(elt1,0,elt2);
1438 PyTuple_SetItem(elt1,1,elt3);
1439 PyList_SetItem(elt,i,elt1);
1441 PyTuple_SetItem(ret,1,elt);
1447 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1450 static MEDFileIntField1TS *New();
1451 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1452 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1453 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1454 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1456 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1457 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1460 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1462 return MEDFileIntField1TS::New();
1465 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1467 return MEDFileIntField1TS::New(fileName,loadAll);
1470 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1472 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1475 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1477 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1480 std::string __str__() const throw(INTERP_KERNEL::Exception)
1482 return self->simpleRepr();
1485 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1487 DataArrayInt *ret1=0;
1488 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1489 PyObject *ret=PyTuple_New(2);
1490 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1491 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1495 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1497 DataArrayInt *ret1=0;
1498 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1499 PyObject *ret=PyTuple_New(2);
1500 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1501 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1505 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1507 DataArrayInt *ret1=0;
1508 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1509 PyObject *ret=PyTuple_New(2);
1510 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1511 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1515 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1517 DataArrayInt *ret1=0;
1518 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1519 PyObject *ret=PyTuple_New(2);
1520 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1521 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1525 PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1527 DataArrayInt *ret1=0;
1528 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1529 PyObject *ret=PyTuple_New(2);
1530 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1531 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1535 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1537 DataArrayInt *ret1=0;
1538 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1539 PyObject *ret=PyTuple_New(2);
1540 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1541 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1545 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1547 DataArrayInt *ret=self->getUndergroundDataArray();
1555 class MEDFileAnyTypeFieldMultiTSIterator
1560 PyObject *next() throw(INTERP_KERNEL::Exception)
1562 MEDFileAnyTypeField1TS *ret=self->nextt();
1564 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1567 PyErr_SetString(PyExc_StopIteration,"No more data.");
1574 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1577 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1578 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1579 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1580 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1581 std::string getName() const throw(INTERP_KERNEL::Exception);
1582 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1583 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1584 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1585 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1586 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1587 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1588 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1589 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1590 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1591 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1592 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1593 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1594 void loadArrays() throw(INTERP_KERNEL::Exception);
1595 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1596 void unloadArrays() throw(INTERP_KERNEL::Exception);
1598 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1599 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1600 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1601 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1602 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1605 int __len__() const throw(INTERP_KERNEL::Exception)
1607 return self->getNumberOfTS();
1610 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1612 if(elt0 && PyInt_Check(elt0))
1614 int pos=PyInt_AS_LONG(elt0);
1617 else if(elt0 && PyTuple_Check(elt0))
1619 if(PyTuple_Size(elt0)==2)
1621 PyObject *o0=PyTuple_GetItem(elt0,0);
1622 PyObject *o1=PyTuple_GetItem(elt0,1);
1623 if(PyInt_Check(o0) && PyInt_Check(o1))
1625 int iter=PyInt_AS_LONG(o0);
1626 int order=PyInt_AS_LONG(o1);
1627 return self->getPosOfTimeStep(iter,order);
1630 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 !");
1633 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 !");
1635 else if(elt0 && PyFloat_Check(elt0))
1637 double val=PyFloat_AS_DOUBLE(elt0);
1638 return self->getPosGivenTime(val);
1641 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1644 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1646 std::vector< std::pair<int,int> > res=self->getIterations();
1647 PyObject *ret=PyList_New(res.size());
1649 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1651 PyObject *elt=PyTuple_New(2);
1652 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1653 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1654 PyList_SetItem(ret,rk,elt);
1659 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1661 std::vector<double> ret1;
1662 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1663 std::size_t sz=ret.size();
1664 PyObject *ret2=PyList_New(sz);
1665 for(std::size_t i=0;i<sz;i++)
1667 PyObject *elt=PyTuple_New(3);
1668 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1669 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1670 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1671 PyList_SetItem(ret2,i,elt);
1676 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1678 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1679 PyObject *ret2=PyList_New(ret.size());
1680 for(int i=0;i<(int)ret.size();i++)
1682 const std::vector<TypeOfField>& rett=ret[i];
1683 PyObject *ret3=PyList_New(rett.size());
1684 for(int j=0;j<(int)rett.size();j++)
1685 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1686 PyList_SetItem(ret2,i,ret3);
1691 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1693 std::vector<int> ret1;
1694 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1695 PyObject *elt=PyTuple_New(2);
1696 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1697 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1701 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1703 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1704 std::vector< std::vector<TypeOfField> > typesF;
1705 std::vector< std::vector<std::string> > pfls;
1706 std::vector< std::vector<std::string> > locs;
1707 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1709 PyObject *ret2=PyList_New(sz);
1710 for(int i=0;i<sz;i++)
1712 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1713 const std::vector<TypeOfField>& typesFI=typesF[i];
1714 const std::vector<std::string>& pflsI=pfls[i];
1715 const std::vector<std::string>& locsI=locs[i];
1716 PyObject *elt=PyTuple_New(2);
1717 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1718 int sz2=ret[i].size();
1719 PyObject *elt2=PyList_New(sz2);
1720 for(int j=0;j<sz2;j++)
1722 PyObject *elt3=PyTuple_New(4);
1723 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1724 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));
1725 PyTuple_SetItem(elt3,1,elt4);
1726 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1727 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1728 PyList_SetItem(elt2,j,elt3);
1730 PyTuple_SetItem(elt,1,elt2);
1731 PyList_SetItem(ret2,i,elt);
1736 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1738 if(PyList_Check(elts))
1740 int sz=PyList_Size(elts);
1741 std::vector<int> ret(sz);
1742 for(int i=0;i<sz;i++)
1744 PyObject *elt=PyList_GetItem(elts,i);
1745 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1751 std::vector<int> ret(1);
1752 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1757 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1759 if(PySlice_Check(elts))
1761 Py_ssize_t strt=2,stp=2,step=2;
1762 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1763 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1765 self->eraseTimeStepIds2(strt,stp,step);
1768 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1772 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1773 if(!idsToRemove.empty())
1774 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1778 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1782 std::vector<int> pos2;
1783 DataArrayInt *pos3=0;
1784 DataArrayIntTuple *pos4=0;
1785 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1790 self->eraseTimeStepIds(&pos1,&pos1+1);
1797 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1802 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1806 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1810 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1812 return self->iterator();
1815 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1817 if(elt0 && PyList_Check(elt0))
1819 int sz=PyList_Size(elt0);
1820 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1821 int *pt=da->getPointer();
1822 for(int i=0;i<sz;i++,pt++)
1824 PyObject *elt1=PyList_GetItem(elt0,i);
1825 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1827 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1829 else if(elt0 && PySlice_Check(elt0))
1831 Py_ssize_t strt=2,stp=2,step=2;
1832 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1833 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1834 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1836 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1839 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1842 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1844 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1845 return self->changeMeshNames(modifTab);
1848 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1850 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1851 std::size_t sz=ret.size();
1852 PyObject *retPy=PyList_New(sz);
1853 for(std::size_t i=0;i<sz;i++)
1854 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1858 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1860 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1861 std::size_t sz=ret.size();
1862 PyObject *retPy=PyList_New(sz);
1863 for(std::size_t i=0;i<sz;i++)
1864 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1868 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1870 std::vector<MEDFileAnyTypeField1TS *> tmp;
1871 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1872 self->pushBackTimeSteps(tmp);
1875 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1877 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1878 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1879 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1880 std::size_t sz=ret.size();
1881 PyObject *retPy=PyList_New(sz);
1882 for(std::size_t i=0;i<sz;i++)
1884 std::size_t sz2=ret[i].size();
1885 PyObject *ret1Py=PyList_New(sz2);
1886 for(std::size_t j=0;j<sz2;j++)
1888 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1891 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1893 PyList_SetItem(retPy,i,ret1Py);
1898 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1900 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1901 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1902 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1903 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1904 if(ret2.size()!=ret.size())
1906 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1907 throw INTERP_KERNEL::Exception(oss.str().c_str());
1909 std::size_t sz=ret.size();
1910 PyObject *retPy=PyList_New(sz);
1911 for(std::size_t i=0;i<sz;i++)
1913 std::size_t sz2=ret[i].size();
1914 PyObject *ret0Py=PyTuple_New(2);
1915 PyObject *ret1Py=PyList_New(sz2);
1916 for(std::size_t j=0;j<sz2;j++)
1918 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1921 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1923 PyTuple_SetItem(ret0Py,0,ret1Py);
1924 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1925 PyList_SetItem(retPy,i,ret0Py);
1932 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1935 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1936 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1937 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1939 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1940 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1941 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1942 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1943 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1945 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1946 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1947 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1950 MEDFileFieldMultiTS()
1952 return MEDFileFieldMultiTS::New();
1955 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1957 return MEDFileFieldMultiTS::New(fileName,loadAll);
1960 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1962 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
1965 std::string __str__() const throw(INTERP_KERNEL::Exception)
1967 return self->simpleRepr();
1970 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1972 DataArrayInt *ret1=0;
1973 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1974 PyObject *ret=PyTuple_New(2);
1975 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1976 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1980 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1982 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1983 std::vector< std::vector<TypeOfField> > typesF;
1984 std::vector< std::vector<std::string> > pfls;
1985 std::vector< std::vector<std::string> > locs;
1986 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1988 PyObject *ret2=PyList_New(sz);
1989 for(int i=0;i<sz;i++)
1991 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1992 const std::vector<TypeOfField>& typesFI=typesF[i];
1993 const std::vector<std::string>& pflsI=pfls[i];
1994 const std::vector<std::string>& locsI=locs[i];
1995 PyObject *elt=PyTuple_New(2);
1996 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1997 int sz2=ret[i].size();
1998 PyObject *elt2=PyList_New(sz2);
1999 for(int j=0;j<sz2;j++)
2001 PyObject *elt3=PyTuple_New(4);
2002 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2003 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2004 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2005 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2006 PyList_SetItem(elt2,j,elt3);
2008 PyTuple_SetItem(elt,1,elt2);
2009 PyList_SetItem(ret2,i,elt);
2013 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2015 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2021 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2023 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2024 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2027 PyObject *ret=PyTuple_New(2);
2028 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2029 std::size_t sz=elt1Cpp.size();
2030 PyObject *elt=PyList_New(sz);
2031 for(std::size_t i=0;i<sz;i++)
2033 PyObject *elt1=PyTuple_New(2);
2034 PyObject *elt2=PyTuple_New(2);
2035 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2036 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2037 PyObject *elt3=PyTuple_New(2);
2038 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2039 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2040 PyTuple_SetItem(elt1,0,elt2);
2041 PyTuple_SetItem(elt1,1,elt3);
2042 PyList_SetItem(elt,i,elt1);
2044 PyTuple_SetItem(ret,1,elt);
2050 class MEDFileFieldsIterator
2055 PyObject *next() throw(INTERP_KERNEL::Exception)
2057 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2059 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2062 PyErr_SetString(PyExc_StopIteration,"No more data.");
2069 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2072 static MEDFileIntFieldMultiTS *New();
2073 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2074 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2076 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2077 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2078 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2081 MEDFileIntFieldMultiTS()
2083 return MEDFileIntFieldMultiTS::New();
2086 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2088 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2091 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2093 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2096 std::string __str__() const throw(INTERP_KERNEL::Exception)
2098 return self->simpleRepr();
2101 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2103 DataArrayInt *ret1=0;
2104 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2105 PyObject *ret=PyTuple_New(2);
2106 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2107 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2111 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2113 DataArrayInt *ret1=0;
2114 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2115 PyObject *ret=PyTuple_New(2);
2116 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2117 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2121 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2123 DataArrayInt *ret1=0;
2124 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2125 PyObject *ret=PyTuple_New(2);
2126 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2127 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2131 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2133 DataArrayInt *ret1=0;
2134 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2135 PyObject *ret=PyTuple_New(2);
2136 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2137 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2141 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2143 DataArrayInt *ret1=0;
2144 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2145 PyObject *ret=PyTuple_New(2);
2146 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2147 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2153 DataArrayInt *ret1=0;
2154 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2155 PyObject *ret=PyTuple_New(2);
2156 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2157 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2163 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2171 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2174 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2175 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2176 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2177 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2178 void loadArrays() throw(INTERP_KERNEL::Exception);
2179 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2180 void unloadArrays() throw(INTERP_KERNEL::Exception);
2181 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2182 int getNumberOfFields() const;
2183 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2184 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2186 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2187 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2188 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2189 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2190 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2191 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2192 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2193 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2198 return MEDFileFields::New();
2201 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2203 return MEDFileFields::New(fileName,loadAll);
2206 std::string __str__() const throw(INTERP_KERNEL::Exception)
2208 return self->simpleRepr();
2211 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2214 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2215 PyObject *ret=PyTuple_New(2);
2216 PyObject *ret_0=PyList_New(ret0.size());
2218 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2220 PyObject *elt=PyTuple_New(2);
2221 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2222 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2223 PyList_SetItem(ret_0,rk,elt);
2225 PyTuple_SetItem(ret,0,ret_0);
2226 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2227 PyTuple_SetItem(ret,1,ret_1);
2231 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2233 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2234 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2237 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2239 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2240 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2243 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2245 if(obj && PyList_Check(obj))
2247 int sz=PyList_Size(obj);
2248 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2249 int *pt=da->getPointer();
2250 for(int i=0;i<sz;i++,pt++)
2252 PyObject *elt1=PyList_GetItem(obj,i);
2253 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2255 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2258 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2261 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2263 self->setFieldAtPos(obj,field);
2267 int __len__() const throw(INTERP_KERNEL::Exception)
2269 return self->getNumberOfFields();
2272 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2274 return self->iterator();
2277 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2279 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2280 return self->changeMeshNames(modifTab);
2283 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2285 if(elt0 && PyInt_Check(elt0))
2287 return PyInt_AS_LONG(elt0);
2289 else if(elt0 && PyString_Check(elt0))
2290 return self->getPosFromFieldName(PyString_AsString(elt0));
2292 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2295 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2297 if(PyList_Check(elts))
2299 int sz=PyList_Size(elts);
2300 std::vector<int> ret(sz);
2301 for(int i=0;i<sz;i++)
2303 PyObject *elt=PyList_GetItem(elts,i);
2304 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2310 std::vector<int> ret(1);
2311 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2316 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2318 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2319 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2320 self->pushFields(tmp);
2323 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2325 if(elts && PySlice_Check(elts))
2327 Py_ssize_t strt=2,stp=2,step=2;
2328 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2329 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2330 self->destroyFieldsAtPos2(strt,stp,step);
2332 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2336 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2337 if(!idsToRemove.empty())
2338 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2344 class MEDFileParameter1TS : public RefCountObject
2347 void setIteration(int it);
2348 int getIteration() const;
2349 void setOrder(int order);
2350 int getOrder() const;
2351 void setTimeValue(double time);
2352 void setTime(int dt, int it, double time);
2353 double getTime(int& dt, int& it);
2354 double getTimeValue() const;
2357 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2360 void setValue(double val) throw(INTERP_KERNEL::Exception);
2361 double getValue() const throw(INTERP_KERNEL::Exception);
2362 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2365 std::string __str__() const throw(INTERP_KERNEL::Exception)
2367 return self->simpleRepr();
2372 class MEDFileParameterTinyInfo : public MEDFileWritable
2375 void setDescription(const char *name);
2376 std::string getDescription() const;
2377 void setTimeUnit(const char *unit);
2378 std::string getTimeUnit() const;
2381 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2384 static MEDFileParameterDouble1TS *New();
2385 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2386 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2387 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2388 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2389 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2390 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2391 std::string getName() const throw(INTERP_KERNEL::Exception);
2392 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2395 MEDFileParameterDouble1TS()
2397 return MEDFileParameterDouble1TS::New();
2400 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2402 return MEDFileParameterDouble1TS::New(fileName);
2405 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2407 return MEDFileParameterDouble1TS::New(fileName,paramName);
2410 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2412 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2415 std::string __str__() const throw(INTERP_KERNEL::Exception)
2417 return self->simpleRepr();
2420 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2423 bool ret0=self->isEqual(other,eps,what);
2424 PyObject *res=PyList_New(2);
2425 PyObject *ret0Py=ret0?Py_True:Py_False;
2427 PyList_SetItem(res,0,ret0Py);
2428 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2434 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2437 static MEDFileParameterMultiTS *New();
2438 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2439 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2440 std::string getName() const;
2441 void setName(const char *name);
2442 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2443 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2444 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2445 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2446 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2447 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2448 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2451 MEDFileParameterMultiTS()
2453 return MEDFileParameterMultiTS::New();
2456 MEDFileParameterMultiTS(const char *fileName)
2458 return MEDFileParameterMultiTS::New(fileName);
2461 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2463 return MEDFileParameterMultiTS::New(fileName,paramName);
2466 std::string __str__() const throw(INTERP_KERNEL::Exception)
2468 return self->simpleRepr();
2471 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2474 bool ret0=self->isEqual(other,eps,what);
2475 PyObject *res=PyList_New(2);
2476 PyObject *ret0Py=ret0?Py_True:Py_False;
2478 PyList_SetItem(res,0,ret0Py);
2479 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2483 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2487 std::vector<int> pos2;
2488 DataArrayInt *pos3=0;
2489 DataArrayIntTuple *pos4=0;
2490 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2495 self->eraseTimeStepIds(&pos1,&pos1+1);
2502 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2507 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2511 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2515 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2517 if(elt0 && PyInt_Check(elt0))
2519 int pos=PyInt_AS_LONG(elt0);
2522 else if(elt0 && PyTuple_Check(elt0))
2524 if(PyTuple_Size(elt0)==2)
2526 PyObject *o0=PyTuple_GetItem(elt0,0);
2527 PyObject *o1=PyTuple_GetItem(elt0,1);
2528 if(PyInt_Check(o0) && PyInt_Check(o1))
2530 int iter=PyInt_AS_LONG(o0);
2531 int order=PyInt_AS_LONG(o1);
2532 return self->getPosOfTimeStep(iter,order);
2535 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 !");
2538 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 !");
2540 else if(elt0 && PyFloat_Check(elt0))
2542 double val=PyFloat_AS_DOUBLE(elt0);
2543 return self->getPosGivenTime(val);
2546 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2549 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2551 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2557 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2559 if(PyList_Check(elts))
2561 int sz=PyList_Size(elts);
2562 std::vector<int> ret(sz);
2563 for(int i=0;i<sz;i++)
2565 PyObject *elt=PyList_GetItem(elts,i);
2566 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2572 std::vector<int> ret(1);
2573 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2578 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2580 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2581 if(!idsToRemove.empty())
2582 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2585 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2587 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2593 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2595 std::vector< std::pair<int,int> > res=self->getIterations();
2596 PyObject *ret=PyList_New(res.size());
2598 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2600 PyObject *elt=PyTuple_New(2);
2601 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2602 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2603 PyList_SetItem(ret,rk,elt);
2608 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2610 std::vector<double> res2;
2611 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2612 PyObject *ret=PyList_New(res.size());
2614 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2616 PyObject *elt=PyTuple_New(3);
2617 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2618 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2619 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2620 PyList_SetItem(ret,rk,elt);
2627 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2630 static MEDFileParameters *New();
2631 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2632 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2633 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2634 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2635 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2636 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2637 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2638 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2639 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2640 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2641 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2646 return MEDFileParameters::New();
2649 MEDFileParameters(const char *fileName)
2651 return MEDFileParameters::New(fileName);
2654 std::string __str__() const throw(INTERP_KERNEL::Exception)
2656 return self->simpleRepr();
2659 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2661 if(PyInt_Check(obj))
2663 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2668 else if(PyString_Check(obj))
2670 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2676 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2679 int __len__() const throw(INTERP_KERNEL::Exception)
2681 return self->getNumberOfParams();
2684 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2686 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2692 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2694 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2700 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2703 bool ret0=self->isEqual(other,eps,what);
2704 PyObject *res=PyList_New(2);
2705 PyObject *ret0Py=ret0?Py_True:Py_False;
2707 PyList_SetItem(res,0,ret0Py);
2708 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2714 class MEDFileData : public RefCountObject, public MEDFileWritable
2717 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2718 static MEDFileData *New();
2719 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2720 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2721 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2722 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2723 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2724 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2725 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2727 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2728 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2730 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2733 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2735 return MEDFileData::New(fileName);
2740 return MEDFileData::New();
2743 std::string __str__() const throw(INTERP_KERNEL::Exception)
2745 return self->simpleRepr();
2748 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2750 MEDFileMeshes *ret=self->getMeshes();
2756 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2758 MEDFileParameters *ret=self->getParams();
2764 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2766 MEDFileFields *ret=self->getFields();
2772 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2774 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2775 return self->changeMeshNames(modifTab);
2780 class SauvReader : public RefCountObject
2783 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2784 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2787 class SauvWriter : public RefCountObject
2790 static SauvWriter * New();
2791 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2792 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2797 class MEDFileMeshStruct;
2799 class MEDFileField1TSStructItem
2802 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2805 class MEDFileMeshStruct : public RefCountObject
2808 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2810 ~MEDFileMeshStruct();
2813 class MEDMeshMultiLev : public RefCountObject
2816 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2817 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2822 class MEDUMeshMultiLev : public MEDMeshMultiLev
2825 ~MEDUMeshMultiLev();
2829 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2831 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2832 self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces);
2833 PyObject *ret=PyTuple_New(6);
2834 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2835 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2836 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2837 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2838 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2845 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2848 ~MEDStructuredMeshMultiLev();
2851 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2854 ~MEDCMeshMultiLev();
2858 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2860 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2861 std::size_t sz(objs.size());
2862 PyObject *ret=PyList_New(sz);
2863 for(std::size_t i=0;i<sz;i++)
2864 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2870 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2873 ~MEDCurveLinearMeshMultiLev();
2877 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2879 DataArrayDouble *ret0(0);
2880 std::vector<int> ret1;
2881 self->buildVTUArrays(ret0,ret1);
2882 std::size_t sz(ret1.size());
2883 PyObject *ret=PyTuple_New(2);
2884 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2885 PyObject *ret1Py=PyList_New(sz);
2886 for(std::size_t i=0;i<sz;i++)
2887 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2888 PyTuple_SetItem(ret,1,ret1Py);
2894 class MEDFileFastCellSupportComparator : public RefCountObject
2897 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2898 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2899 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2901 ~MEDFileFastCellSupportComparator();