1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
101 %newobject ParaMEDMEM::MEDFileUMesh::getGroup;
102 %newobject ParaMEDMEM::MEDFileUMesh::getGroups;
103 %newobject ParaMEDMEM::MEDFileUMesh::getFamily;
104 %newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
105 %newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel;
106 %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
107 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
108 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
109 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
110 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
111 %newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
112 %newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
113 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
114 %newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
115 %newobject ParaMEDMEM::MEDFileUMesh::__getitem__;
116 %newobject ParaMEDMEM::MEDFileCMesh::New;
117 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
118 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
119 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
120 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
121 %newobject ParaMEDMEM::MEDFileMeshes::New;
122 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
123 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
124 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
125 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
126 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
128 %newobject ParaMEDMEM::MEDFileFields::New;
129 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
130 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
131 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
132 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
133 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
134 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
135 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
136 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
137 %newobject ParaMEDMEM::MEDFileFields::__iter__;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
143 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
144 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
145 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
151 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
152 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
153 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
154 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
155 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
157 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
158 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
159 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
160 %newobject ParaMEDMEM::MEDFileField1TS::New;
161 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
162 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
163 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
164 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
165 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
166 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
167 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
168 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
169 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
171 %newobject ParaMEDMEM::MEDFileData::New;
172 %newobject ParaMEDMEM::MEDFileData::deepCpy;
173 %newobject ParaMEDMEM::MEDFileData::getMeshes;
174 %newobject ParaMEDMEM::MEDFileData::getFields;
175 %newobject ParaMEDMEM::MEDFileData::getParams;
177 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
178 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
179 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
180 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
181 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
182 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
183 %newobject ParaMEDMEM::MEDFileParameters::New;
184 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
185 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
186 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
187 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
189 %newobject ParaMEDMEM::SauvWriter::New;
190 %newobject ParaMEDMEM::SauvReader::New;
191 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
193 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
194 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
195 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
196 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
197 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
199 %feature("unref") MEDFileMesh "$this->decrRef();"
200 %feature("unref") MEDFileUMesh "$this->decrRef();"
201 %feature("unref") MEDFileCMesh "$this->decrRef();"
202 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
203 %feature("unref") MEDFileMeshes "$this->decrRef();"
204 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
205 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
206 %feature("unref") MEDFileField1TS "$this->decrRef();"
207 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
208 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
209 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
210 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
211 %feature("unref") MEDFileFields "$this->decrRef();"
212 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
213 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
214 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
215 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
216 %feature("unref") MEDFileParameters "$this->decrRef();"
217 %feature("unref") MEDFileData "$this->decrRef();"
218 %feature("unref") SauvReader "$this->decrRef();"
219 %feature("unref") SauvWriter "$this->decrRef();"
220 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
221 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
222 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
223 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
224 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
225 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
230 static bool HasXDR();
231 static std::string MEDFileVersionStr();
232 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
233 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
234 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
235 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
245 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
246 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
247 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
248 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
251 static PyObject *MEDFileVersion()
253 int major,minor,release;
254 MEDLoader::MEDFileVersion(major,minor,release);
255 PyObject *ret(PyTuple_New(3));
256 PyTuple_SetItem(ret,0,SWIG_From_int(major));
257 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
258 PyTuple_SetItem(ret,2,SWIG_From_int(release));
262 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
264 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
265 PyObject *ret=PyList_New(res.size());
267 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
269 PyObject *elt=PyTuple_New(2);
270 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
271 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
272 PyList_SetItem(ret,rk,elt);
277 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
279 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
280 PyObject *ret=PyList_New(res.size());
282 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
284 PyObject *elt=PyTuple_New(3);
285 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
286 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
287 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
288 PyList_SetItem(ret,rk,elt);
293 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
295 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
296 PyObject *ret=PyList_New(res.size());
298 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
300 PyObject *elt=PyTuple_New(2);
301 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
302 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
303 PyList_SetItem(ret,rk,elt);
307 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
309 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
310 PyObject *ret=PyList_New(res.size());
312 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
314 PyObject *elt=PyTuple_New(2);
315 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
316 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
317 PyList_SetItem(ret,rk,elt);
321 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
323 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
324 PyObject *ret=PyList_New(res.size());
326 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
328 PyObject *elt=PyTuple_New(2);
329 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
330 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
331 PyList_SetItem(ret,rk,elt);
335 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
337 int meshDim,spaceDim,numberOfNodes;
338 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
339 PyObject *ret=PyTuple_New(4);
340 PyObject *elt0=PyList_New(res.size());
342 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
344 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
346 PyObject *elt1=PyList_New(obj2.size());
347 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
349 PyObject *elt2=PyTuple_New(2);
350 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
351 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
352 PyList_SetItem(elt1,j,elt2);
354 PyList_SetItem(elt0,i,elt1);
356 PyTuple_SetItem(ret,0,elt0);
357 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
358 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
359 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
362 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
363 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
365 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
366 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
367 return convertFieldDoubleVecToPy(res);
369 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
371 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
372 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
373 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
375 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
377 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
378 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
379 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
381 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
383 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
384 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
385 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
387 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
389 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
391 PyObject *ret=PyList_New(size);
392 for(int i=0;i<size;i++)
393 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
396 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
398 std::vector<std::string> grps;
399 converPyListToVecString(li,grps);
400 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
402 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
404 std::vector<std::string> fams;
405 converPyListToVecString(li,fams);
406 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
409 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
410 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
411 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
412 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
413 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
414 static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
415 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
416 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
417 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
418 static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
419 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
420 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
421 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
422 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
423 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
424 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
429 class MEDFileWritable
432 void copyOptionsFrom(const MEDFileWritable& other) const;
433 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
434 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
435 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
436 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
439 class MEDFileMeshReadSelector
442 MEDFileMeshReadSelector();
443 MEDFileMeshReadSelector(unsigned int code);
444 unsigned int getCode() const;
445 void setCode(unsigned int newCode);
446 bool isCellFamilyFieldReading() const;
447 bool isNodeFamilyFieldReading() const;
448 bool isCellNameFieldReading() const;
449 bool isNodeNameFieldReading() const;
450 bool isCellNumFieldReading() const;
451 bool isNodeNumFieldReading() const;
452 void setCellFamilyFieldReading(bool b);
453 void setNodeFamilyFieldReading(bool b);
454 void setCellNameFieldReading(bool b);
455 void setNodeNameFieldReading(bool b);
456 void setCellNumFieldReading(bool b);
457 void setNodeNumFieldReading(bool b);
460 std::string __str__() const throw(INTERP_KERNEL::Exception)
462 std::ostringstream oss;
467 std::string __repr__() const throw(INTERP_KERNEL::Exception)
469 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
475 class MEDFileMesh : public RefCountObject, public MEDFileWritable
478 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
479 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
480 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
481 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
482 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
483 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
484 void setName(const std::string& name);
485 std::string getName();
486 std::string getUnivName() const;
487 bool getUnivNameWrStatus() const;
488 void setUnivNameWrStatus(bool newStatus);
489 void setDescription(const std::string& name);
490 std::string getDescription() const;
491 void setOrder(int order);
492 int getOrder() const;
493 void setIteration(int it);
495 void setTimeValue(double time);
496 void setTime(int dt, int it, double time);
497 double getTimeValue() const;
498 void setTimeUnit(const std::string& unit);
499 std::string getTimeUnit() const;
500 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
501 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
502 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
503 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
504 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
505 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
506 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
507 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
508 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
509 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
510 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
511 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
513 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
514 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
515 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
516 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
517 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
518 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
519 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
520 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
521 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
522 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
523 void clearGrpMap() throw(INTERP_KERNEL::Exception);
524 void clearFamMap() throw(INTERP_KERNEL::Exception);
525 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
526 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
527 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
528 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
529 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
530 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
531 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
532 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
533 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
534 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
535 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
536 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
537 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
538 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
539 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
540 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
541 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
542 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
543 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
544 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
545 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
546 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
547 void setFamilyInfo(const std::map<std::string,int>& info);
548 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
549 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
550 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
551 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
552 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
553 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
554 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
555 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
556 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
557 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
558 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
559 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
560 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
561 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
562 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
563 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
564 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
565 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
566 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
567 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
568 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
570 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
571 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
572 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
573 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
580 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
581 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
584 std::string __str__() const throw(INTERP_KERNEL::Exception)
586 return self->simpleRepr();
589 PyObject *getTime() throw(INTERP_KERNEL::Exception)
592 double tmp0=self->getTime(tmp1,tmp2);
593 PyObject *res = PyList_New(3);
594 PyList_SetItem(res,0,SWIG_From_int(tmp1));
595 PyList_SetItem(res,1,SWIG_From_int(tmp2));
596 PyList_SetItem(res,2,SWIG_From_double(tmp0));
600 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
603 bool ret0=self->isEqual(other,eps,what);
604 PyObject *res=PyList_New(2);
605 PyObject *ret0Py=ret0?Py_True:Py_False;
607 PyList_SetItem(res,0,ret0Py);
608 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
612 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
614 std::vector<const DataArrayInt *> grps;
615 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
616 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
619 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
622 bool ret0=self->areFamsEqual(other,what);
623 PyObject *res=PyList_New(2);
624 PyObject *ret0Py=ret0?Py_True:Py_False;
626 PyList_SetItem(res,0,ret0Py);
627 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
631 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
634 bool ret0=self->areGrpsEqual(other,what);
635 PyObject *res=PyList_New(2);
636 PyObject *ret0Py=ret0?Py_True:Py_False;
638 PyList_SetItem(res,0,ret0Py);
639 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
643 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
645 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
646 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
647 PyObject *res=PyList_New(result.size());
648 for(int i=0;iL!=result.end(); i++, iL++)
649 PyList_SetItem(res,i,PyInt_FromLong(*iL));
653 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
655 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
656 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
657 PyObject *res=PyList_New(result.size());
658 for(int i=0;iL!=result.end(); i++, iL++)
659 PyList_SetItem(res,i,PyInt_FromLong(*iL));
663 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
665 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
668 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
671 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
673 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
676 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
679 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
681 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
684 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
687 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
689 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
692 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
695 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
698 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
699 PyObject *ret=PyTuple_New(2);
700 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
701 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
705 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
707 DataArrayInt *ret3=0;
708 std::vector<int> ret1,ret2;
709 bool ret0=self->unPolyze(ret1,ret2,ret3);
710 PyObject *ret=PyTuple_New(4);
711 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
713 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
714 for(int j=0;j<(int)ret1.size()/3;j++)
716 PyObject *retLev2=PyList_New(3);
717 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
718 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
719 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
720 PyList_SetItem(retLev1_0,j,retLev2);
722 PyTuple_SetItem(ret,1,retLev1_0);
724 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
725 for(int j=0;j<(int)ret2.size()/3;j++)
727 PyObject *retLev2=PyList_New(3);
728 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
729 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
730 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
731 PyList_SetItem(retLev1_1,j,retLev2);
733 PyTuple_SetItem(ret,2,retLev1_1);
735 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
741 class MEDFileUMesh : public MEDFileMesh
744 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
745 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
746 static MEDFileUMesh *New();
748 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
749 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
751 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
752 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
753 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
754 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
755 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
756 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
757 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
758 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
759 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
760 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
761 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
762 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
763 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
764 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
765 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
766 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
767 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
768 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
769 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
770 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
772 int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
773 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
774 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
775 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
776 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
777 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
778 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
779 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
780 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
781 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
782 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
783 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
784 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
785 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
788 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
790 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
793 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
795 return MEDFileUMesh::New(fileName,mrs);
800 return MEDFileUMesh::New();
804 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
806 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
809 static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, PyObject *types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
811 std::vector<int> typesCpp1;
812 convertPyToNewIntArr3(types,typesCpp1);
813 std::size_t sz(typesCpp1.size());
814 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
815 for(std::size_t ii=0;ii<sz;ii++)
816 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
817 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
820 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
821 {// put an empty dict in input to say to __new__ to call __init__...
822 PyObject *ret(PyTuple_New(1));
823 PyObject *ret0(PyDict_New());
824 PyTuple_SetItem(ret,0,ret0);
828 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
830 std::vector<double> a0;
832 std::vector<std::string> a2;
833 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
834 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
835 self->serialize(a0,a1,a2,a3,a4);
836 PyObject *ret(PyTuple_New(5));
837 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
838 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
840 PyObject *ret2(PyList_New(sz));
841 for(int i=0;i<sz;i++)
842 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
843 PyTuple_SetItem(ret,2,ret2);
845 PyObject *ret3(PyList_New(sz));
846 for(int i=0;i<sz;i++)
848 DataArrayInt *elt(a3[i]);
851 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
853 PyTuple_SetItem(ret,3,ret3);
854 DataArrayDouble *ret4(a4);
857 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
861 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
863 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
864 if(!PyTuple_Check(inp))
865 throw INTERP_KERNEL::Exception(MSG);
866 int sz(PyTuple_Size(inp));
868 throw INTERP_KERNEL::Exception(MSG);
869 std::vector<double> a0;
871 std::vector<std::string> a2;
872 std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
873 MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
875 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
877 fillArrayWithPyListDbl3(a0py,tmp,a0);
878 convertPyToNewIntArr3(a1py,a1);
879 fillStringVector(a2py,a2);
881 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
883 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
884 if(!SWIG_IsOK(status))
885 throw INTERP_KERNEL::Exception(MSG);
886 a4=reinterpret_cast<DataArrayDouble *>(argp);
887 if((DataArrayDouble *)a4)
890 std::vector< DataArrayInt * > a3Tmp;
891 convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
892 std::size_t sz(a3Tmp.size());
894 for(std::size_t i=0;i<sz;i++)
900 self->unserialize(a0,a1,a2,a3,a4);
904 MEDCouplingUMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
906 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
909 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
911 std::vector<const MEDCouplingUMesh *> ms;
912 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
913 self->setMeshes(ms,renum);
916 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
918 std::vector<const MEDCouplingUMesh *> ms;
919 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
920 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
923 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
925 std::vector<const MEDCouplingUMesh *> ms;
926 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
927 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
930 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
932 DataArrayDouble *ret=self->getCoords();
938 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
940 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
943 return const_cast<PartDefinition *>(ret);
946 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
948 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
949 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
950 PyObject *ret=PyTuple_New(3);
951 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
952 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
953 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
957 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
959 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
965 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
967 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
968 std::size_t sz(tmp.size());
969 PyObject *ret=PyList_New(sz);
970 for(std::size_t i=0;i<sz;i++)
974 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
981 class MEDFileStructuredMesh : public MEDFileMesh
986 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
988 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
996 class MEDFileCMesh : public MEDFileStructuredMesh
999 static MEDFileCMesh *New();
1000 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1001 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1002 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1003 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1008 return MEDFileCMesh::New();
1011 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1013 return MEDFileCMesh::New(fileName,mrs);
1016 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1018 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1021 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1023 const MEDCouplingCMesh *tmp=self->getMesh();
1026 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1031 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1034 static MEDFileCurveLinearMesh *New();
1035 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1036 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1037 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1040 MEDFileCurveLinearMesh()
1042 return MEDFileCurveLinearMesh::New();
1045 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1047 return MEDFileCurveLinearMesh::New(fileName,mrs);
1050 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1052 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1055 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1057 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1060 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1065 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1068 static MEDFileMeshMultiTS *New();
1069 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1070 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1071 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1072 std::string getName() const throw(INTERP_KERNEL::Exception);
1073 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1074 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1077 MEDFileMeshMultiTS()
1079 return MEDFileMeshMultiTS::New();
1082 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1084 return MEDFileMeshMultiTS::New(fileName);
1087 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1089 return MEDFileMeshMultiTS::New(fileName,mName);
1092 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1094 MEDFileMesh *ret=self->getOneTimeStep();
1102 class MEDFileMeshesIterator
1107 PyObject *next() throw(INTERP_KERNEL::Exception)
1109 MEDFileMesh *ret=self->nextt();
1113 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1117 PyErr_SetString(PyExc_StopIteration,"No more data.");
1124 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1127 static MEDFileMeshes *New();
1128 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1129 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1130 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1131 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1132 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1134 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1135 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1136 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1137 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1142 return MEDFileMeshes::New();
1145 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1147 return MEDFileMeshes::New(fileName);
1150 std::string __str__() const throw(INTERP_KERNEL::Exception)
1152 return self->simpleRepr();
1155 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1157 if(PyInt_Check(obj))
1159 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1164 else if(PyString_Check(obj))
1166 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1172 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1175 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1177 self->setMeshAtPos(obj,mesh);
1181 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1183 return self->iterator();
1186 int __len__() const throw(INTERP_KERNEL::Exception)
1188 return self->getNumberOfMeshes();
1191 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1193 MEDFileMesh *ret=self->getMeshAtPos(i);
1198 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1200 MEDFileMesh *ret=self->getMeshWithName(mname);
1208 class MEDFileFieldLoc : public RefCountObject
1211 std::string getName() const;
1212 int getDimension() const;
1213 int getNumberOfGaussPoints() const;
1214 int getNumberOfPointsInCells() const;
1215 const std::vector<double>& getRefCoords() const;
1216 const std::vector<double>& getGaussCoords() const;
1217 const std::vector<double>& getGaussWeights() const;
1218 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1221 std::string __str__() const throw(INTERP_KERNEL::Exception)
1223 return self->repr();
1228 class MEDFileFieldGlobsReal
1231 void resetContent();
1232 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1233 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1234 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1235 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1236 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1237 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1238 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1239 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1240 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1241 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1242 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1243 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1244 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1245 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1246 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1247 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1248 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1249 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1250 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1251 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1252 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1253 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1254 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1255 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1256 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1257 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1260 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1262 const DataArrayInt *ret=self->getProfile(pflName);
1265 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1268 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1270 const DataArrayInt *ret=self->getProfileFromId(pflId);
1273 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1276 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1278 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1281 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1284 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1286 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1289 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1292 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1294 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1295 return convertVecPairVecStToPy(ret);
1298 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1300 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1301 return convertVecPairVecStToPy(ret);
1304 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1306 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1307 self->changePflsNames(v);
1310 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1312 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1313 self->changePflsRefsNamesGen(v);
1316 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1318 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1319 self->changePflsNamesInStruct(v);
1322 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1324 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1325 self->changeLocsNames(v);
1328 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1330 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1331 self->changeLocsRefsNamesGen(v);
1334 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1336 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1337 self->changeLocsNamesInStruct(v);
1340 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1342 std::ostringstream oss;
1343 self->simpleReprGlobs(oss);
1349 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1352 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1353 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1354 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1355 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1356 void loadArrays() throw(INTERP_KERNEL::Exception);
1357 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1358 void unloadArrays() throw(INTERP_KERNEL::Exception);
1359 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1360 int getDimension() const throw(INTERP_KERNEL::Exception);
1361 int getIteration() const throw(INTERP_KERNEL::Exception);
1362 int getOrder() const throw(INTERP_KERNEL::Exception);
1363 std::string getName() throw(INTERP_KERNEL::Exception);
1364 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1365 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1366 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1367 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1368 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1369 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1370 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1371 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1372 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1373 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1374 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1375 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1376 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1377 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1378 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1381 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1384 double tmp0=self->getTime(tmp1,tmp2);
1385 PyObject *res = PyList_New(3);
1386 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1387 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1388 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1392 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1394 std::pair<int,int> res=self->getDtIt();
1395 PyObject *elt=PyTuple_New(2);
1396 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1397 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1401 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1403 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1406 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1408 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1411 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1413 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1414 return self->changeMeshNames(modifTab);
1417 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1419 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1420 PyObject *ret2=PyList_New(ret.size());
1421 for(int i=0;i<(int)ret.size();i++)
1422 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1426 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1428 std::vector<int> ret1;
1429 int ret0=self->getNonEmptyLevels(mname,ret1);
1430 PyObject *elt=PyTuple_New(2);
1431 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1432 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1436 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1438 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1439 std::vector< std::vector<TypeOfField> > typesF;
1440 std::vector< std::vector<std::string> > pfls;
1441 std::vector< std::vector<std::string> > locs;
1442 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1444 PyObject *ret2=PyList_New(sz);
1445 for(int i=0;i<sz;i++)
1447 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1448 const std::vector<TypeOfField>& typesFI=typesF[i];
1449 const std::vector<std::string>& pflsI=pfls[i];
1450 const std::vector<std::string>& locsI=locs[i];
1451 PyObject *elt=PyTuple_New(2);
1452 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1453 int sz2=ret[i].size();
1454 PyObject *elt2=PyList_New(sz2);
1455 for(int j=0;j<sz2;j++)
1457 PyObject *elt3=PyTuple_New(4);
1458 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1459 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));
1460 PyTuple_SetItem(elt3,1,elt4);
1461 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1462 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1463 PyList_SetItem(elt2,j,elt3);
1465 PyTuple_SetItem(elt,1,elt2);
1466 PyList_SetItem(ret2,i,elt);
1471 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1473 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1474 std::size_t sz=ret.size();
1475 PyObject *retPy=PyList_New(sz);
1476 for(std::size_t i=0;i<sz;i++)
1477 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1481 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1483 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1484 std::size_t sz=ret.size();
1485 PyObject *retPy=PyList_New(sz);
1486 for(std::size_t i=0;i<sz;i++)
1487 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1491 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1493 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1494 std::size_t sz=ret.size();
1495 PyObject *retPy=PyList_New(sz);
1496 for(std::size_t i=0;i<sz;i++)
1497 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1503 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1506 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1507 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1508 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1509 static MEDFileField1TS *New();
1510 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1511 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1512 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1513 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1514 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1515 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1517 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1518 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1519 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1520 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1523 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1525 return MEDFileField1TS::New(fileName,loadAll);
1528 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1530 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1533 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1535 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1540 return MEDFileField1TS::New();
1543 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1545 const DataArrayDouble *arr=0;
1547 arr=field->getArray();
1548 self->copyTinyInfoFrom(field,arr);
1551 std::string __str__() const throw(INTERP_KERNEL::Exception)
1553 return self->simpleRepr();
1556 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1558 DataArrayInt *ret1=0;
1559 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1560 PyObject *ret=PyTuple_New(2);
1561 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1562 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1566 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1568 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1569 std::vector< std::vector<TypeOfField> > typesF;
1570 std::vector< std::vector<std::string> > pfls;
1571 std::vector< std::vector<std::string> > locs;
1572 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1574 PyObject *ret2=PyList_New(sz);
1575 for(int i=0;i<sz;i++)
1577 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1578 const std::vector<TypeOfField>& typesFI=typesF[i];
1579 const std::vector<std::string>& pflsI=pfls[i];
1580 const std::vector<std::string>& locsI=locs[i];
1581 PyObject *elt=PyTuple_New(2);
1582 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1583 int sz2=ret[i].size();
1584 PyObject *elt2=PyList_New(sz2);
1585 for(int j=0;j<sz2;j++)
1587 PyObject *elt3=PyTuple_New(4);
1588 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1589 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1590 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1591 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1592 PyList_SetItem(elt2,j,elt3);
1594 PyTuple_SetItem(elt,1,elt2);
1595 PyList_SetItem(ret2,i,elt);
1600 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1602 DataArrayDouble *ret=self->getUndergroundDataArray();
1608 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1610 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1611 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1614 PyObject *ret=PyTuple_New(2);
1615 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1616 std::size_t sz=elt1Cpp.size();
1617 PyObject *elt=PyList_New(sz);
1618 for(std::size_t i=0;i<sz;i++)
1620 PyObject *elt1=PyTuple_New(2);
1621 PyObject *elt2=PyTuple_New(2);
1622 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1623 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1624 PyObject *elt3=PyTuple_New(2);
1625 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1626 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1627 PyTuple_SetItem(elt1,0,elt2);
1628 PyTuple_SetItem(elt1,1,elt3);
1629 PyList_SetItem(elt,i,elt1);
1631 PyTuple_SetItem(ret,1,elt);
1637 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1640 static MEDFileIntField1TS *New();
1641 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1642 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1643 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1644 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1646 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1647 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1650 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1652 return MEDFileIntField1TS::New();
1655 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1657 return MEDFileIntField1TS::New(fileName,loadAll);
1660 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1662 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1665 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1667 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1670 std::string __str__() const throw(INTERP_KERNEL::Exception)
1672 return self->simpleRepr();
1675 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1677 DataArrayInt *ret1=0;
1678 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1679 PyObject *ret=PyTuple_New(2);
1680 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1681 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1685 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1687 DataArrayInt *ret1=0;
1688 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1689 PyObject *ret=PyTuple_New(2);
1690 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1691 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1695 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1697 DataArrayInt *ret1=0;
1698 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1699 PyObject *ret=PyTuple_New(2);
1700 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1701 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1705 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1707 DataArrayInt *ret1=0;
1708 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1709 PyObject *ret=PyTuple_New(2);
1710 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1711 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1715 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1717 DataArrayInt *ret1=0;
1718 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1719 PyObject *ret=PyTuple_New(2);
1720 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1721 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1725 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1727 DataArrayInt *ret1=0;
1728 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1729 PyObject *ret=PyTuple_New(2);
1730 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1731 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1735 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1737 DataArrayInt *ret=self->getUndergroundDataArray();
1745 class MEDFileAnyTypeFieldMultiTSIterator
1750 PyObject *next() throw(INTERP_KERNEL::Exception)
1752 MEDFileAnyTypeField1TS *ret=self->nextt();
1754 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1757 PyErr_SetString(PyExc_StopIteration,"No more data.");
1764 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1767 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1768 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1769 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1770 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1771 std::string getName() const throw(INTERP_KERNEL::Exception);
1772 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1773 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1774 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1775 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1776 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1777 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1778 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1779 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1780 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1781 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1782 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1783 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1784 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1785 void loadArrays() throw(INTERP_KERNEL::Exception);
1786 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1787 void unloadArrays() throw(INTERP_KERNEL::Exception);
1788 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1790 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1791 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1792 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1793 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1794 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1797 int __len__() const throw(INTERP_KERNEL::Exception)
1799 return self->getNumberOfTS();
1802 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1804 if(elt0 && PyInt_Check(elt0))
1806 int pos=PyInt_AS_LONG(elt0);
1809 else if(elt0 && PyTuple_Check(elt0))
1811 if(PyTuple_Size(elt0)==2)
1813 PyObject *o0=PyTuple_GetItem(elt0,0);
1814 PyObject *o1=PyTuple_GetItem(elt0,1);
1815 if(PyInt_Check(o0) && PyInt_Check(o1))
1817 int iter=PyInt_AS_LONG(o0);
1818 int order=PyInt_AS_LONG(o1);
1819 return self->getPosOfTimeStep(iter,order);
1822 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 !");
1825 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 !");
1827 else if(elt0 && PyFloat_Check(elt0))
1829 double val=PyFloat_AS_DOUBLE(elt0);
1830 return self->getPosGivenTime(val);
1833 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1836 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1838 std::vector< std::pair<int,int> > res=self->getIterations();
1839 PyObject *ret=PyList_New(res.size());
1841 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1843 PyObject *elt=PyTuple_New(2);
1844 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1845 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1846 PyList_SetItem(ret,rk,elt);
1851 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1853 std::vector<double> ret1;
1854 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1855 std::size_t sz=ret.size();
1856 PyObject *ret2=PyList_New(sz);
1857 for(std::size_t i=0;i<sz;i++)
1859 PyObject *elt=PyTuple_New(3);
1860 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1861 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1862 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1863 PyList_SetItem(ret2,i,elt);
1868 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1870 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1871 PyObject *ret2=PyList_New(ret.size());
1872 for(int i=0;i<(int)ret.size();i++)
1874 const std::vector<TypeOfField>& rett=ret[i];
1875 PyObject *ret3=PyList_New(rett.size());
1876 for(int j=0;j<(int)rett.size();j++)
1877 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1878 PyList_SetItem(ret2,i,ret3);
1883 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1885 std::vector<int> ret1;
1886 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1887 PyObject *elt=PyTuple_New(2);
1888 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1889 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1893 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1895 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1896 std::vector< std::vector<TypeOfField> > typesF;
1897 std::vector< std::vector<std::string> > pfls;
1898 std::vector< std::vector<std::string> > locs;
1899 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1901 PyObject *ret2=PyList_New(sz);
1902 for(int i=0;i<sz;i++)
1904 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1905 const std::vector<TypeOfField>& typesFI=typesF[i];
1906 const std::vector<std::string>& pflsI=pfls[i];
1907 const std::vector<std::string>& locsI=locs[i];
1908 PyObject *elt=PyTuple_New(2);
1909 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1910 int sz2=ret[i].size();
1911 PyObject *elt2=PyList_New(sz2);
1912 for(int j=0;j<sz2;j++)
1914 PyObject *elt3=PyTuple_New(4);
1915 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1916 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));
1917 PyTuple_SetItem(elt3,1,elt4);
1918 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1919 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1920 PyList_SetItem(elt2,j,elt3);
1922 PyTuple_SetItem(elt,1,elt2);
1923 PyList_SetItem(ret2,i,elt);
1928 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1930 if(PyList_Check(elts))
1932 int sz=PyList_Size(elts);
1933 std::vector<int> ret(sz);
1934 for(int i=0;i<sz;i++)
1936 PyObject *elt=PyList_GetItem(elts,i);
1937 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1943 std::vector<int> ret(1);
1944 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1949 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1951 if(PySlice_Check(elts))
1953 Py_ssize_t strt=2,stp=2,step=2;
1954 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1955 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1956 self->eraseTimeStepIds2(strt,stp,step);
1960 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1961 if(!idsToRemove.empty())
1962 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1966 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1970 std::vector<int> pos2;
1971 DataArrayInt *pos3=0;
1972 DataArrayIntTuple *pos4=0;
1973 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1978 self->eraseTimeStepIds(&pos1,&pos1+1);
1985 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1990 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1994 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1998 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2000 return self->iterator();
2003 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2005 if(elt0 && PyList_Check(elt0))
2007 int sz=PyList_Size(elt0);
2008 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2009 int *pt=da->getPointer();
2010 for(int i=0;i<sz;i++,pt++)
2012 PyObject *elt1=PyList_GetItem(elt0,i);
2013 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2015 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2017 else if(elt0 && PySlice_Check(elt0))
2019 Py_ssize_t strt=2,stp=2,step=2;
2020 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2021 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2022 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2025 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2028 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2030 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2031 return self->changeMeshNames(modifTab);
2034 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2036 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2037 std::size_t sz=ret.size();
2038 PyObject *retPy=PyList_New(sz);
2039 for(std::size_t i=0;i<sz;i++)
2040 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2044 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2046 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2047 std::size_t sz=ret.size();
2048 PyObject *retPy=PyList_New(sz);
2049 for(std::size_t i=0;i<sz;i++)
2050 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2054 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2056 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2057 std::size_t sz=ret.size();
2058 PyObject *retPy=PyList_New(sz);
2059 for(std::size_t i=0;i<sz;i++)
2060 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2064 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2066 std::vector<MEDFileAnyTypeField1TS *> tmp;
2067 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2068 self->pushBackTimeSteps(tmp);
2071 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2073 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2074 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2075 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2076 std::size_t sz=ret.size();
2077 PyObject *retPy=PyList_New(sz);
2078 for(std::size_t i=0;i<sz;i++)
2080 std::size_t sz2=ret[i].size();
2081 PyObject *ret1Py=PyList_New(sz2);
2082 for(std::size_t j=0;j<sz2;j++)
2084 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2087 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2089 PyList_SetItem(retPy,i,ret1Py);
2094 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2096 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2097 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2098 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2099 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2100 if(ret2.size()!=ret.size())
2102 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2103 throw INTERP_KERNEL::Exception(oss.str().c_str());
2105 std::size_t sz=ret.size();
2106 PyObject *retPy=PyList_New(sz);
2107 for(std::size_t i=0;i<sz;i++)
2109 std::size_t sz2=ret[i].size();
2110 PyObject *ret0Py=PyTuple_New(2);
2111 PyObject *ret1Py=PyList_New(sz2);
2112 for(std::size_t j=0;j<sz2;j++)
2114 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2117 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2119 PyTuple_SetItem(ret0Py,0,ret1Py);
2120 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2121 PyList_SetItem(retPy,i,ret0Py);
2128 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2131 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2132 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2133 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2135 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2136 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2137 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2138 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2139 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2141 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2142 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2143 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2146 MEDFileFieldMultiTS()
2148 return MEDFileFieldMultiTS::New();
2151 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2153 return MEDFileFieldMultiTS::New(fileName,loadAll);
2156 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2158 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2161 std::string __str__() const throw(INTERP_KERNEL::Exception)
2163 return self->simpleRepr();
2166 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2168 DataArrayInt *ret1=0;
2169 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2170 PyObject *ret=PyTuple_New(2);
2171 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2172 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2178 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2179 std::vector< std::vector<TypeOfField> > typesF;
2180 std::vector< std::vector<std::string> > pfls;
2181 std::vector< std::vector<std::string> > locs;
2182 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2184 PyObject *ret2=PyList_New(sz);
2185 for(int i=0;i<sz;i++)
2187 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2188 const std::vector<TypeOfField>& typesFI=typesF[i];
2189 const std::vector<std::string>& pflsI=pfls[i];
2190 const std::vector<std::string>& locsI=locs[i];
2191 PyObject *elt=PyTuple_New(2);
2192 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2193 int sz2=ret[i].size();
2194 PyObject *elt2=PyList_New(sz2);
2195 for(int j=0;j<sz2;j++)
2197 PyObject *elt3=PyTuple_New(4);
2198 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2199 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2200 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2201 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2202 PyList_SetItem(elt2,j,elt3);
2204 PyTuple_SetItem(elt,1,elt2);
2205 PyList_SetItem(ret2,i,elt);
2209 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2211 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2217 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2219 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2220 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2223 PyObject *ret=PyTuple_New(2);
2224 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2225 std::size_t sz=elt1Cpp.size();
2226 PyObject *elt=PyList_New(sz);
2227 for(std::size_t i=0;i<sz;i++)
2229 PyObject *elt1=PyTuple_New(2);
2230 PyObject *elt2=PyTuple_New(2);
2231 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2232 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2233 PyObject *elt3=PyTuple_New(2);
2234 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2235 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2236 PyTuple_SetItem(elt1,0,elt2);
2237 PyTuple_SetItem(elt1,1,elt3);
2238 PyList_SetItem(elt,i,elt1);
2240 PyTuple_SetItem(ret,1,elt);
2246 class MEDFileFieldsIterator
2251 PyObject *next() throw(INTERP_KERNEL::Exception)
2253 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2255 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2258 PyErr_SetString(PyExc_StopIteration,"No more data.");
2265 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2268 static MEDFileIntFieldMultiTS *New();
2269 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2270 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2272 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2273 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2274 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2277 MEDFileIntFieldMultiTS()
2279 return MEDFileIntFieldMultiTS::New();
2282 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2284 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2287 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2289 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2292 std::string __str__() const throw(INTERP_KERNEL::Exception)
2294 return self->simpleRepr();
2297 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2299 DataArrayInt *ret1=0;
2300 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2301 PyObject *ret=PyTuple_New(2);
2302 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2303 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2307 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2309 DataArrayInt *ret1=0;
2310 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2311 PyObject *ret=PyTuple_New(2);
2312 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2313 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2317 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2319 DataArrayInt *ret1=0;
2320 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2321 PyObject *ret=PyTuple_New(2);
2322 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2323 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2327 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2329 DataArrayInt *ret1=0;
2330 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2331 PyObject *ret=PyTuple_New(2);
2332 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2333 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2337 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2339 DataArrayInt *ret1=0;
2340 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2341 PyObject *ret=PyTuple_New(2);
2342 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2343 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2347 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2349 DataArrayInt *ret1=0;
2350 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2351 PyObject *ret=PyTuple_New(2);
2352 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2353 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2359 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2367 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2370 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2371 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2372 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2373 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2374 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2375 void loadArrays() throw(INTERP_KERNEL::Exception);
2376 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2377 void unloadArrays() throw(INTERP_KERNEL::Exception);
2378 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2379 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2380 int getNumberOfFields() const;
2381 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2382 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2384 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2385 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2386 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2387 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2388 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2389 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2390 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2391 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2392 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2397 return MEDFileFields::New();
2400 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2402 return MEDFileFields::New(fileName,loadAll);
2405 std::string __str__() const throw(INTERP_KERNEL::Exception)
2407 return self->simpleRepr();
2410 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2413 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2414 PyObject *ret=PyTuple_New(2);
2415 PyObject *ret_0=PyList_New(ret0.size());
2417 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2419 PyObject *elt=PyTuple_New(2);
2420 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2421 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2422 PyList_SetItem(ret_0,rk,elt);
2424 PyTuple_SetItem(ret,0,ret_0);
2425 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2426 PyTuple_SetItem(ret,1,ret_1);
2430 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2432 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2433 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2436 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2438 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2439 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2442 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2444 if(obj && PyList_Check(obj))
2446 int sz=PyList_Size(obj);
2447 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2448 int *pt=da->getPointer();
2449 for(int i=0;i<sz;i++,pt++)
2451 PyObject *elt1=PyList_GetItem(obj,i);
2452 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2454 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2457 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2460 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2462 self->setFieldAtPos(obj,field);
2466 int __len__() const throw(INTERP_KERNEL::Exception)
2468 return self->getNumberOfFields();
2471 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2473 return self->iterator();
2476 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2478 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2479 return self->changeMeshNames(modifTab);
2482 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2484 if(elt0 && PyInt_Check(elt0))
2486 return PyInt_AS_LONG(elt0);
2488 else if(elt0 && PyString_Check(elt0))
2489 return self->getPosFromFieldName(PyString_AsString(elt0));
2491 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2494 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2496 if(PyList_Check(elts))
2498 int sz=PyList_Size(elts);
2499 std::vector<int> ret(sz);
2500 for(int i=0;i<sz;i++)
2502 PyObject *elt=PyList_GetItem(elts,i);
2503 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2509 std::vector<int> ret(1);
2510 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2515 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2517 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2518 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2519 self->pushFields(tmp);
2522 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2524 if(elts && PySlice_Check(elts))
2526 Py_ssize_t strt=2,stp=2,step=2;
2527 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2528 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2529 self->destroyFieldsAtPos2(strt,stp,step);
2533 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2534 if(!idsToRemove.empty())
2535 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2541 class MEDFileParameter1TS : public RefCountObject
2544 void setIteration(int it);
2545 int getIteration() const;
2546 void setOrder(int order);
2547 int getOrder() const;
2548 void setTimeValue(double time);
2549 void setTime(int dt, int it, double time);
2550 double getTime(int& dt, int& it);
2551 double getTimeValue() const;
2554 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2557 void setValue(double val) throw(INTERP_KERNEL::Exception);
2558 double getValue() const throw(INTERP_KERNEL::Exception);
2559 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2562 std::string __str__() const throw(INTERP_KERNEL::Exception)
2564 return self->simpleRepr();
2569 class MEDFileParameterTinyInfo : public MEDFileWritable
2572 void setDescription(const std::string& name);
2573 std::string getDescription() const;
2574 void setTimeUnit(const std::string& unit);
2575 std::string getTimeUnit() const;
2578 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2581 static MEDFileParameterDouble1TS *New();
2582 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2583 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2584 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2585 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2586 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2587 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2588 std::string getName() const throw(INTERP_KERNEL::Exception);
2589 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2592 MEDFileParameterDouble1TS()
2594 return MEDFileParameterDouble1TS::New();
2597 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2599 return MEDFileParameterDouble1TS::New(fileName);
2602 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2604 return MEDFileParameterDouble1TS::New(fileName,paramName);
2607 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2609 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2612 std::string __str__() const throw(INTERP_KERNEL::Exception)
2614 return self->simpleRepr();
2617 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2620 bool ret0=self->isEqual(other,eps,what);
2621 PyObject *res=PyList_New(2);
2622 PyObject *ret0Py=ret0?Py_True:Py_False;
2624 PyList_SetItem(res,0,ret0Py);
2625 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2631 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2634 static MEDFileParameterMultiTS *New();
2635 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2636 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2637 std::string getName() const;
2638 void setName(const std::string& name);
2639 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2640 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2641 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2642 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2643 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2644 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2645 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2646 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2649 MEDFileParameterMultiTS()
2651 return MEDFileParameterMultiTS::New();
2654 MEDFileParameterMultiTS(const std::string& fileName)
2656 return MEDFileParameterMultiTS::New(fileName);
2659 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2661 return MEDFileParameterMultiTS::New(fileName,paramName);
2664 std::string __str__() const throw(INTERP_KERNEL::Exception)
2666 return self->simpleRepr();
2669 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2672 bool ret0=self->isEqual(other,eps,what);
2673 PyObject *res=PyList_New(2);
2674 PyObject *ret0Py=ret0?Py_True:Py_False;
2676 PyList_SetItem(res,0,ret0Py);
2677 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2681 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2685 std::vector<int> pos2;
2686 DataArrayInt *pos3=0;
2687 DataArrayIntTuple *pos4=0;
2688 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2693 self->eraseTimeStepIds(&pos1,&pos1+1);
2700 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2705 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2709 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2713 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2715 if(elt0 && PyInt_Check(elt0))
2717 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2720 else if(elt0 && PyTuple_Check(elt0))
2722 if(PyTuple_Size(elt0)==2)
2724 PyObject *o0=PyTuple_GetItem(elt0,0);
2725 PyObject *o1=PyTuple_GetItem(elt0,1);
2726 if(PyInt_Check(o0) && PyInt_Check(o1))
2728 int iter=PyInt_AS_LONG(o0);
2729 int order=PyInt_AS_LONG(o1);
2730 return self->getPosOfTimeStep(iter,order);
2733 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 !");
2736 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 !");
2738 else if(elt0 && PyFloat_Check(elt0))
2740 double val=PyFloat_AS_DOUBLE(elt0);
2741 return self->getPosGivenTime(val);
2744 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2747 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2749 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2755 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2757 if(PyList_Check(elts))
2759 int sz=PyList_Size(elts);
2760 std::vector<int> ret(sz);
2761 for(int i=0;i<sz;i++)
2763 PyObject *elt=PyList_GetItem(elts,i);
2764 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2770 std::vector<int> ret(1);
2771 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2776 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2778 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2779 if(!idsToRemove.empty())
2780 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2783 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2785 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2791 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2793 std::vector< std::pair<int,int> > res=self->getIterations();
2794 PyObject *ret=PyList_New(res.size());
2796 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2798 PyObject *elt=PyTuple_New(2);
2799 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2800 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2801 PyList_SetItem(ret,rk,elt);
2806 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2808 std::vector<double> res2;
2809 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2810 PyObject *ret=PyList_New(res.size());
2812 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2814 PyObject *elt=PyTuple_New(3);
2815 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2816 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2817 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2818 PyList_SetItem(ret,rk,elt);
2825 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2828 static MEDFileParameters *New();
2829 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2830 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2831 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2832 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2833 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2834 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2835 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2836 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2837 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2838 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2839 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2844 return MEDFileParameters::New();
2847 MEDFileParameters(const std::string& fileName)
2849 return MEDFileParameters::New(fileName);
2852 std::string __str__() const throw(INTERP_KERNEL::Exception)
2854 return self->simpleRepr();
2857 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2859 if(PyInt_Check(obj))
2861 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2866 else if(PyString_Check(obj))
2868 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2874 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2877 int __len__() const throw(INTERP_KERNEL::Exception)
2879 return self->getNumberOfParams();
2882 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2884 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2890 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2892 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2898 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2901 bool ret0=self->isEqual(other,eps,what);
2902 PyObject *res=PyList_New(2);
2903 PyObject *ret0Py=ret0?Py_True:Py_False;
2905 PyList_SetItem(res,0,ret0Py);
2906 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2912 class MEDFileData : public RefCountObject, public MEDFileWritable
2915 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2916 static MEDFileData *New();
2917 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2918 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2919 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2920 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2921 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2922 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2923 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2925 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2926 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2928 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2931 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2933 return MEDFileData::New(fileName);
2938 return MEDFileData::New();
2941 std::string __str__() const throw(INTERP_KERNEL::Exception)
2943 return self->simpleRepr();
2946 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2948 MEDFileMeshes *ret=self->getMeshes();
2954 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2956 MEDFileParameters *ret=self->getParams();
2962 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2964 MEDFileFields *ret=self->getFields();
2970 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2972 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2973 return self->changeMeshNames(modifTab);
2978 class SauvReader : public RefCountObject
2981 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2982 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2985 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2987 return SauvReader::New(fileName);
2992 class SauvWriter : public RefCountObject
2995 static SauvWriter * New();
2996 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2997 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2998 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2999 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3002 SauvWriter() throw(INTERP_KERNEL::Exception)
3004 return SauvWriter::New();
3011 class MEDFileMeshStruct;
3013 class MEDFileField1TSStructItem
3016 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3019 class MEDFileMeshStruct : public RefCountObject
3022 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3024 ~MEDFileMeshStruct();
3027 class MEDMeshMultiLev : public RefCountObject
3030 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3031 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3037 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3039 DataArrayInt *famIds(0);
3040 bool isWithoutCopy(false);
3041 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3042 PyObject *ret=PyTuple_New(2);
3043 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3045 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3046 PyTuple_SetItem(ret,1,ret1Py);
3050 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3052 DataArrayInt *numIds(0);
3053 bool isWithoutCopy(false);
3054 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3055 PyObject *ret=PyTuple_New(2);
3056 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3058 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3059 PyTuple_SetItem(ret,1,ret1Py);
3063 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3065 DataArrayInt *famIds(0);
3066 bool isWithoutCopy(false);
3067 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3068 PyObject *ret=PyTuple_New(2);
3069 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3071 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3072 PyTuple_SetItem(ret,1,ret1Py);
3076 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3078 DataArrayInt *numIds(0);
3079 bool isWithoutCopy(false);
3080 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3081 PyObject *ret=PyTuple_New(2);
3082 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3084 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3085 PyTuple_SetItem(ret,1,ret1Py);
3089 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3091 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3092 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3093 PyObject *res(PyList_New(result.size()));
3094 for(int i=0;iL!=result.end(); i++, iL++)
3095 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3101 class MEDUMeshMultiLev : public MEDMeshMultiLev
3104 ~MEDUMeshMultiLev();
3108 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3110 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3111 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3112 PyObject *ret0Py=ncc?Py_True:Py_False;
3114 PyObject *ret=PyTuple_New(7);
3115 PyTuple_SetItem(ret,0,ret0Py);
3116 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3117 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3118 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3119 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3120 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3121 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3127 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3130 ~MEDStructuredMeshMultiLev();
3133 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3136 ~MEDCMeshMultiLev();
3140 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3143 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3144 std::size_t sz(objs.size());
3145 PyObject *ret(PyTuple_New(2));
3146 PyObject *ret0=PyList_New(sz);
3147 for(std::size_t i=0;i<sz;i++)
3148 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3149 PyTuple_SetItem(ret,0,ret0);
3150 PyObject *ret1Py(isInternal?Py_True:Py_False);
3152 PyTuple_SetItem(ret,1,ret1Py);
3158 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3161 ~MEDCurveLinearMeshMultiLev();
3165 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3167 DataArrayDouble *ret0(0);
3168 std::vector<int> ret1;
3170 self->buildVTUArrays(ret0,ret1,ret2);
3171 std::size_t sz(ret1.size());
3172 PyObject *ret=PyTuple_New(3);
3173 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3174 PyObject *ret1Py=PyList_New(sz);
3175 for(std::size_t i=0;i<sz;i++)
3176 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3177 PyTuple_SetItem(ret,1,ret1Py);
3178 PyObject *ret2Py(ret2?Py_True:Py_False);
3180 PyTuple_SetItem(ret,2,ret2Py);
3186 class MEDFileFastCellSupportComparator : public RefCountObject
3189 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3190 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3191 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3192 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3194 ~MEDFileFastCellSupportComparator();
3198 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3200 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3201 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3202 PyObject *res(PyList_New(result.size()));
3203 for(int i=0;iL!=result.end(); i++, iL++)
3204 PyList_SetItem(res,i,PyInt_FromLong(*iL));