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 bool HasXDR();
222 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
223 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
224 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
225 static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
226 static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
227 static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
228 static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
229 static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
230 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
231 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
237 static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
240 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
242 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
243 PyObject *ret=PyList_New(res.size());
245 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
247 PyObject *elt=PyTuple_New(2);
248 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
249 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
250 PyList_SetItem(ret,rk,elt);
255 static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
257 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
258 PyObject *ret=PyList_New(res.size());
260 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
262 PyObject *elt=PyTuple_New(3);
263 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
264 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
265 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
266 PyList_SetItem(ret,rk,elt);
271 static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
273 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
274 PyObject *ret=PyList_New(res.size());
276 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
278 PyObject *elt=PyTuple_New(2);
279 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
280 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
281 PyList_SetItem(ret,rk,elt);
285 static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
287 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
288 PyObject *ret=PyList_New(res.size());
290 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
292 PyObject *elt=PyTuple_New(2);
293 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
294 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
295 PyList_SetItem(ret,rk,elt);
299 static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
301 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
302 PyObject *ret=PyList_New(res.size());
304 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
306 PyObject *elt=PyTuple_New(2);
307 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
308 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
309 PyList_SetItem(ret,rk,elt);
313 static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
315 int meshDim,spaceDim,numberOfNodes;
316 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
317 PyObject *ret=PyTuple_New(4);
318 PyObject *elt0=PyList_New(res.size());
320 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
322 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
324 PyObject *elt1=PyList_New(obj2.size());
325 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
327 PyObject *elt2=PyTuple_New(2);
328 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
329 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
330 PyList_SetItem(elt1,j,elt2);
332 PyList_SetItem(elt0,i,elt1);
334 PyTuple_SetItem(ret,0,elt0);
335 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
336 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
337 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
340 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
341 const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
343 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
344 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
345 return convertFieldDoubleVecToPy(res);
347 static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
349 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
350 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
351 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
353 static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
355 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
356 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
357 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
359 static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
361 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
362 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
363 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
365 static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
367 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
369 PyObject *ret=PyList_New(size);
370 for(int i=0;i<size;i++)
371 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
374 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
376 std::vector<std::string> grps;
377 converPyListToVecString(li,grps);
378 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
380 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
382 std::vector<std::string> fams;
383 converPyListToVecString(li,fams);
384 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
387 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
388 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
389 static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
390 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);
391 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
392 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
393 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
394 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
395 static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
396 static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
397 static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
398 static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
399 static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
404 class MEDFileWritable
407 void copyOptionsFrom(const MEDFileWritable& other) const;
408 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
409 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
410 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
411 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
414 class MEDFileMeshReadSelector
417 MEDFileMeshReadSelector();
418 MEDFileMeshReadSelector(unsigned int code);
419 unsigned int getCode() const;
420 void setCode(unsigned int newCode);
421 bool isCellFamilyFieldReading() const;
422 bool isNodeFamilyFieldReading() const;
423 bool isCellNameFieldReading() const;
424 bool isNodeNameFieldReading() const;
425 bool isCellNumFieldReading() const;
426 bool isNodeNumFieldReading() const;
427 void setCellFamilyFieldReading(bool b);
428 void setNodeFamilyFieldReading(bool b);
429 void setCellNameFieldReading(bool b);
430 void setNodeNameFieldReading(bool b);
431 void setCellNumFieldReading(bool b);
432 void setNodeNumFieldReading(bool b);
435 std::string __str__() const throw(INTERP_KERNEL::Exception)
437 std::ostringstream oss;
442 std::string __repr__() const throw(INTERP_KERNEL::Exception)
444 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
450 class MEDFileMesh : public RefCountObject, public MEDFileWritable
453 static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
454 static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
455 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
456 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
457 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
458 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
459 void setName(const char *name);
460 std::string getName();
461 const char *getUnivName() const;
462 bool getUnivNameWrStatus() const;
463 void setUnivNameWrStatus(bool newStatus);
464 void setDescription(const char *name);
465 std::string getDescription() const;
466 void setOrder(int order);
467 int getOrder() const;
468 void setIteration(int it);
470 void setTimeValue(double time);
471 void setTime(int dt, int it, double time);
472 double getTimeValue() const;
473 void setTimeUnit(const char *unit);
474 const char *getTimeUnit() const;
475 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
476 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
477 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
478 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
479 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
480 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
481 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
482 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
483 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
485 bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
486 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
487 bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
488 void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
489 void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
490 void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
491 void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
492 virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
493 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
494 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
495 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
496 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
497 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
498 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
499 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
500 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
501 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
502 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
503 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
504 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
505 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
506 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
507 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
508 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
509 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
510 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
511 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
512 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
513 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
514 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
515 void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
516 void setFamilyInfo(const std::map<std::string,int>& info);
517 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
518 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
519 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
520 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
521 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
522 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
523 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
524 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
525 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
526 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
527 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
528 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
529 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
530 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
531 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
532 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
533 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
534 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
535 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
536 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
537 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
539 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
540 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
541 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
542 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
543 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
544 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
545 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
546 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
547 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
548 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
549 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
550 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
553 std::string __str__() const throw(INTERP_KERNEL::Exception)
555 return self->simpleRepr();
558 PyObject *getTime() throw(INTERP_KERNEL::Exception)
561 double tmp0=self->getTime(tmp1,tmp2);
562 PyObject *res = PyList_New(3);
563 PyList_SetItem(res,0,SWIG_From_int(tmp1));
564 PyList_SetItem(res,1,SWIG_From_int(tmp2));
565 PyList_SetItem(res,2,SWIG_From_double(tmp0));
569 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
572 bool ret0=self->isEqual(other,eps,what);
573 PyObject *res=PyList_New(2);
574 PyObject *ret0Py=ret0?Py_True:Py_False;
576 PyList_SetItem(res,0,ret0Py);
577 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
581 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
584 bool ret0=self->areFamsEqual(other,what);
585 PyObject *res=PyList_New(2);
586 PyObject *ret0Py=ret0?Py_True:Py_False;
588 PyList_SetItem(res,0,ret0Py);
589 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
593 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
596 bool ret0=self->areGrpsEqual(other,what);
597 PyObject *res=PyList_New(2);
598 PyObject *ret0Py=ret0?Py_True:Py_False;
600 PyList_SetItem(res,0,ret0Py);
601 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
605 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
607 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
610 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
613 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
615 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
618 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
621 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
623 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
626 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
629 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
632 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
633 PyObject *ret=PyTuple_New(2);
634 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
635 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
639 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
641 DataArrayInt *ret3=0;
642 std::vector<int> ret1,ret2;
643 bool ret0=self->unPolyze(ret1,ret2,ret3);
644 PyObject *ret=PyTuple_New(4);
645 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
647 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
648 for(int j=0;j<(int)ret1.size()/3;j++)
650 PyObject *retLev2=PyList_New(3);
651 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
652 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
653 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
654 PyList_SetItem(retLev1_0,j,retLev2);
656 PyTuple_SetItem(ret,1,retLev1_0);
658 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
659 for(int j=0;j<(int)ret2.size()/3;j++)
661 PyObject *retLev2=PyList_New(3);
662 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
663 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
664 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
665 PyList_SetItem(retLev1_1,j,retLev2);
667 PyTuple_SetItem(ret,2,retLev1_1);
669 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
675 class MEDFileUMesh : public MEDFileMesh
678 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
679 static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
680 static MEDFileUMesh *New();
682 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
684 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
685 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
686 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
687 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
688 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
689 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
690 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
691 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
692 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
693 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
694 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
695 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
696 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
697 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
698 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
699 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
700 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
701 DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
702 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
703 DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
704 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
705 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
706 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
707 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
708 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
709 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
711 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
712 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
713 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
714 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
715 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
716 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
717 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
718 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
719 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
722 MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
724 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
727 MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
729 return MEDFileUMesh::New(fileName,mrs);
734 return MEDFileUMesh::New();
737 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
739 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
742 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
745 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
747 std::vector<const DataArrayInt *> grps;
748 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
749 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
752 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
754 std::vector<const MEDCouplingUMesh *> ms;
755 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
756 self->setMeshes(ms,renum);
759 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
761 std::vector<const MEDCouplingUMesh *> ms;
762 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
763 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
766 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
768 std::vector<const MEDCouplingUMesh *> ms;
769 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
770 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
773 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
775 DataArrayDouble *ret=self->getCoords();
781 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
783 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
784 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
785 PyObject *ret=PyTuple_New(3);
786 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
787 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
788 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
792 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
794 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
800 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
802 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
803 std::size_t sz(tmp.size());
804 PyObject *ret=PyList_New(sz);
805 for(std::size_t i=0;i<sz;i++)
809 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
816 class MEDFileStructuredMesh : public MEDFileMesh
820 class MEDFileCMesh : public MEDFileStructuredMesh
823 static MEDFileCMesh *New();
824 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
825 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
826 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
831 return MEDFileCMesh::New();
834 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
836 return MEDFileCMesh::New(fileName,mrs);
839 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
841 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
844 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
846 const MEDCouplingCMesh *tmp=self->getMesh();
849 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
854 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
857 static MEDFileCurveLinearMesh *New();
858 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
859 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
860 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
863 MEDFileCurveLinearMesh()
865 return MEDFileCurveLinearMesh::New();
868 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
870 return MEDFileCurveLinearMesh::New(fileName,mrs);
873 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
875 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
878 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
880 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
883 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
888 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
891 static MEDFileMeshMultiTS *New();
892 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
893 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
894 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
895 std::string getName() const throw(INTERP_KERNEL::Exception);
896 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
897 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
902 return MEDFileMeshMultiTS::New();
905 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
907 return MEDFileMeshMultiTS::New(fileName);
910 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
912 return MEDFileMeshMultiTS::New(fileName,mName);
915 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
917 MEDFileMesh *ret=self->getOneTimeStep();
925 class MEDFileMeshesIterator
930 PyObject *next() throw(INTERP_KERNEL::Exception)
932 MEDFileMesh *ret=self->nextt();
936 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
940 PyErr_SetString(PyExc_StopIteration,"No more data.");
947 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
950 static MEDFileMeshes *New();
951 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
952 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
953 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
954 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
955 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
957 void resize(int newSize) throw(INTERP_KERNEL::Exception);
958 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
959 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
960 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
965 return MEDFileMeshes::New();
968 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
970 return MEDFileMeshes::New(fileName);
973 std::string __str__() const throw(INTERP_KERNEL::Exception)
975 return self->simpleRepr();
978 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
982 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
987 else if(PyString_Check(obj))
989 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
995 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
998 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1000 self->setMeshAtPos(obj,mesh);
1004 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1006 return self->iterator();
1009 int __len__() const throw(INTERP_KERNEL::Exception)
1011 return self->getNumberOfMeshes();
1014 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1016 MEDFileMesh *ret=self->getMeshAtPos(i);
1021 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1023 MEDFileMesh *ret=self->getMeshWithName(mname);
1031 class MEDFileFieldLoc : public RefCountObject
1034 std::string getName() const;
1035 int getDimension() const;
1036 int getNumberOfGaussPoints() const;
1037 int getNumberOfPointsInCells() const;
1038 const std::vector<double>& getRefCoords() const;
1039 const std::vector<double>& getGaussCoords() const;
1040 const std::vector<double>& getGaussWeights() const;
1041 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1044 std::string __str__() const throw(INTERP_KERNEL::Exception)
1046 return self->repr();
1051 class MEDFileFieldGlobsReal
1054 void resetContent();
1055 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1056 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1057 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1058 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1059 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1060 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1061 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1062 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1063 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1064 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1065 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1066 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1067 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1068 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1069 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1070 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1071 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1072 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1073 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1074 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1075 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1076 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1077 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1078 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1079 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1080 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1083 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1085 const DataArrayInt *ret=self->getProfile(pflName);
1088 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1091 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1093 const DataArrayInt *ret=self->getProfileFromId(pflId);
1096 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1099 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1101 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1104 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1107 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1109 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1112 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1115 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1117 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1118 return convertVecPairVecStToPy(ret);
1121 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1123 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1124 return convertVecPairVecStToPy(ret);
1127 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1129 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1130 self->changePflsNames(v);
1133 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1135 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1136 self->changePflsRefsNamesGen(v);
1139 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1141 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1142 self->changePflsNamesInStruct(v);
1145 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1147 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1148 self->changeLocsNames(v);
1151 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1153 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1154 self->changeLocsRefsNamesGen(v);
1157 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1159 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1160 self->changeLocsNamesInStruct(v);
1163 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1165 std::ostringstream oss;
1166 self->simpleReprGlobs(oss);
1172 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1175 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1176 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1177 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1178 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1179 void loadArrays() throw(INTERP_KERNEL::Exception);
1180 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1181 void unloadArrays() throw(INTERP_KERNEL::Exception);
1182 int getDimension() const throw(INTERP_KERNEL::Exception);
1183 int getIteration() const throw(INTERP_KERNEL::Exception);
1184 int getOrder() const throw(INTERP_KERNEL::Exception);
1185 std::string getName() throw(INTERP_KERNEL::Exception);
1186 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1187 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1188 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1189 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1190 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1191 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1192 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1193 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1194 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1195 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1196 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1197 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1198 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1199 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1202 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1205 double tmp0=self->getTime(tmp1,tmp2);
1206 PyObject *res = PyList_New(3);
1207 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1208 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1209 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1213 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1215 std::pair<int,int> res=self->getDtIt();
1216 PyObject *elt=PyTuple_New(2);
1217 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1218 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1222 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1224 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1227 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1229 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1232 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1234 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1235 return self->changeMeshNames(modifTab);
1238 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1240 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1241 PyObject *ret2=PyList_New(ret.size());
1242 for(int i=0;i<(int)ret.size();i++)
1243 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1247 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1249 std::vector<int> ret1;
1250 int ret0=self->getNonEmptyLevels(mname,ret1);
1251 PyObject *elt=PyTuple_New(2);
1252 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1253 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1257 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1259 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1260 std::vector< std::vector<TypeOfField> > typesF;
1261 std::vector< std::vector<std::string> > pfls;
1262 std::vector< std::vector<std::string> > locs;
1263 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1265 PyObject *ret2=PyList_New(sz);
1266 for(int i=0;i<sz;i++)
1268 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1269 const std::vector<TypeOfField>& typesFI=typesF[i];
1270 const std::vector<std::string>& pflsI=pfls[i];
1271 const std::vector<std::string>& locsI=locs[i];
1272 PyObject *elt=PyTuple_New(2);
1273 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1274 int sz2=ret[i].size();
1275 PyObject *elt2=PyList_New(sz2);
1276 for(int j=0;j<sz2;j++)
1278 PyObject *elt3=PyTuple_New(4);
1279 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1280 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));
1281 PyTuple_SetItem(elt3,1,elt4);
1282 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1283 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1284 PyList_SetItem(elt2,j,elt3);
1286 PyTuple_SetItem(elt,1,elt2);
1287 PyList_SetItem(ret2,i,elt);
1292 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1294 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1295 std::size_t sz=ret.size();
1296 PyObject *retPy=PyList_New(sz);
1297 for(std::size_t i=0;i<sz;i++)
1298 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1302 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1304 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1305 std::size_t sz=ret.size();
1306 PyObject *retPy=PyList_New(sz);
1307 for(std::size_t i=0;i<sz;i++)
1308 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1314 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1317 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1318 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1319 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1320 static MEDFileField1TS *New();
1321 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1322 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1323 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1324 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1325 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1326 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1328 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1329 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1330 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1331 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1334 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1336 return MEDFileField1TS::New(fileName,loadAll);
1339 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1341 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1344 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1346 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1351 return MEDFileField1TS::New();
1354 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1356 const DataArrayDouble *arr=0;
1358 arr=field->getArray();
1359 self->copyTinyInfoFrom(field,arr);
1362 std::string __str__() const throw(INTERP_KERNEL::Exception)
1364 return self->simpleRepr();
1367 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1369 DataArrayInt *ret1=0;
1370 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1371 PyObject *ret=PyTuple_New(2);
1372 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1373 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1377 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1379 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1380 std::vector< std::vector<TypeOfField> > typesF;
1381 std::vector< std::vector<std::string> > pfls;
1382 std::vector< std::vector<std::string> > locs;
1383 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1385 PyObject *ret2=PyList_New(sz);
1386 for(int i=0;i<sz;i++)
1388 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1389 const std::vector<TypeOfField>& typesFI=typesF[i];
1390 const std::vector<std::string>& pflsI=pfls[i];
1391 const std::vector<std::string>& locsI=locs[i];
1392 PyObject *elt=PyTuple_New(2);
1393 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1394 int sz2=ret[i].size();
1395 PyObject *elt2=PyList_New(sz2);
1396 for(int j=0;j<sz2;j++)
1398 PyObject *elt3=PyTuple_New(4);
1399 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1400 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1401 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1402 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1403 PyList_SetItem(elt2,j,elt3);
1405 PyTuple_SetItem(elt,1,elt2);
1406 PyList_SetItem(ret2,i,elt);
1411 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1413 DataArrayDouble *ret=self->getUndergroundDataArray();
1419 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1421 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1422 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1425 PyObject *ret=PyTuple_New(2);
1426 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1427 std::size_t sz=elt1Cpp.size();
1428 PyObject *elt=PyList_New(sz);
1429 for(std::size_t i=0;i<sz;i++)
1431 PyObject *elt1=PyTuple_New(2);
1432 PyObject *elt2=PyTuple_New(2);
1433 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1434 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1435 PyObject *elt3=PyTuple_New(2);
1436 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1437 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1438 PyTuple_SetItem(elt1,0,elt2);
1439 PyTuple_SetItem(elt1,1,elt3);
1440 PyList_SetItem(elt,i,elt1);
1442 PyTuple_SetItem(ret,1,elt);
1448 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1451 static MEDFileIntField1TS *New();
1452 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1453 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1454 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1455 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1457 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1458 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1461 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1463 return MEDFileIntField1TS::New();
1466 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1468 return MEDFileIntField1TS::New(fileName,loadAll);
1471 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1473 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1476 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1478 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1481 std::string __str__() const throw(INTERP_KERNEL::Exception)
1483 return self->simpleRepr();
1486 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1488 DataArrayInt *ret1=0;
1489 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1490 PyObject *ret=PyTuple_New(2);
1491 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1492 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1496 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1498 DataArrayInt *ret1=0;
1499 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1500 PyObject *ret=PyTuple_New(2);
1501 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1502 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1506 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1508 DataArrayInt *ret1=0;
1509 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1510 PyObject *ret=PyTuple_New(2);
1511 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1512 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1516 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1518 DataArrayInt *ret1=0;
1519 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1520 PyObject *ret=PyTuple_New(2);
1521 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1522 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1526 PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1528 DataArrayInt *ret1=0;
1529 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1530 PyObject *ret=PyTuple_New(2);
1531 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1532 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1536 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1538 DataArrayInt *ret1=0;
1539 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1540 PyObject *ret=PyTuple_New(2);
1541 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1542 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1546 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1548 DataArrayInt *ret=self->getUndergroundDataArray();
1556 class MEDFileAnyTypeFieldMultiTSIterator
1561 PyObject *next() throw(INTERP_KERNEL::Exception)
1563 MEDFileAnyTypeField1TS *ret=self->nextt();
1565 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1568 PyErr_SetString(PyExc_StopIteration,"No more data.");
1575 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1578 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1579 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1580 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1581 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1582 std::string getName() const throw(INTERP_KERNEL::Exception);
1583 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1584 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1585 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1586 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1587 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1588 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1589 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1590 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1591 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1592 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1593 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1594 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1595 void loadArrays() throw(INTERP_KERNEL::Exception);
1596 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1597 void unloadArrays() throw(INTERP_KERNEL::Exception);
1599 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1600 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1601 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1602 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1603 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1606 int __len__() const throw(INTERP_KERNEL::Exception)
1608 return self->getNumberOfTS();
1611 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1613 if(elt0 && PyInt_Check(elt0))
1615 int pos=PyInt_AS_LONG(elt0);
1618 else if(elt0 && PyTuple_Check(elt0))
1620 if(PyTuple_Size(elt0)==2)
1622 PyObject *o0=PyTuple_GetItem(elt0,0);
1623 PyObject *o1=PyTuple_GetItem(elt0,1);
1624 if(PyInt_Check(o0) && PyInt_Check(o1))
1626 int iter=PyInt_AS_LONG(o0);
1627 int order=PyInt_AS_LONG(o1);
1628 return self->getPosOfTimeStep(iter,order);
1631 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 !");
1634 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 !");
1636 else if(elt0 && PyFloat_Check(elt0))
1638 double val=PyFloat_AS_DOUBLE(elt0);
1639 return self->getPosGivenTime(val);
1642 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1645 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1647 std::vector< std::pair<int,int> > res=self->getIterations();
1648 PyObject *ret=PyList_New(res.size());
1650 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1652 PyObject *elt=PyTuple_New(2);
1653 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1654 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1655 PyList_SetItem(ret,rk,elt);
1660 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1662 std::vector<double> ret1;
1663 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1664 std::size_t sz=ret.size();
1665 PyObject *ret2=PyList_New(sz);
1666 for(std::size_t i=0;i<sz;i++)
1668 PyObject *elt=PyTuple_New(3);
1669 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1670 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1671 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1672 PyList_SetItem(ret2,i,elt);
1677 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1679 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1680 PyObject *ret2=PyList_New(ret.size());
1681 for(int i=0;i<(int)ret.size();i++)
1683 const std::vector<TypeOfField>& rett=ret[i];
1684 PyObject *ret3=PyList_New(rett.size());
1685 for(int j=0;j<(int)rett.size();j++)
1686 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1687 PyList_SetItem(ret2,i,ret3);
1692 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1694 std::vector<int> ret1;
1695 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1696 PyObject *elt=PyTuple_New(2);
1697 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1698 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1702 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1704 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1705 std::vector< std::vector<TypeOfField> > typesF;
1706 std::vector< std::vector<std::string> > pfls;
1707 std::vector< std::vector<std::string> > locs;
1708 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1710 PyObject *ret2=PyList_New(sz);
1711 for(int i=0;i<sz;i++)
1713 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1714 const std::vector<TypeOfField>& typesFI=typesF[i];
1715 const std::vector<std::string>& pflsI=pfls[i];
1716 const std::vector<std::string>& locsI=locs[i];
1717 PyObject *elt=PyTuple_New(2);
1718 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1719 int sz2=ret[i].size();
1720 PyObject *elt2=PyList_New(sz2);
1721 for(int j=0;j<sz2;j++)
1723 PyObject *elt3=PyTuple_New(4);
1724 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1725 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));
1726 PyTuple_SetItem(elt3,1,elt4);
1727 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1728 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1729 PyList_SetItem(elt2,j,elt3);
1731 PyTuple_SetItem(elt,1,elt2);
1732 PyList_SetItem(ret2,i,elt);
1737 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1739 if(PyList_Check(elts))
1741 int sz=PyList_Size(elts);
1742 std::vector<int> ret(sz);
1743 for(int i=0;i<sz;i++)
1745 PyObject *elt=PyList_GetItem(elts,i);
1746 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1752 std::vector<int> ret(1);
1753 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1758 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1760 if(PySlice_Check(elts))
1762 Py_ssize_t strt=2,stp=2,step=2;
1763 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1764 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1766 self->eraseTimeStepIds2(strt,stp,step);
1769 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1773 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1774 if(!idsToRemove.empty())
1775 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1779 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1783 std::vector<int> pos2;
1784 DataArrayInt *pos3=0;
1785 DataArrayIntTuple *pos4=0;
1786 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1791 self->eraseTimeStepIds(&pos1,&pos1+1);
1798 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1803 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1807 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1811 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1813 return self->iterator();
1816 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1818 if(elt0 && PyList_Check(elt0))
1820 int sz=PyList_Size(elt0);
1821 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1822 int *pt=da->getPointer();
1823 for(int i=0;i<sz;i++,pt++)
1825 PyObject *elt1=PyList_GetItem(elt0,i);
1826 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1828 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1830 else if(elt0 && PySlice_Check(elt0))
1832 Py_ssize_t strt=2,stp=2,step=2;
1833 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1834 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1835 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1837 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1840 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1843 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1845 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1846 return self->changeMeshNames(modifTab);
1849 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1851 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1852 std::size_t sz=ret.size();
1853 PyObject *retPy=PyList_New(sz);
1854 for(std::size_t i=0;i<sz;i++)
1855 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1859 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1861 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1862 std::size_t sz=ret.size();
1863 PyObject *retPy=PyList_New(sz);
1864 for(std::size_t i=0;i<sz;i++)
1865 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1869 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1871 std::vector<MEDFileAnyTypeField1TS *> tmp;
1872 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1873 self->pushBackTimeSteps(tmp);
1876 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1878 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1879 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1880 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1881 std::size_t sz=ret.size();
1882 PyObject *retPy=PyList_New(sz);
1883 for(std::size_t i=0;i<sz;i++)
1885 std::size_t sz2=ret[i].size();
1886 PyObject *ret1Py=PyList_New(sz2);
1887 for(std::size_t j=0;j<sz2;j++)
1889 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1892 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1894 PyList_SetItem(retPy,i,ret1Py);
1899 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1901 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1902 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1903 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
1904 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
1905 if(ret2.size()!=ret.size())
1907 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
1908 throw INTERP_KERNEL::Exception(oss.str().c_str());
1910 std::size_t sz=ret.size();
1911 PyObject *retPy=PyList_New(sz);
1912 for(std::size_t i=0;i<sz;i++)
1914 std::size_t sz2=ret[i].size();
1915 PyObject *ret0Py=PyTuple_New(2);
1916 PyObject *ret1Py=PyList_New(sz2);
1917 for(std::size_t j=0;j<sz2;j++)
1919 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1922 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1924 PyTuple_SetItem(ret0Py,0,ret1Py);
1925 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
1926 PyList_SetItem(retPy,i,ret0Py);
1933 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1936 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1937 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1938 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1940 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1941 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1942 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1943 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1944 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1946 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1947 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1948 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1951 MEDFileFieldMultiTS()
1953 return MEDFileFieldMultiTS::New();
1956 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1958 return MEDFileFieldMultiTS::New(fileName,loadAll);
1961 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1963 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
1966 std::string __str__() const throw(INTERP_KERNEL::Exception)
1968 return self->simpleRepr();
1971 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1973 DataArrayInt *ret1=0;
1974 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1975 PyObject *ret=PyTuple_New(2);
1976 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1977 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1981 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1983 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1984 std::vector< std::vector<TypeOfField> > typesF;
1985 std::vector< std::vector<std::string> > pfls;
1986 std::vector< std::vector<std::string> > locs;
1987 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1989 PyObject *ret2=PyList_New(sz);
1990 for(int i=0;i<sz;i++)
1992 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1993 const std::vector<TypeOfField>& typesFI=typesF[i];
1994 const std::vector<std::string>& pflsI=pfls[i];
1995 const std::vector<std::string>& locsI=locs[i];
1996 PyObject *elt=PyTuple_New(2);
1997 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1998 int sz2=ret[i].size();
1999 PyObject *elt2=PyList_New(sz2);
2000 for(int j=0;j<sz2;j++)
2002 PyObject *elt3=PyTuple_New(4);
2003 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2004 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2005 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2006 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2007 PyList_SetItem(elt2,j,elt3);
2009 PyTuple_SetItem(elt,1,elt2);
2010 PyList_SetItem(ret2,i,elt);
2014 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2016 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2022 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2024 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2025 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2028 PyObject *ret=PyTuple_New(2);
2029 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2030 std::size_t sz=elt1Cpp.size();
2031 PyObject *elt=PyList_New(sz);
2032 for(std::size_t i=0;i<sz;i++)
2034 PyObject *elt1=PyTuple_New(2);
2035 PyObject *elt2=PyTuple_New(2);
2036 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2037 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2038 PyObject *elt3=PyTuple_New(2);
2039 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2040 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2041 PyTuple_SetItem(elt1,0,elt2);
2042 PyTuple_SetItem(elt1,1,elt3);
2043 PyList_SetItem(elt,i,elt1);
2045 PyTuple_SetItem(ret,1,elt);
2051 class MEDFileFieldsIterator
2056 PyObject *next() throw(INTERP_KERNEL::Exception)
2058 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2060 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2063 PyErr_SetString(PyExc_StopIteration,"No more data.");
2070 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2073 static MEDFileIntFieldMultiTS *New();
2074 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2075 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2077 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2078 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2079 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2082 MEDFileIntFieldMultiTS()
2084 return MEDFileIntFieldMultiTS::New();
2087 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2089 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2092 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2094 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2097 std::string __str__() const throw(INTERP_KERNEL::Exception)
2099 return self->simpleRepr();
2102 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2104 DataArrayInt *ret1=0;
2105 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2106 PyObject *ret=PyTuple_New(2);
2107 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2108 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2112 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2114 DataArrayInt *ret1=0;
2115 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2116 PyObject *ret=PyTuple_New(2);
2117 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2118 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2122 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2124 DataArrayInt *ret1=0;
2125 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2126 PyObject *ret=PyTuple_New(2);
2127 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2128 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2132 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2134 DataArrayInt *ret1=0;
2135 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2136 PyObject *ret=PyTuple_New(2);
2137 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2138 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2142 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2144 DataArrayInt *ret1=0;
2145 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2146 PyObject *ret=PyTuple_New(2);
2147 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2148 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2152 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2154 DataArrayInt *ret1=0;
2155 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2156 PyObject *ret=PyTuple_New(2);
2157 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2158 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2164 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2172 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2175 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2176 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2177 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2178 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2179 void loadArrays() throw(INTERP_KERNEL::Exception);
2180 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2181 void unloadArrays() throw(INTERP_KERNEL::Exception);
2182 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2183 int getNumberOfFields() const;
2184 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2185 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2187 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2188 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2189 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2190 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2191 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2192 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2193 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2194 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2199 return MEDFileFields::New();
2202 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2204 return MEDFileFields::New(fileName,loadAll);
2207 std::string __str__() const throw(INTERP_KERNEL::Exception)
2209 return self->simpleRepr();
2212 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2215 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2216 PyObject *ret=PyTuple_New(2);
2217 PyObject *ret_0=PyList_New(ret0.size());
2219 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2221 PyObject *elt=PyTuple_New(2);
2222 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2223 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2224 PyList_SetItem(ret_0,rk,elt);
2226 PyTuple_SetItem(ret,0,ret_0);
2227 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2228 PyTuple_SetItem(ret,1,ret_1);
2232 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2234 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2235 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2238 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2240 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2241 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2244 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2246 if(obj && PyList_Check(obj))
2248 int sz=PyList_Size(obj);
2249 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2250 int *pt=da->getPointer();
2251 for(int i=0;i<sz;i++,pt++)
2253 PyObject *elt1=PyList_GetItem(obj,i);
2254 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2256 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2259 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2262 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2264 self->setFieldAtPos(obj,field);
2268 int __len__() const throw(INTERP_KERNEL::Exception)
2270 return self->getNumberOfFields();
2273 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2275 return self->iterator();
2278 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2280 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2281 return self->changeMeshNames(modifTab);
2284 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2286 if(elt0 && PyInt_Check(elt0))
2288 return PyInt_AS_LONG(elt0);
2290 else if(elt0 && PyString_Check(elt0))
2291 return self->getPosFromFieldName(PyString_AsString(elt0));
2293 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2296 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2298 if(PyList_Check(elts))
2300 int sz=PyList_Size(elts);
2301 std::vector<int> ret(sz);
2302 for(int i=0;i<sz;i++)
2304 PyObject *elt=PyList_GetItem(elts,i);
2305 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2311 std::vector<int> ret(1);
2312 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2317 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2319 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2320 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2321 self->pushFields(tmp);
2324 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2326 if(elts && PySlice_Check(elts))
2328 Py_ssize_t strt=2,stp=2,step=2;
2329 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2330 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2331 self->destroyFieldsAtPos2(strt,stp,step);
2333 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2337 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2338 if(!idsToRemove.empty())
2339 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2345 class MEDFileParameter1TS : public RefCountObject
2348 void setIteration(int it);
2349 int getIteration() const;
2350 void setOrder(int order);
2351 int getOrder() const;
2352 void setTimeValue(double time);
2353 void setTime(int dt, int it, double time);
2354 double getTime(int& dt, int& it);
2355 double getTimeValue() const;
2358 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2361 void setValue(double val) throw(INTERP_KERNEL::Exception);
2362 double getValue() const throw(INTERP_KERNEL::Exception);
2363 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2366 std::string __str__() const throw(INTERP_KERNEL::Exception)
2368 return self->simpleRepr();
2373 class MEDFileParameterTinyInfo : public MEDFileWritable
2376 void setDescription(const char *name);
2377 std::string getDescription() const;
2378 void setTimeUnit(const char *unit);
2379 std::string getTimeUnit() const;
2382 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2385 static MEDFileParameterDouble1TS *New();
2386 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2387 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2388 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2389 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2390 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2391 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2392 std::string getName() const throw(INTERP_KERNEL::Exception);
2393 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2396 MEDFileParameterDouble1TS()
2398 return MEDFileParameterDouble1TS::New();
2401 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2403 return MEDFileParameterDouble1TS::New(fileName);
2406 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2408 return MEDFileParameterDouble1TS::New(fileName,paramName);
2411 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2413 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2416 std::string __str__() const throw(INTERP_KERNEL::Exception)
2418 return self->simpleRepr();
2421 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2424 bool ret0=self->isEqual(other,eps,what);
2425 PyObject *res=PyList_New(2);
2426 PyObject *ret0Py=ret0?Py_True:Py_False;
2428 PyList_SetItem(res,0,ret0Py);
2429 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2435 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2438 static MEDFileParameterMultiTS *New();
2439 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2440 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2441 std::string getName() const;
2442 void setName(const char *name);
2443 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2444 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2445 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2446 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2447 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2448 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2449 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2452 MEDFileParameterMultiTS()
2454 return MEDFileParameterMultiTS::New();
2457 MEDFileParameterMultiTS(const char *fileName)
2459 return MEDFileParameterMultiTS::New(fileName);
2462 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2464 return MEDFileParameterMultiTS::New(fileName,paramName);
2467 std::string __str__() const throw(INTERP_KERNEL::Exception)
2469 return self->simpleRepr();
2472 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2475 bool ret0=self->isEqual(other,eps,what);
2476 PyObject *res=PyList_New(2);
2477 PyObject *ret0Py=ret0?Py_True:Py_False;
2479 PyList_SetItem(res,0,ret0Py);
2480 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2484 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2488 std::vector<int> pos2;
2489 DataArrayInt *pos3=0;
2490 DataArrayIntTuple *pos4=0;
2491 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2496 self->eraseTimeStepIds(&pos1,&pos1+1);
2503 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2508 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2512 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2516 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2518 if(elt0 && PyInt_Check(elt0))
2520 int pos=PyInt_AS_LONG(elt0);
2523 else if(elt0 && PyTuple_Check(elt0))
2525 if(PyTuple_Size(elt0)==2)
2527 PyObject *o0=PyTuple_GetItem(elt0,0);
2528 PyObject *o1=PyTuple_GetItem(elt0,1);
2529 if(PyInt_Check(o0) && PyInt_Check(o1))
2531 int iter=PyInt_AS_LONG(o0);
2532 int order=PyInt_AS_LONG(o1);
2533 return self->getPosOfTimeStep(iter,order);
2536 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 !");
2539 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 !");
2541 else if(elt0 && PyFloat_Check(elt0))
2543 double val=PyFloat_AS_DOUBLE(elt0);
2544 return self->getPosGivenTime(val);
2547 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2550 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2552 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2558 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2560 if(PyList_Check(elts))
2562 int sz=PyList_Size(elts);
2563 std::vector<int> ret(sz);
2564 for(int i=0;i<sz;i++)
2566 PyObject *elt=PyList_GetItem(elts,i);
2567 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2573 std::vector<int> ret(1);
2574 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2579 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2581 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2582 if(!idsToRemove.empty())
2583 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2586 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2588 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2594 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2596 std::vector< std::pair<int,int> > res=self->getIterations();
2597 PyObject *ret=PyList_New(res.size());
2599 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2601 PyObject *elt=PyTuple_New(2);
2602 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2603 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2604 PyList_SetItem(ret,rk,elt);
2609 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2611 std::vector<double> res2;
2612 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2613 PyObject *ret=PyList_New(res.size());
2615 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2617 PyObject *elt=PyTuple_New(3);
2618 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2619 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2620 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2621 PyList_SetItem(ret,rk,elt);
2628 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2631 static MEDFileParameters *New();
2632 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2633 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2634 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2635 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2636 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2637 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2638 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2639 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2640 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2641 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2642 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2647 return MEDFileParameters::New();
2650 MEDFileParameters(const char *fileName)
2652 return MEDFileParameters::New(fileName);
2655 std::string __str__() const throw(INTERP_KERNEL::Exception)
2657 return self->simpleRepr();
2660 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2662 if(PyInt_Check(obj))
2664 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2669 else if(PyString_Check(obj))
2671 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2677 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2680 int __len__() const throw(INTERP_KERNEL::Exception)
2682 return self->getNumberOfParams();
2685 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2687 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2693 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2695 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2701 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2704 bool ret0=self->isEqual(other,eps,what);
2705 PyObject *res=PyList_New(2);
2706 PyObject *ret0Py=ret0?Py_True:Py_False;
2708 PyList_SetItem(res,0,ret0Py);
2709 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2715 class MEDFileData : public RefCountObject, public MEDFileWritable
2718 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2719 static MEDFileData *New();
2720 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2721 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2722 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2723 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2724 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2725 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2726 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2728 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2729 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2731 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2734 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2736 return MEDFileData::New(fileName);
2741 return MEDFileData::New();
2744 std::string __str__() const throw(INTERP_KERNEL::Exception)
2746 return self->simpleRepr();
2749 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2751 MEDFileMeshes *ret=self->getMeshes();
2757 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2759 MEDFileParameters *ret=self->getParams();
2765 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2767 MEDFileFields *ret=self->getFields();
2773 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2775 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2776 return self->changeMeshNames(modifTab);
2781 class SauvReader : public RefCountObject
2784 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2785 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2788 class SauvWriter : public RefCountObject
2791 static SauvWriter * New();
2792 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2793 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2798 class MEDFileMeshStruct;
2800 class MEDFileField1TSStructItem
2803 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2806 class MEDFileMeshStruct : public RefCountObject
2809 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2811 ~MEDFileMeshStruct();
2814 class MEDMeshMultiLev : public RefCountObject
2817 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2818 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2823 class MEDUMeshMultiLev : public MEDMeshMultiLev
2826 ~MEDUMeshMultiLev();
2830 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2832 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2833 self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces);
2834 PyObject *ret=PyTuple_New(6);
2835 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2836 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2837 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2838 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2840 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2846 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2849 ~MEDStructuredMeshMultiLev();
2852 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2855 ~MEDCMeshMultiLev();
2859 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2861 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2862 std::size_t sz(objs.size());
2863 PyObject *ret=PyList_New(sz);
2864 for(std::size_t i=0;i<sz;i++)
2865 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2871 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2874 ~MEDCurveLinearMeshMultiLev();
2878 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2880 DataArrayDouble *ret0(0);
2881 std::vector<int> ret1;
2882 self->buildVTUArrays(ret0,ret1);
2883 std::size_t sz(ret1.size());
2884 PyObject *ret=PyTuple_New(2);
2885 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2886 PyObject *ret1Py=PyList_New(sz);
2887 for(std::size_t i=0;i<sz;i++)
2888 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2889 PyTuple_SetItem(ret,1,ret1Py);
2895 class MEDFileFastCellSupportComparator : public RefCountObject
2898 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2899 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2900 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2902 ~MEDFileFastCellSupportComparator();