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::buildDataArray;
186 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
187 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
189 %feature("unref") MEDFileMesh "$this->decrRef();"
190 %feature("unref") MEDFileUMesh "$this->decrRef();"
191 %feature("unref") MEDFileCMesh "$this->decrRef();"
192 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
193 %feature("unref") MEDFileMeshes "$this->decrRef();"
194 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
195 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
196 %feature("unref") MEDFileField1TS "$this->decrRef();"
197 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
198 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
199 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
200 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
201 %feature("unref") MEDFileFields "$this->decrRef();"
202 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
203 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
204 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
205 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
206 %feature("unref") MEDFileParameters "$this->decrRef();"
207 %feature("unref") MEDFileData "$this->decrRef();"
208 %feature("unref") SauvReader "$this->decrRef();"
209 %feature("unref") SauvWriter "$this->decrRef();"
210 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
211 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
212 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
213 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
214 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
219 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
220 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
221 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
222 static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
223 static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
224 static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
225 static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
226 static std::vector<std::string> GetMeshFamiliesNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
227 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const char *fileName, const char *meshName, const char *grpName) throw(INTERP_KERNEL::Exception);
228 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const char *fileName, const char *meshName, const char *famName) throw(INTERP_KERNEL::Exception);
229 static std::vector<std::string> GetAllFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
230 static std::vector<std::string> GetAllFieldNames(const char *fileName) throw(INTERP_KERNEL::Exception);
231 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
232 static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
233 static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
234 static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
237 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
239 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
240 PyObject *ret=PyList_New(res.size());
242 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
244 PyObject *elt=PyTuple_New(2);
245 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
246 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
247 PyList_SetItem(ret,rk,elt);
252 static PyObject *GetAllFieldIterations(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
254 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
255 PyObject *ret=PyList_New(res.size());
257 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
259 PyObject *elt=PyTuple_New(3);
260 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
261 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
262 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
263 PyList_SetItem(ret,rk,elt);
268 static PyObject *GetCellFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
270 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
271 PyObject *ret=PyList_New(res.size());
273 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
275 PyObject *elt=PyTuple_New(2);
276 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
277 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
278 PyList_SetItem(ret,rk,elt);
282 static PyObject *GetNodeFieldIterations(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
284 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
285 PyObject *ret=PyList_New(res.size());
287 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
289 PyObject *elt=PyTuple_New(2);
290 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
291 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
292 PyList_SetItem(ret,rk,elt);
296 static PyObject *GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception)
298 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
299 PyObject *ret=PyList_New(res.size());
301 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
303 PyObject *elt=PyTuple_New(2);
304 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
305 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
306 PyList_SetItem(ret,rk,elt);
310 static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
312 int meshDim,spaceDim,numberOfNodes;
313 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
314 PyObject *ret=PyTuple_New(4);
315 PyObject *elt0=PyList_New(res.size());
317 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
319 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
321 PyObject *elt1=PyList_New(obj2.size());
322 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
324 PyObject *elt2=PyTuple_New(2);
325 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
326 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
327 PyList_SetItem(elt1,j,elt2);
329 PyList_SetItem(elt0,i,elt1);
331 PyTuple_SetItem(ret,0,elt0);
332 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
333 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
334 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
337 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax,
338 const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
340 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
341 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
342 return convertFieldDoubleVecToPy(res);
344 static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
346 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
347 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
348 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
350 static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
352 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
353 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
354 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
356 static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
358 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
359 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
360 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
362 static PyObject *GetTypesOfField(const char *fileName, const char *meshName, const char *fieldName) throw(INTERP_KERNEL::Exception)
364 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
366 PyObject *ret=PyList_New(size);
367 for(int i=0;i<size;i++)
368 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
371 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
373 std::vector<std::string> grps;
374 converPyListToVecString(li,grps);
375 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
377 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
379 std::vector<std::string> fams;
380 converPyListToVecString(li,fams);
381 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
384 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
385 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
386 static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
387 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);
388 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
389 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
390 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
391 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
392 static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
393 static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
394 static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
395 static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
396 static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
401 class MEDFileWritable
404 void copyOptionsFrom(const MEDFileWritable& other) const;
405 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
406 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
407 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
408 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
411 class MEDFileMeshReadSelector
414 MEDFileMeshReadSelector();
415 MEDFileMeshReadSelector(unsigned int code);
416 unsigned int getCode() const;
417 void setCode(unsigned int newCode);
418 bool isCellFamilyFieldReading() const;
419 bool isNodeFamilyFieldReading() const;
420 bool isCellNameFieldReading() const;
421 bool isNodeNameFieldReading() const;
422 bool isCellNumFieldReading() const;
423 bool isNodeNumFieldReading() const;
424 void setCellFamilyFieldReading(bool b);
425 void setNodeFamilyFieldReading(bool b);
426 void setCellNameFieldReading(bool b);
427 void setNodeNameFieldReading(bool b);
428 void setCellNumFieldReading(bool b);
429 void setNodeNumFieldReading(bool b);
432 std::string __str__() const throw(INTERP_KERNEL::Exception)
434 std::ostringstream oss;
439 std::string __repr__() const throw(INTERP_KERNEL::Exception)
441 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
447 class MEDFileMesh : public RefCountObject, public MEDFileWritable
450 static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
451 static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
452 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
453 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
454 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
455 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
456 void setName(const char *name);
457 std::string getName();
458 const char *getUnivName() const;
459 bool getUnivNameWrStatus() const;
460 void setUnivNameWrStatus(bool newStatus);
461 void setDescription(const char *name);
462 std::string getDescription() const;
463 void setOrder(int order);
464 int getOrder() const;
465 void setIteration(int it);
467 void setTimeValue(double time);
468 void setTime(int dt, int it, double time);
469 double getTimeValue() const;
470 void setTimeUnit(const char *unit);
471 const char *getTimeUnit() const;
472 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
473 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
474 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
475 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
476 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
477 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
478 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
479 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
481 bool existsGroup(const char *groupName) const throw(INTERP_KERNEL::Exception);
482 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
483 bool existsFamily(const char *familyName) const throw(INTERP_KERNEL::Exception);
484 void setFamilyId(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
485 void setFamilyIdUnique(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
486 void addFamily(const char *familyName, int id) throw(INTERP_KERNEL::Exception);
487 void addFamilyOnGrp(const char *grpName, const char *famName) throw(INTERP_KERNEL::Exception);
488 virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
489 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
490 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
491 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
492 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
493 std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
494 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
495 std::vector<int> getFamiliesIdsOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
496 void setFamiliesOnGroup(const char *name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
497 void setFamiliesIdsOnGroup(const char *name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
498 std::vector<std::string> getGroupsOnFamily(const char *name) const throw(INTERP_KERNEL::Exception);
499 void setGroupsOnFamily(const char *famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
500 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
501 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
502 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
503 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
504 void removeGroup(const char *name) throw(INTERP_KERNEL::Exception);
505 void removeFamily(const char *name) throw(INTERP_KERNEL::Exception);
506 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
507 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
508 void changeGroupName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
509 void changeFamilyName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
510 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
511 void changeAllGroupsContainingFamily(const char *familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
512 void setFamilyInfo(const std::map<std::string,int>& info);
513 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
514 int getFamilyId(const char *name) const throw(INTERP_KERNEL::Exception);
515 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
516 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
517 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
518 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
519 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
520 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
521 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
522 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
523 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
524 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
525 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
526 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
527 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
528 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
529 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
530 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
531 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
532 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
533 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
535 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
536 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
537 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
538 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
539 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
540 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
541 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
542 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
543 virtual DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
544 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
545 virtual DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
546 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
549 std::string __str__() const throw(INTERP_KERNEL::Exception)
551 return self->simpleRepr();
554 PyObject *getTime() throw(INTERP_KERNEL::Exception)
557 double tmp0=self->getTime(tmp1,tmp2);
558 PyObject *res = PyList_New(3);
559 PyList_SetItem(res,0,SWIG_From_int(tmp1));
560 PyList_SetItem(res,1,SWIG_From_int(tmp2));
561 PyList_SetItem(res,2,SWIG_From_double(tmp0));
565 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
568 bool ret0=self->isEqual(other,eps,what);
569 PyObject *res=PyList_New(2);
570 PyObject *ret0Py=ret0?Py_True:Py_False;
572 PyList_SetItem(res,0,ret0Py);
573 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
577 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
580 bool ret0=self->areFamsEqual(other,what);
581 PyObject *res=PyList_New(2);
582 PyObject *ret0Py=ret0?Py_True:Py_False;
584 PyList_SetItem(res,0,ret0Py);
585 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
589 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
592 bool ret0=self->areGrpsEqual(other,what);
593 PyObject *res=PyList_New(2);
594 PyObject *ret0Py=ret0?Py_True:Py_False;
596 PyList_SetItem(res,0,ret0Py);
597 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
601 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
603 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
606 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
609 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
611 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
614 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
617 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
619 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
622 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
625 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
628 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
629 PyObject *ret=PyTuple_New(2);
630 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
631 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
635 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
637 DataArrayInt *ret3=0;
638 std::vector<int> ret1,ret2;
639 bool ret0=self->unPolyze(ret1,ret2,ret3);
640 PyObject *ret=PyTuple_New(4);
641 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
643 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
644 for(int j=0;j<(int)ret1.size()/3;j++)
646 PyObject *retLev2=PyList_New(3);
647 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
648 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
649 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
650 PyList_SetItem(retLev1_0,j,retLev2);
652 PyTuple_SetItem(ret,1,retLev1_0);
654 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
655 for(int j=0;j<(int)ret2.size()/3;j++)
657 PyObject *retLev2=PyList_New(3);
658 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
659 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
660 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
661 PyList_SetItem(retLev1_1,j,retLev2);
663 PyTuple_SetItem(ret,2,retLev1_1);
665 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
671 class MEDFileUMesh : public MEDFileMesh
674 static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
675 static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
676 static MEDFileUMesh *New();
678 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
680 std::vector<int> getGrpNonEmptyLevels(const char *grp) const throw(INTERP_KERNEL::Exception);
681 std::vector<int> getGrpNonEmptyLevelsExt(const char *grp) const throw(INTERP_KERNEL::Exception);
682 std::vector<int> getFamNonEmptyLevels(const char *fam) const throw(INTERP_KERNEL::Exception);
683 std::vector<int> getFamNonEmptyLevelsExt(const char *fam) const throw(INTERP_KERNEL::Exception);
684 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
685 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
686 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
687 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
688 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
689 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
690 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
691 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
692 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
693 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
694 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
695 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
696 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
697 DataArrayInt *getNodeGroupArr(const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
698 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
699 DataArrayInt *getNodeFamilyArr(const char *fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
700 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
701 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
702 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
703 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
704 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
705 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
706 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
708 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
709 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
710 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
711 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
712 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
713 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
714 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
715 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
716 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
719 MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
721 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
724 MEDFileUMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
726 return MEDFileUMesh::New(fileName,mrs);
731 return MEDFileUMesh::New();
734 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
736 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
739 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
742 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
744 std::vector<const DataArrayInt *> grps;
745 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
746 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
749 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
751 std::vector<const MEDCouplingUMesh *> ms;
752 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
753 self->setMeshes(ms,renum);
756 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
758 std::vector<const MEDCouplingUMesh *> ms;
759 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
760 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
763 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
765 std::vector<const MEDCouplingUMesh *> ms;
766 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
767 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
770 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
772 DataArrayDouble *ret=self->getCoords();
778 PyObject *duplicateNodesOnM1Group(const char *grpNameM1) throw(INTERP_KERNEL::Exception)
780 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
781 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
782 PyObject *ret=PyTuple_New(3);
783 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
784 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
785 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
789 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
791 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
792 std::size_t sz(tmp.size());
793 PyObject *ret=PyList_New(sz);
794 for(std::size_t i=0;i<sz;i++)
798 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
805 class MEDFileStructuredMesh : public MEDFileMesh
809 class MEDFileCMesh : public MEDFileStructuredMesh
812 static MEDFileCMesh *New();
813 static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
814 static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
815 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
820 return MEDFileCMesh::New();
823 MEDFileCMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
825 return MEDFileCMesh::New(fileName,mrs);
828 MEDFileCMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
830 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
833 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
835 const MEDCouplingCMesh *tmp=self->getMesh();
838 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
843 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
846 static MEDFileCurveLinearMesh *New();
847 static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
848 static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
849 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
852 MEDFileCurveLinearMesh()
854 return MEDFileCurveLinearMesh::New();
857 MEDFileCurveLinearMesh(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
859 return MEDFileCurveLinearMesh::New(fileName,mrs);
862 MEDFileCurveLinearMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
864 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
867 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
869 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
872 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
877 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
880 static MEDFileMeshMultiTS *New();
881 static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
882 static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
883 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
884 std::string getName() const throw(INTERP_KERNEL::Exception);
885 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
886 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
891 return MEDFileMeshMultiTS::New();
894 MEDFileMeshMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception)
896 return MEDFileMeshMultiTS::New(fileName);
899 MEDFileMeshMultiTS(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception)
901 return MEDFileMeshMultiTS::New(fileName,mName);
904 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
906 MEDFileMesh *ret=self->getOneTimeStep();
914 class MEDFileMeshesIterator
919 PyObject *next() throw(INTERP_KERNEL::Exception)
921 MEDFileMesh *ret=self->nextt();
925 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
929 PyErr_SetString(PyExc_StopIteration,"No more data.");
936 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
939 static MEDFileMeshes *New();
940 static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
941 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
942 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
943 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
944 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
946 void resize(int newSize) throw(INTERP_KERNEL::Exception);
947 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
948 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
949 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
954 return MEDFileMeshes::New();
957 MEDFileMeshes(const char *fileName) throw(INTERP_KERNEL::Exception)
959 return MEDFileMeshes::New(fileName);
962 std::string __str__() const throw(INTERP_KERNEL::Exception)
964 return self->simpleRepr();
967 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
971 MEDFileMesh *ret=self->getMeshAtPos((int)PyInt_AS_LONG(obj));
976 else if(PyString_Check(obj))
978 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
984 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
987 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
989 self->setMeshAtPos(obj,mesh);
993 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
995 return self->iterator();
998 int __len__() const throw(INTERP_KERNEL::Exception)
1000 return self->getNumberOfMeshes();
1003 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1005 MEDFileMesh *ret=self->getMeshAtPos(i);
1010 MEDFileMesh *getMeshWithName(const char *mname) const throw(INTERP_KERNEL::Exception)
1012 MEDFileMesh *ret=self->getMeshWithName(mname);
1020 class MEDFileFieldLoc : public RefCountObject
1023 std::string getName() const;
1024 int getDimension() const;
1025 int getNumberOfGaussPoints() const;
1026 int getNumberOfPointsInCells() const;
1027 const std::vector<double>& getRefCoords() const;
1028 const std::vector<double>& getGaussCoords() const;
1029 const std::vector<double>& getGaussWeights() const;
1030 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1033 std::string __str__() const throw(INTERP_KERNEL::Exception)
1035 return self->repr();
1040 class MEDFileFieldGlobsReal
1043 void resetContent();
1044 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1045 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1046 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1047 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1048 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1049 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1050 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1051 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1052 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1053 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1054 bool existsPfl(const char *pflName) const throw(INTERP_KERNEL::Exception);
1055 bool existsLoc(const char *locName) const throw(INTERP_KERNEL::Exception);
1056 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1057 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1058 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1059 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1060 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1061 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1062 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1063 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1064 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1065 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1066 void changePflName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1067 void changeLocName(const char *oldName, const char *newName) throw(INTERP_KERNEL::Exception);
1068 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1069 int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
1072 PyObject *getProfile(const char *pflName) const throw(INTERP_KERNEL::Exception)
1074 const DataArrayInt *ret=self->getProfile(pflName);
1077 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1080 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1082 const DataArrayInt *ret=self->getProfileFromId(pflId);
1085 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1088 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1090 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1093 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1096 PyObject *getLocalization(const char *locName) const throw(INTERP_KERNEL::Exception)
1098 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1101 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1104 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1106 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1107 return convertVecPairVecStToPy(ret);
1110 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1112 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1113 return convertVecPairVecStToPy(ret);
1116 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1118 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1119 self->changePflsNames(v);
1122 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1124 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1125 self->changePflsRefsNamesGen(v);
1128 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1130 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1131 self->changePflsNamesInStruct(v);
1134 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1136 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1137 self->changeLocsNames(v);
1140 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1142 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1143 self->changeLocsRefsNamesGen(v);
1146 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1148 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1149 self->changeLocsNamesInStruct(v);
1152 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1154 std::ostringstream oss;
1155 self->simpleReprGlobs(oss);
1161 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1164 static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1165 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1166 static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1167 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1168 void loadArrays() throw(INTERP_KERNEL::Exception);
1169 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1170 void releaseArrays() throw(INTERP_KERNEL::Exception);
1171 int getDimension() const throw(INTERP_KERNEL::Exception);
1172 int getIteration() const throw(INTERP_KERNEL::Exception);
1173 int getOrder() const throw(INTERP_KERNEL::Exception);
1174 std::string getName() throw(INTERP_KERNEL::Exception);
1175 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1176 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1177 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1178 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1179 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1180 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1181 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1182 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1183 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1184 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1185 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1186 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1187 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1188 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1191 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1194 double tmp0=self->getTime(tmp1,tmp2);
1195 PyObject *res = PyList_New(3);
1196 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1197 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1198 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1202 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1204 std::pair<int,int> res=self->getDtIt();
1205 PyObject *elt=PyTuple_New(2);
1206 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1207 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1211 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1213 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1216 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1218 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1221 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1223 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1224 return self->changeMeshNames(modifTab);
1227 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1229 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1230 PyObject *ret2=PyList_New(ret.size());
1231 for(int i=0;i<(int)ret.size();i++)
1232 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1236 PyObject *getNonEmptyLevels(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1238 std::vector<int> ret1;
1239 int ret0=self->getNonEmptyLevels(mname,ret1);
1240 PyObject *elt=PyTuple_New(2);
1241 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1242 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1246 PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1248 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1249 std::vector< std::vector<TypeOfField> > typesF;
1250 std::vector< std::vector<std::string> > pfls;
1251 std::vector< std::vector<std::string> > locs;
1252 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1254 PyObject *ret2=PyList_New(sz);
1255 for(int i=0;i<sz;i++)
1257 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1258 const std::vector<TypeOfField>& typesFI=typesF[i];
1259 const std::vector<std::string>& pflsI=pfls[i];
1260 const std::vector<std::string>& locsI=locs[i];
1261 PyObject *elt=PyTuple_New(2);
1262 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1263 int sz2=ret[i].size();
1264 PyObject *elt2=PyList_New(sz2);
1265 for(int j=0;j<sz2;j++)
1267 PyObject *elt3=PyTuple_New(4);
1268 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1269 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));
1270 PyTuple_SetItem(elt3,1,elt4);
1271 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1272 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1273 PyList_SetItem(elt2,j,elt3);
1275 PyTuple_SetItem(elt,1,elt2);
1276 PyList_SetItem(ret2,i,elt);
1281 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1283 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1284 std::size_t sz=ret.size();
1285 PyObject *retPy=PyList_New(sz);
1286 for(std::size_t i=0;i<sz;i++)
1287 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1291 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1293 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1294 std::size_t sz=ret.size();
1295 PyObject *retPy=PyList_New(sz);
1296 for(std::size_t i=0;i<sz;i++)
1297 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1303 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1306 static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1307 static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1308 static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1309 static MEDFileField1TS *New();
1310 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1311 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1312 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1313 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1314 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1315 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1317 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1318 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1319 void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1320 void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1323 MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1325 return MEDFileField1TS::New(fileName,loadAll);
1328 MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1330 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1333 MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1335 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1340 return MEDFileField1TS::New();
1343 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1345 const DataArrayDouble *arr=0;
1347 arr=field->getArray();
1348 self->copyTinyInfoFrom(field,arr);
1351 std::string __str__() const throw(INTERP_KERNEL::Exception)
1353 return self->simpleRepr();
1356 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1358 DataArrayInt *ret1=0;
1359 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1360 PyObject *ret=PyTuple_New(2);
1361 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1362 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1366 PyObject *getFieldSplitedByType2(const char *mname=0) const throw(INTERP_KERNEL::Exception)
1368 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1369 std::vector< std::vector<TypeOfField> > typesF;
1370 std::vector< std::vector<std::string> > pfls;
1371 std::vector< std::vector<std::string> > locs;
1372 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1374 PyObject *ret2=PyList_New(sz);
1375 for(int i=0;i<sz;i++)
1377 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1378 const std::vector<TypeOfField>& typesFI=typesF[i];
1379 const std::vector<std::string>& pflsI=pfls[i];
1380 const std::vector<std::string>& locsI=locs[i];
1381 PyObject *elt=PyTuple_New(2);
1382 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1383 int sz2=ret[i].size();
1384 PyObject *elt2=PyList_New(sz2);
1385 for(int j=0;j<sz2;j++)
1387 PyObject *elt3=PyTuple_New(4);
1388 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1389 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1390 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1391 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1392 PyList_SetItem(elt2,j,elt3);
1394 PyTuple_SetItem(elt,1,elt2);
1395 PyList_SetItem(ret2,i,elt);
1400 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1402 DataArrayDouble *ret=self->getUndergroundDataArray();
1408 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1410 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1411 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1414 PyObject *ret=PyTuple_New(2);
1415 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1416 std::size_t sz=elt1Cpp.size();
1417 PyObject *elt=PyList_New(sz);
1418 for(std::size_t i=0;i<sz;i++)
1420 PyObject *elt1=PyTuple_New(2);
1421 PyObject *elt2=PyTuple_New(2);
1422 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1423 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1424 PyObject *elt3=PyTuple_New(2);
1425 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1426 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1427 PyTuple_SetItem(elt1,0,elt2);
1428 PyTuple_SetItem(elt1,1,elt3);
1429 PyList_SetItem(elt,i,elt1);
1431 PyTuple_SetItem(ret,1,elt);
1437 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1440 static MEDFileIntField1TS *New();
1441 static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1442 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1443 static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1444 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1446 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1447 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1450 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1452 return MEDFileIntField1TS::New();
1455 MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1457 return MEDFileIntField1TS::New(fileName,loadAll);
1460 MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1462 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1465 MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1467 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1470 std::string __str__() const throw(INTERP_KERNEL::Exception)
1472 return self->simpleRepr();
1475 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1477 DataArrayInt *ret1=0;
1478 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1479 PyObject *ret=PyTuple_New(2);
1480 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1481 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1485 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1487 DataArrayInt *ret1=0;
1488 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1489 PyObject *ret=PyTuple_New(2);
1490 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1491 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1495 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1497 DataArrayInt *ret1=0;
1498 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1499 PyObject *ret=PyTuple_New(2);
1500 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1501 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1505 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1507 DataArrayInt *ret1=0;
1508 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1509 PyObject *ret=PyTuple_New(2);
1510 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1511 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1515 PyObject *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1517 DataArrayInt *ret1=0;
1518 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1519 PyObject *ret=PyTuple_New(2);
1520 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1521 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1525 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1527 DataArrayInt *ret1=0;
1528 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1529 PyObject *ret=PyTuple_New(2);
1530 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1531 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1535 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1537 DataArrayInt *ret=self->getUndergroundDataArray();
1545 class MEDFileAnyTypeFieldMultiTSIterator
1550 PyObject *next() throw(INTERP_KERNEL::Exception)
1552 MEDFileAnyTypeField1TS *ret=self->nextt();
1554 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1557 PyErr_SetString(PyExc_StopIteration,"No more data.");
1564 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1567 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1568 static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1569 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1570 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1571 std::string getName() const throw(INTERP_KERNEL::Exception);
1572 void setName(const char *name) throw(INTERP_KERNEL::Exception);
1573 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1574 void setDtUnit(const char *dtUnit) throw(INTERP_KERNEL::Exception);
1575 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1576 void setMeshName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
1577 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1578 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1579 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1580 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1581 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1582 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1583 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
1584 void loadArrays() throw(INTERP_KERNEL::Exception);
1585 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1586 void releaseArrays() throw(INTERP_KERNEL::Exception);
1588 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1589 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1590 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1591 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1592 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1595 int __len__() const throw(INTERP_KERNEL::Exception)
1597 return self->getNumberOfTS();
1600 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1602 if(elt0 && PyInt_Check(elt0))
1604 int pos=PyInt_AS_LONG(elt0);
1607 else if(elt0 && PyTuple_Check(elt0))
1609 if(PyTuple_Size(elt0)==2)
1611 PyObject *o0=PyTuple_GetItem(elt0,0);
1612 PyObject *o1=PyTuple_GetItem(elt0,1);
1613 if(PyInt_Check(o0) && PyInt_Check(o1))
1615 int iter=PyInt_AS_LONG(o0);
1616 int order=PyInt_AS_LONG(o1);
1617 return self->getPosOfTimeStep(iter,order);
1620 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 !");
1623 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 !");
1625 else if(elt0 && PyFloat_Check(elt0))
1627 double val=PyFloat_AS_DOUBLE(elt0);
1628 return self->getPosGivenTime(val);
1631 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1634 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1636 std::vector< std::pair<int,int> > res=self->getIterations();
1637 PyObject *ret=PyList_New(res.size());
1639 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1641 PyObject *elt=PyTuple_New(2);
1642 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1643 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1644 PyList_SetItem(ret,rk,elt);
1649 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1651 std::vector<double> ret1;
1652 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1653 std::size_t sz=ret.size();
1654 PyObject *ret2=PyList_New(sz);
1655 for(std::size_t i=0;i<sz;i++)
1657 PyObject *elt=PyTuple_New(3);
1658 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1659 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1660 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1661 PyList_SetItem(ret2,i,elt);
1666 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1668 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1669 PyObject *ret2=PyList_New(ret.size());
1670 for(int i=0;i<(int)ret.size();i++)
1672 const std::vector<TypeOfField>& rett=ret[i];
1673 PyObject *ret3=PyList_New(rett.size());
1674 for(int j=0;j<(int)rett.size();j++)
1675 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1676 PyList_SetItem(ret2,i,ret3);
1681 PyObject *getNonEmptyLevels(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1683 std::vector<int> ret1;
1684 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1685 PyObject *elt=PyTuple_New(2);
1686 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1687 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1691 PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1693 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1694 std::vector< std::vector<TypeOfField> > typesF;
1695 std::vector< std::vector<std::string> > pfls;
1696 std::vector< std::vector<std::string> > locs;
1697 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1699 PyObject *ret2=PyList_New(sz);
1700 for(int i=0;i<sz;i++)
1702 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1703 const std::vector<TypeOfField>& typesFI=typesF[i];
1704 const std::vector<std::string>& pflsI=pfls[i];
1705 const std::vector<std::string>& locsI=locs[i];
1706 PyObject *elt=PyTuple_New(2);
1707 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1708 int sz2=ret[i].size();
1709 PyObject *elt2=PyList_New(sz2);
1710 for(int j=0;j<sz2;j++)
1712 PyObject *elt3=PyTuple_New(4);
1713 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1714 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));
1715 PyTuple_SetItem(elt3,1,elt4);
1716 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1717 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1718 PyList_SetItem(elt2,j,elt3);
1720 PyTuple_SetItem(elt,1,elt2);
1721 PyList_SetItem(ret2,i,elt);
1726 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1728 if(PyList_Check(elts))
1730 int sz=PyList_Size(elts);
1731 std::vector<int> ret(sz);
1732 for(int i=0;i<sz;i++)
1734 PyObject *elt=PyList_GetItem(elts,i);
1735 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1741 std::vector<int> ret(1);
1742 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1747 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1749 if(PySlice_Check(elts))
1751 Py_ssize_t strt=2,stp=2,step=2;
1752 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1753 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1755 self->eraseTimeStepIds2(strt,stp,step);
1758 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1762 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1763 if(!idsToRemove.empty())
1764 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1768 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1772 std::vector<int> pos2;
1773 DataArrayInt *pos3=0;
1774 DataArrayIntTuple *pos4=0;
1775 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1780 self->eraseTimeStepIds(&pos1,&pos1+1);
1787 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1792 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1796 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1800 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1802 return self->iterator();
1805 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1807 if(elt0 && PyList_Check(elt0))
1809 int sz=PyList_Size(elt0);
1810 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1811 int *pt=da->getPointer();
1812 for(int i=0;i<sz;i++,pt++)
1814 PyObject *elt1=PyList_GetItem(elt0,i);
1815 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1817 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1819 else if(elt0 && PySlice_Check(elt0))
1821 Py_ssize_t strt=2,stp=2,step=2;
1822 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1823 if(PySlice_GetIndices(oC,self->getNumberOfTS(),&strt,&stp,&step)==0)
1824 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1826 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1829 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1832 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1834 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1835 return self->changeMeshNames(modifTab);
1838 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1840 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1841 std::size_t sz=ret.size();
1842 PyObject *retPy=PyList_New(sz);
1843 for(std::size_t i=0;i<sz;i++)
1844 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1848 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1850 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1851 std::size_t sz=ret.size();
1852 PyObject *retPy=PyList_New(sz);
1853 for(std::size_t i=0;i<sz;i++)
1854 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1858 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1860 std::vector<MEDFileAnyTypeField1TS *> tmp;
1861 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1862 self->pushBackTimeSteps(tmp);
1865 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1867 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1868 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1869 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1870 std::size_t sz=ret.size();
1871 PyObject *retPy=PyList_New(sz);
1872 for(std::size_t i=0;i<sz;i++)
1874 std::size_t sz2=ret[i].size();
1875 PyObject *ret1Py=PyList_New(sz2);
1876 for(std::size_t j=0;j<sz2;j++)
1878 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1881 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1883 PyList_SetItem(retPy,i,ret1Py);
1888 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1890 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1891 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1892 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh);
1893 std::size_t sz=ret.size();
1894 PyObject *retPy=PyList_New(sz);
1895 for(std::size_t i=0;i<sz;i++)
1897 std::size_t sz2=ret[i].size();
1898 PyObject *ret1Py=PyList_New(sz2);
1899 for(std::size_t j=0;j<sz2;j++)
1901 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1904 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1906 PyList_SetItem(retPy,i,ret1Py);
1913 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
1916 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
1917 static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1918 static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1920 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1921 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1922 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1923 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1924 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1926 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1927 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1928 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1931 MEDFileFieldMultiTS()
1933 return MEDFileFieldMultiTS::New();
1936 MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1938 return MEDFileFieldMultiTS::New(fileName,loadAll);
1941 MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1943 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
1946 std::string __str__() const throw(INTERP_KERNEL::Exception)
1948 return self->simpleRepr();
1951 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1953 DataArrayInt *ret1=0;
1954 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
1955 PyObject *ret=PyTuple_New(2);
1956 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1957 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1961 PyObject *getFieldSplitedByType2(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
1963 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1964 std::vector< std::vector<TypeOfField> > typesF;
1965 std::vector< std::vector<std::string> > pfls;
1966 std::vector< std::vector<std::string> > locs;
1967 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
1969 PyObject *ret2=PyList_New(sz);
1970 for(int i=0;i<sz;i++)
1972 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1973 const std::vector<TypeOfField>& typesFI=typesF[i];
1974 const std::vector<std::string>& pflsI=pfls[i];
1975 const std::vector<std::string>& locsI=locs[i];
1976 PyObject *elt=PyTuple_New(2);
1977 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1978 int sz2=ret[i].size();
1979 PyObject *elt2=PyList_New(sz2);
1980 for(int j=0;j<sz2;j++)
1982 PyObject *elt3=PyTuple_New(4);
1983 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1984 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1985 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1986 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1987 PyList_SetItem(elt2,j,elt3);
1989 PyTuple_SetItem(elt,1,elt2);
1990 PyList_SetItem(ret2,i,elt);
1994 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
1996 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2002 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2004 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2005 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2008 PyObject *ret=PyTuple_New(2);
2009 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2010 std::size_t sz=elt1Cpp.size();
2011 PyObject *elt=PyList_New(sz);
2012 for(std::size_t i=0;i<sz;i++)
2014 PyObject *elt1=PyTuple_New(2);
2015 PyObject *elt2=PyTuple_New(2);
2016 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2017 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2018 PyObject *elt3=PyTuple_New(2);
2019 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2020 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2021 PyTuple_SetItem(elt1,0,elt2);
2022 PyTuple_SetItem(elt1,1,elt3);
2023 PyList_SetItem(elt,i,elt1);
2025 PyTuple_SetItem(ret,1,elt);
2031 class MEDFileFieldsIterator
2036 PyObject *next() throw(INTERP_KERNEL::Exception)
2038 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2040 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2043 PyErr_SetString(PyExc_StopIteration,"No more data.");
2050 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2053 static MEDFileIntFieldMultiTS *New();
2054 static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2055 static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2057 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2058 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2059 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2062 MEDFileIntFieldMultiTS()
2064 return MEDFileIntFieldMultiTS::New();
2067 MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2069 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2072 MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2074 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2077 std::string __str__() const throw(INTERP_KERNEL::Exception)
2079 return self->simpleRepr();
2082 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2084 DataArrayInt *ret1=0;
2085 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2086 PyObject *ret=PyTuple_New(2);
2087 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2088 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2092 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2094 DataArrayInt *ret1=0;
2095 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2096 PyObject *ret=PyTuple_New(2);
2097 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2098 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2102 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2104 DataArrayInt *ret1=0;
2105 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,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 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2114 DataArrayInt *ret1=0;
2115 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,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 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2124 DataArrayInt *ret1=0;
2125 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,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 *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2134 DataArrayInt *ret1=0;
2135 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2136 PyObject *ret=PyTuple_New(2);
2137 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2138 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2142 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2144 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2152 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2155 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2156 static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2157 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2158 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2159 void loadArrays() throw(INTERP_KERNEL::Exception);
2160 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2161 void releaseArrays() throw(INTERP_KERNEL::Exception);
2162 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2163 int getNumberOfFields() const;
2164 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2165 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2167 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2168 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2169 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2170 int getPosFromFieldName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2171 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2172 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception);
2173 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const char *meshName) const throw(INTERP_KERNEL::Exception);
2174 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2179 return MEDFileFields::New();
2182 MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2184 return MEDFileFields::New(fileName,loadAll);
2187 std::string __str__() const throw(INTERP_KERNEL::Exception)
2189 return self->simpleRepr();
2192 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2195 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2196 PyObject *ret=PyTuple_New(2);
2197 PyObject *ret_0=PyList_New(ret0.size());
2199 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2201 PyObject *elt=PyTuple_New(2);
2202 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2203 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2204 PyList_SetItem(ret_0,rk,elt);
2206 PyTuple_SetItem(ret,0,ret_0);
2207 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2208 PyTuple_SetItem(ret,1,ret_1);
2212 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2214 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2215 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2218 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2220 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2221 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2224 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2226 if(obj && PyList_Check(obj))
2228 int sz=PyList_Size(obj);
2229 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2230 int *pt=da->getPointer();
2231 for(int i=0;i<sz;i++,pt++)
2233 PyObject *elt1=PyList_GetItem(obj,i);
2234 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2236 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2239 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2242 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2244 self->setFieldAtPos(obj,field);
2248 int __len__() const throw(INTERP_KERNEL::Exception)
2250 return self->getNumberOfFields();
2253 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2255 return self->iterator();
2258 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2260 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2261 return self->changeMeshNames(modifTab);
2264 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2266 if(elt0 && PyInt_Check(elt0))
2268 return PyInt_AS_LONG(elt0);
2270 else if(elt0 && PyString_Check(elt0))
2271 return self->getPosFromFieldName(PyString_AsString(elt0));
2273 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2276 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2278 if(PyList_Check(elts))
2280 int sz=PyList_Size(elts);
2281 std::vector<int> ret(sz);
2282 for(int i=0;i<sz;i++)
2284 PyObject *elt=PyList_GetItem(elts,i);
2285 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2291 std::vector<int> ret(1);
2292 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2297 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2299 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2300 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2301 self->pushFields(tmp);
2304 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2306 if(elts && PySlice_Check(elts))
2308 Py_ssize_t strt=2,stp=2,step=2;
2309 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2310 if(PySlice_GetIndices(oC,self->getNumberOfFields(),&strt,&stp,&step)==0)
2311 self->destroyFieldsAtPos2(strt,stp,step);
2313 throw INTERP_KERNEL::Exception("MEDFileFields.__delitem__ : error in input slice !");
2317 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2318 if(!idsToRemove.empty())
2319 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2325 class MEDFileParameter1TS : public RefCountObject
2328 void setIteration(int it);
2329 int getIteration() const;
2330 void setOrder(int order);
2331 int getOrder() const;
2332 void setTimeValue(double time);
2333 void setTime(int dt, int it, double time);
2334 double getTime(int& dt, int& it);
2335 double getTimeValue() const;
2338 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2341 void setValue(double val) throw(INTERP_KERNEL::Exception);
2342 double getValue() const throw(INTERP_KERNEL::Exception);
2343 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2346 std::string __str__() const throw(INTERP_KERNEL::Exception)
2348 return self->simpleRepr();
2353 class MEDFileParameterTinyInfo : public MEDFileWritable
2356 void setDescription(const char *name);
2357 std::string getDescription() const;
2358 void setTimeUnit(const char *unit);
2359 std::string getTimeUnit() const;
2362 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2365 static MEDFileParameterDouble1TS *New();
2366 static MEDFileParameterDouble1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2367 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2368 static MEDFileParameterDouble1TS *New(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2369 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2370 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2371 void setName(const char *name) throw(INTERP_KERNEL::Exception);
2372 std::string getName() const throw(INTERP_KERNEL::Exception);
2373 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2376 MEDFileParameterDouble1TS()
2378 return MEDFileParameterDouble1TS::New();
2381 MEDFileParameterDouble1TS(const char *fileName) throw(INTERP_KERNEL::Exception)
2383 return MEDFileParameterDouble1TS::New(fileName);
2386 MEDFileParameterDouble1TS(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception)
2388 return MEDFileParameterDouble1TS::New(fileName,paramName);
2391 MEDFileParameterDouble1TS(const char *fileName, const char *paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2393 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2396 std::string __str__() const throw(INTERP_KERNEL::Exception)
2398 return self->simpleRepr();
2401 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2404 bool ret0=self->isEqual(other,eps,what);
2405 PyObject *res=PyList_New(2);
2406 PyObject *ret0Py=ret0?Py_True:Py_False;
2408 PyList_SetItem(res,0,ret0Py);
2409 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2415 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2418 static MEDFileParameterMultiTS *New();
2419 static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2420 static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
2421 std::string getName() const;
2422 void setName(const char *name);
2423 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2424 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2425 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2426 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2427 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2428 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2429 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2432 MEDFileParameterMultiTS()
2434 return MEDFileParameterMultiTS::New();
2437 MEDFileParameterMultiTS(const char *fileName)
2439 return MEDFileParameterMultiTS::New(fileName);
2442 MEDFileParameterMultiTS(const char *fileName, const char *paramName)
2444 return MEDFileParameterMultiTS::New(fileName,paramName);
2447 std::string __str__() const throw(INTERP_KERNEL::Exception)
2449 return self->simpleRepr();
2452 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2455 bool ret0=self->isEqual(other,eps,what);
2456 PyObject *res=PyList_New(2);
2457 PyObject *ret0Py=ret0?Py_True:Py_False;
2459 PyList_SetItem(res,0,ret0Py);
2460 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2464 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2468 std::vector<int> pos2;
2469 DataArrayInt *pos3=0;
2470 DataArrayIntTuple *pos4=0;
2471 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2476 self->eraseTimeStepIds(&pos1,&pos1+1);
2483 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2488 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2492 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2496 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2498 if(elt0 && PyInt_Check(elt0))
2500 int pos=PyInt_AS_LONG(elt0);
2503 else if(elt0 && PyTuple_Check(elt0))
2505 if(PyTuple_Size(elt0)==2)
2507 PyObject *o0=PyTuple_GetItem(elt0,0);
2508 PyObject *o1=PyTuple_GetItem(elt0,1);
2509 if(PyInt_Check(o0) && PyInt_Check(o1))
2511 int iter=PyInt_AS_LONG(o0);
2512 int order=PyInt_AS_LONG(o1);
2513 return self->getPosOfTimeStep(iter,order);
2516 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 !");
2519 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 !");
2521 else if(elt0 && PyFloat_Check(elt0))
2523 double val=PyFloat_AS_DOUBLE(elt0);
2524 return self->getPosGivenTime(val);
2527 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2530 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2532 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2538 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2540 if(PyList_Check(elts))
2542 int sz=PyList_Size(elts);
2543 std::vector<int> ret(sz);
2544 for(int i=0;i<sz;i++)
2546 PyObject *elt=PyList_GetItem(elts,i);
2547 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2553 std::vector<int> ret(1);
2554 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2559 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2561 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2562 if(!idsToRemove.empty())
2563 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2566 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2568 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2574 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2576 std::vector< std::pair<int,int> > res=self->getIterations();
2577 PyObject *ret=PyList_New(res.size());
2579 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2581 PyObject *elt=PyTuple_New(2);
2582 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2583 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2584 PyList_SetItem(ret,rk,elt);
2589 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2591 std::vector<double> res2;
2592 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2593 PyObject *ret=PyList_New(res.size());
2595 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2597 PyObject *elt=PyTuple_New(3);
2598 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2599 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2600 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2601 PyList_SetItem(ret,rk,elt);
2608 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2611 static MEDFileParameters *New();
2612 static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2613 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2614 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2615 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2616 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2617 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2618 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2619 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2620 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2621 int getPosFromParamName(const char *paramName) const throw(INTERP_KERNEL::Exception);
2622 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2627 return MEDFileParameters::New();
2630 MEDFileParameters(const char *fileName)
2632 return MEDFileParameters::New(fileName);
2635 std::string __str__() const throw(INTERP_KERNEL::Exception)
2637 return self->simpleRepr();
2640 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2642 if(PyInt_Check(obj))
2644 MEDFileParameterMultiTS *ret=self->getParamAtPos((int)PyInt_AS_LONG(obj));
2649 else if(PyString_Check(obj))
2651 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2657 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2660 int __len__() const throw(INTERP_KERNEL::Exception)
2662 return self->getNumberOfParams();
2665 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2667 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2673 MEDFileParameterMultiTS *getParamWithName(const char *paramName) const throw(INTERP_KERNEL::Exception)
2675 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2681 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2684 bool ret0=self->isEqual(other,eps,what);
2685 PyObject *res=PyList_New(2);
2686 PyObject *ret0Py=ret0?Py_True:Py_False;
2688 PyList_SetItem(res,0,ret0Py);
2689 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2695 class MEDFileData : public RefCountObject, public MEDFileWritable
2698 static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
2699 static MEDFileData *New();
2700 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2701 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2702 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2703 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2704 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2705 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2706 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2708 bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception);
2709 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2711 void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
2714 MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception)
2716 return MEDFileData::New(fileName);
2721 return MEDFileData::New();
2724 std::string __str__() const throw(INTERP_KERNEL::Exception)
2726 return self->simpleRepr();
2729 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2731 MEDFileMeshes *ret=self->getMeshes();
2737 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2739 MEDFileParameters *ret=self->getParams();
2745 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2747 MEDFileFields *ret=self->getFields();
2753 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2755 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2756 return self->changeMeshNames(modifTab);
2761 class SauvReader : public RefCountObject
2764 static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
2765 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2768 class SauvWriter : public RefCountObject
2771 static SauvWriter * New();
2772 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2773 void write(const char* fileName) throw(INTERP_KERNEL::Exception);
2778 class MEDFileMeshStruct;
2780 class MEDFileField1TSStructItem
2783 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt);
2786 class MEDFileMeshStruct : public RefCountObject
2789 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
2791 ~MEDFileMeshStruct();
2794 class MEDMeshMultiLev : public RefCountObject
2797 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2802 class MEDUMeshMultiLev : public MEDMeshMultiLev
2805 ~MEDUMeshMultiLev();
2809 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2811 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
2812 self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces);
2813 PyObject *ret=PyTuple_New(6);
2814 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2815 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
2816 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2817 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2818 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2819 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2825 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
2828 ~MEDStructuredMeshMultiLev();
2831 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
2834 ~MEDCMeshMultiLev();
2838 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
2840 std::vector< DataArrayDouble * > objs(self->buildVTUArrays());
2841 std::size_t sz(objs.size());
2842 PyObject *ret=PyList_New(sz);
2843 for(std::size_t i=0;i<sz;i++)
2844 PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2850 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
2853 ~MEDCurveLinearMeshMultiLev();
2857 PyObject *buildVTUArrays(DataArrayDouble *&coords, std::vector<int>& nodeStrct) const throw(INTERP_KERNEL::Exception)
2859 DataArrayDouble *ret0(0);
2860 std::vector<int> ret1;
2861 self->buildVTUArrays(ret0,ret1);
2862 std::size_t sz(ret1.size());
2863 PyObject *ret=PyTuple_New(2);
2864 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2865 PyObject *ret1Py=PyList_New(sz);
2866 for(std::size_t i=0;i<sz;i++)
2867 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
2868 PyTuple_SetItem(ret,1,ret1Py);
2874 class MEDFileFastCellSupportComparator : public RefCountObject
2877 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
2878 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2879 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
2881 ~MEDFileFastCellSupportComparator();