1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 %include "MEDCouplingCommon.i"
29 #include "MEDLoader.hxx"
30 #include "MEDFileMesh.hxx"
31 #include "MEDFileField.hxx"
32 #include "MEDFileParameter.hxx"
33 #include "MEDFileData.hxx"
34 #include "MEDFileMeshReadSelector.hxx"
35 #include "MEDFileFieldOverView.hxx"
36 #include "MEDLoaderTypemaps.i"
37 #include "SauvReader.hxx"
38 #include "SauvWriter.hxx"
40 using namespace ParaMEDMEM;
43 #if SWIG_VERSION >= 0x010329
44 %template() std::vector<std::string>;
47 %typemap(out) ParaMEDMEM::MEDFileMesh*
49 $result=convertMEDFileMesh($1,$owner);
52 %typemap(out) ParaMEDMEM::MEDFileParameter1TS*
54 $result=convertMEDFileParameter1TS($1,$owner);
57 %typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
59 $result=convertMEDFileFieldMultiTS($1,$owner);
62 %typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
64 $result=convertMEDFileField1TS($1,$owner);
67 %typemap(out) ParaMEDMEM::MEDMeshMultiLev*
69 $result=convertMEDMeshMultiLev($1,$owner);
72 %newobject MEDLoader::ReadUMeshFromFamilies;
73 %newobject MEDLoader::ReadUMeshFromGroups;
74 %newobject MEDLoader::ReadUMeshFromFile;
75 %newobject MEDLoader::ReadMeshFromFile;
76 %newobject MEDLoader::ReadField;
77 %newobject MEDLoader::ReadFieldCell;
78 %newobject MEDLoader::ReadFieldNode;
79 %newobject MEDLoader::ReadFieldGauss;
80 %newobject MEDLoader::ReadFieldGaussNE;
81 %newobject ParaMEDMEM::MEDFileMesh::New;
82 %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
83 %newobject ParaMEDMEM::MEDFileMesh::deepCpy;
84 %newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
85 %newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel;
86 %newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
87 %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
88 %newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
89 %newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
90 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
91 %newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
92 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
93 %newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
94 %newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
95 %newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
96 %newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
97 %newobject ParaMEDMEM::MEDFileUMesh::New;
98 %newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
99 %newobject ParaMEDMEM::MEDFileUMesh::getCoords;
100 %newobject ParaMEDMEM::MEDFileUMesh::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::MEDFileCMesh::New;
115 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
116 %newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
117 %newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
118 %newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
119 %newobject ParaMEDMEM::MEDFileMeshes::New;
120 %newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
121 %newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
122 %newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
123 %newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
124 %newobject ParaMEDMEM::MEDFileMeshes::__iter__;
126 %newobject ParaMEDMEM::MEDFileFields::New;
127 %newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
128 %newobject ParaMEDMEM::MEDFileFields::deepCpy;
129 %newobject ParaMEDMEM::MEDFileFields::shallowCpy;
130 %newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
131 %newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
132 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
133 %newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
134 %newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
135 %newobject ParaMEDMEM::MEDFileFields::__iter__;
137 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
138 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
139 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
140 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
141 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
142 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
143 %newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
144 %newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
145 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
146 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
147 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
148 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
149 %newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
150 %newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
151 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
152 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
153 %newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
155 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
156 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
157 %newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
158 %newobject ParaMEDMEM::MEDFileField1TS::New;
159 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
160 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
161 %newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
162 %newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
163 %newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
164 %newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
165 %newobject ParaMEDMEM::MEDFileIntField1TS::New;
166 %newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
167 %newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
169 %newobject ParaMEDMEM::MEDFileData::New;
170 %newobject ParaMEDMEM::MEDFileData::deepCpy;
171 %newobject ParaMEDMEM::MEDFileData::getMeshes;
172 %newobject ParaMEDMEM::MEDFileData::getFields;
173 %newobject ParaMEDMEM::MEDFileData::getParams;
175 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
176 %newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
177 %newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
178 %newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
179 %newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
180 %newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
181 %newobject ParaMEDMEM::MEDFileParameters::New;
182 %newobject ParaMEDMEM::MEDFileParameters::deepCpy;
183 %newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
184 %newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
185 %newobject ParaMEDMEM::MEDFileParameters::__getitem__;
187 %newobject ParaMEDMEM::SauvWriter::New;
188 %newobject ParaMEDMEM::SauvReader::New;
189 %newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
191 %newobject ParaMEDMEM::MEDFileMeshStruct::New;
192 %newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
193 %newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
194 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
195 %newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
197 %feature("unref") MEDFileMesh "$this->decrRef();"
198 %feature("unref") MEDFileUMesh "$this->decrRef();"
199 %feature("unref") MEDFileCMesh "$this->decrRef();"
200 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
201 %feature("unref") MEDFileMeshes "$this->decrRef();"
202 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
203 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
204 %feature("unref") MEDFileField1TS "$this->decrRef();"
205 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
206 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
207 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
208 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
209 %feature("unref") MEDFileFields "$this->decrRef();"
210 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
211 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
212 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
213 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
214 %feature("unref") MEDFileParameters "$this->decrRef();"
215 %feature("unref") MEDFileData "$this->decrRef();"
216 %feature("unref") SauvReader "$this->decrRef();"
217 %feature("unref") SauvWriter "$this->decrRef();"
218 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
219 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
220 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
221 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
222 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
223 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
228 static bool HasXDR();
229 static std::string MEDFileVersionStr();
230 static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
231 static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
232 static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
233 static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
234 static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
235 static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
236 static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
237 static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
238 static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
239 static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
240 static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
241 static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
242 static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
243 static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
244 static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
245 static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
246 static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
249 static PyObject *MEDFileVersion()
251 int major,minor,release;
252 MEDLoader::MEDFileVersion(major,minor,release);
253 PyObject *ret(PyTuple_New(3));
254 PyTuple_SetItem(ret,0,SWIG_From_int(major));
255 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
256 PyTuple_SetItem(ret,2,SWIG_From_int(release));
260 static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
262 std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
263 PyObject *ret=PyList_New(res.size());
265 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
267 PyObject *elt=PyTuple_New(2);
268 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
269 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
270 PyList_SetItem(ret,rk,elt);
275 static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
277 std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
278 PyObject *ret=PyList_New(res.size());
280 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
282 PyObject *elt=PyTuple_New(3);
283 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
284 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
285 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
286 PyList_SetItem(ret,rk,elt);
291 static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
293 std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
294 PyObject *ret=PyList_New(res.size());
296 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
298 PyObject *elt=PyTuple_New(2);
299 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
300 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
301 PyList_SetItem(ret,rk,elt);
305 static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
307 std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
308 PyObject *ret=PyList_New(res.size());
310 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
312 PyObject *elt=PyTuple_New(2);
313 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
314 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
315 PyList_SetItem(ret,rk,elt);
319 static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
321 std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
322 PyObject *ret=PyList_New(res.size());
324 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
326 PyObject *elt=PyTuple_New(2);
327 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
328 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
329 PyList_SetItem(ret,rk,elt);
333 static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
335 int meshDim,spaceDim,numberOfNodes;
336 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
337 PyObject *ret=PyTuple_New(4);
338 PyObject *elt0=PyList_New(res.size());
340 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
342 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
344 PyObject *elt1=PyList_New(obj2.size());
345 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
347 PyObject *elt2=PyTuple_New(2);
348 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
349 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
350 PyList_SetItem(elt1,j,elt2);
352 PyList_SetItem(elt0,i,elt1);
354 PyTuple_SetItem(ret,0,elt0);
355 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
356 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
357 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
360 static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
361 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
363 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
364 std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
365 return convertFieldDoubleVecToPy(res);
367 static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
369 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
370 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
371 MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
373 static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
375 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
376 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
377 MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
379 static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
381 std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
382 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
383 MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
385 static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
387 std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
389 PyObject *ret=PyList_New(size);
390 for(int i=0;i<size;i++)
391 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
394 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
396 std::vector<std::string> grps;
397 converPyListToVecString(li,grps);
398 return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
400 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
402 std::vector<std::string> fams;
403 converPyListToVecString(li,fams);
404 return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
407 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
408 static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
409 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
410 static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
411 static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
412 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);
413 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);
414 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);
415 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);
416 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);
417 static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
418 static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
419 static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
420 static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
421 static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
422 static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
427 class MEDFileWritable
430 void copyOptionsFrom(const MEDFileWritable& other) const;
431 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
432 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
433 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
434 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
437 class MEDFileMeshReadSelector
440 MEDFileMeshReadSelector();
441 MEDFileMeshReadSelector(unsigned int code);
442 unsigned int getCode() const;
443 void setCode(unsigned int newCode);
444 bool isCellFamilyFieldReading() const;
445 bool isNodeFamilyFieldReading() const;
446 bool isCellNameFieldReading() const;
447 bool isNodeNameFieldReading() const;
448 bool isCellNumFieldReading() const;
449 bool isNodeNumFieldReading() const;
450 void setCellFamilyFieldReading(bool b);
451 void setNodeFamilyFieldReading(bool b);
452 void setCellNameFieldReading(bool b);
453 void setNodeNameFieldReading(bool b);
454 void setCellNumFieldReading(bool b);
455 void setNodeNumFieldReading(bool b);
458 std::string __str__() const throw(INTERP_KERNEL::Exception)
460 std::ostringstream oss;
465 std::string __repr__() const throw(INTERP_KERNEL::Exception)
467 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
473 class MEDFileMesh : public RefCountObject, public MEDFileWritable
476 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
477 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
478 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
479 virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
480 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
481 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
482 void setName(const std::string& name);
483 std::string getName();
484 std::string getUnivName() const;
485 bool getUnivNameWrStatus() const;
486 void setUnivNameWrStatus(bool newStatus);
487 void setDescription(const std::string& name);
488 std::string getDescription() const;
489 void setOrder(int order);
490 int getOrder() const;
491 void setIteration(int it);
493 void setTimeValue(double time);
494 void setTime(int dt, int it, double time);
495 double getTimeValue() const;
496 void setTimeUnit(const std::string& unit);
497 std::string getTimeUnit() const;
498 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
499 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
500 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
501 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
502 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
503 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
504 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
505 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
506 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
507 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
508 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
509 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
511 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
512 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
513 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
514 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
515 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
516 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
517 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
518 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
519 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
520 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
521 void clearGrpMap() throw(INTERP_KERNEL::Exception);
522 void clearFamMap() throw(INTERP_KERNEL::Exception);
523 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
524 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
525 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
526 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
527 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
528 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
529 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
530 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
531 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
532 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
533 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
534 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
535 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
536 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
537 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
538 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
539 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
540 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
541 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
542 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
543 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
544 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
545 void setFamilyInfo(const std::map<std::string,int>& info);
546 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
547 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
548 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
549 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
550 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
551 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
552 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
553 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
554 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
555 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
556 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
557 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
558 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
559 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
560 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
561 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
562 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
563 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
564 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
565 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
566 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
568 virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
569 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
570 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
571 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
572 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
573 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
574 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
575 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
576 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
577 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
578 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
579 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
582 std::string __str__() const throw(INTERP_KERNEL::Exception)
584 return self->simpleRepr();
587 PyObject *getTime() throw(INTERP_KERNEL::Exception)
590 double tmp0=self->getTime(tmp1,tmp2);
591 PyObject *res = PyList_New(3);
592 PyList_SetItem(res,0,SWIG_From_int(tmp1));
593 PyList_SetItem(res,1,SWIG_From_int(tmp2));
594 PyList_SetItem(res,2,SWIG_From_double(tmp0));
598 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
601 bool ret0=self->isEqual(other,eps,what);
602 PyObject *res=PyList_New(2);
603 PyObject *ret0Py=ret0?Py_True:Py_False;
605 PyList_SetItem(res,0,ret0Py);
606 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
610 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
613 bool ret0=self->areFamsEqual(other,what);
614 PyObject *res=PyList_New(2);
615 PyObject *ret0Py=ret0?Py_True:Py_False;
617 PyList_SetItem(res,0,ret0Py);
618 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
622 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
625 bool ret0=self->areGrpsEqual(other,what);
626 PyObject *res=PyList_New(2);
627 PyObject *ret0Py=ret0?Py_True:Py_False;
629 PyList_SetItem(res,0,ret0Py);
630 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
634 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
636 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
637 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
638 PyObject *res=PyList_New(result.size());
639 for(int i=0;iL!=result.end(); i++, iL++)
640 PyList_SetItem(res,i,PyInt_FromLong(*iL));
644 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
646 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
647 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
648 PyObject *res=PyList_New(result.size());
649 for(int i=0;iL!=result.end(); i++, iL++)
650 PyList_SetItem(res,i,PyInt_FromLong(*iL));
654 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
656 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
659 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
662 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
664 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
667 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
670 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
672 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
675 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
678 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
681 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
682 PyObject *ret=PyTuple_New(2);
683 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
684 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
688 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
690 DataArrayInt *ret3=0;
691 std::vector<int> ret1,ret2;
692 bool ret0=self->unPolyze(ret1,ret2,ret3);
693 PyObject *ret=PyTuple_New(4);
694 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
696 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
697 for(int j=0;j<(int)ret1.size()/3;j++)
699 PyObject *retLev2=PyList_New(3);
700 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
701 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
702 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
703 PyList_SetItem(retLev1_0,j,retLev2);
705 PyTuple_SetItem(ret,1,retLev1_0);
707 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
708 for(int j=0;j<(int)ret2.size()/3;j++)
710 PyObject *retLev2=PyList_New(3);
711 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
712 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
713 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
714 PyList_SetItem(retLev1_1,j,retLev2);
716 PyTuple_SetItem(ret,2,retLev1_1);
718 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
724 class MEDFileUMesh : public MEDFileMesh
727 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
728 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
729 static MEDFileUMesh *New();
731 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
732 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
734 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
735 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
736 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
737 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
738 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
739 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
740 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
741 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
742 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
743 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
744 DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
745 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
746 DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
747 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
748 DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
749 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
750 DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
751 DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
752 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
753 DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
754 DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
755 MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception);
756 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
757 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
758 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
759 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
760 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
762 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
763 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
764 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
765 void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
766 void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
767 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
768 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
769 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
770 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
771 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
772 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
773 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
776 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
778 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
781 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
783 return MEDFileUMesh::New(fileName,mrs);
788 return MEDFileUMesh::New();
791 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)
793 std::vector<int> typesCpp1;
794 convertPyToNewIntArr3(types,typesCpp1);
795 std::size_t sz(typesCpp1.size());
796 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
797 for(std::size_t ii=0;ii<sz;ii++)
798 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
799 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
802 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
804 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
807 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
810 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
812 std::vector<const DataArrayInt *> grps;
813 convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
814 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
817 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
819 std::vector<const MEDCouplingUMesh *> ms;
820 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
821 self->setMeshes(ms,renum);
824 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
826 std::vector<const MEDCouplingUMesh *> ms;
827 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
828 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
831 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
833 std::vector<const MEDCouplingUMesh *> ms;
834 convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
835 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
838 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
840 DataArrayDouble *ret=self->getCoords();
846 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
848 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
851 return const_cast<PartDefinition *>(ret);
854 PyObject *duplicateNodesOnM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
856 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
857 self->duplicateNodesOnM1Group(grpNameM1,ret0,ret1,ret2);
858 PyObject *ret=PyTuple_New(3);
859 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
860 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
861 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
865 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
867 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
873 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
875 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
876 std::size_t sz(tmp.size());
877 PyObject *ret=PyList_New(sz);
878 for(std::size_t i=0;i<sz;i++)
882 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
889 class MEDFileStructuredMesh : public MEDFileMesh
894 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
896 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
904 class MEDFileCMesh : public MEDFileStructuredMesh
907 static MEDFileCMesh *New();
908 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
909 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
910 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
911 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
916 return MEDFileCMesh::New();
919 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
921 return MEDFileCMesh::New(fileName,mrs);
924 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
926 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
929 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
931 const MEDCouplingCMesh *tmp=self->getMesh();
934 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
939 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
942 static MEDFileCurveLinearMesh *New();
943 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
944 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
945 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
948 MEDFileCurveLinearMesh()
950 return MEDFileCurveLinearMesh::New();
953 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
955 return MEDFileCurveLinearMesh::New(fileName,mrs);
958 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
960 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
963 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
965 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
968 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
973 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
976 static MEDFileMeshMultiTS *New();
977 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
978 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
979 MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
980 std::string getName() const throw(INTERP_KERNEL::Exception);
981 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
982 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
987 return MEDFileMeshMultiTS::New();
990 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
992 return MEDFileMeshMultiTS::New(fileName);
995 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
997 return MEDFileMeshMultiTS::New(fileName,mName);
1000 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1002 MEDFileMesh *ret=self->getOneTimeStep();
1010 class MEDFileMeshesIterator
1015 PyObject *next() throw(INTERP_KERNEL::Exception)
1017 MEDFileMesh *ret=self->nextt();
1021 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1025 PyErr_SetString(PyExc_StopIteration,"No more data.");
1032 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1035 static MEDFileMeshes *New();
1036 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1037 MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
1038 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1039 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1040 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1042 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1043 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1044 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1045 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1050 return MEDFileMeshes::New();
1053 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1055 return MEDFileMeshes::New(fileName);
1058 std::string __str__() const throw(INTERP_KERNEL::Exception)
1060 return self->simpleRepr();
1063 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1065 if(PyInt_Check(obj))
1067 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1072 else if(PyString_Check(obj))
1074 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1080 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1083 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1085 self->setMeshAtPos(obj,mesh);
1089 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1091 return self->iterator();
1094 int __len__() const throw(INTERP_KERNEL::Exception)
1096 return self->getNumberOfMeshes();
1099 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1101 MEDFileMesh *ret=self->getMeshAtPos(i);
1106 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1108 MEDFileMesh *ret=self->getMeshWithName(mname);
1116 class MEDFileFieldLoc : public RefCountObject
1119 std::string getName() const;
1120 int getDimension() const;
1121 int getNumberOfGaussPoints() const;
1122 int getNumberOfPointsInCells() const;
1123 const std::vector<double>& getRefCoords() const;
1124 const std::vector<double>& getGaussCoords() const;
1125 const std::vector<double>& getGaussWeights() const;
1126 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1129 std::string __str__() const throw(INTERP_KERNEL::Exception)
1131 return self->repr();
1136 class MEDFileFieldGlobsReal
1139 void resetContent();
1140 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1141 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1142 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1143 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1144 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1145 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1146 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1147 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1148 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1149 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1150 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1151 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1152 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1153 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1154 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1155 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1156 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1157 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1158 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1159 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1160 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1161 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1162 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1163 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1164 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1165 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1168 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1170 const DataArrayInt *ret=self->getProfile(pflName);
1173 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1176 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1178 const DataArrayInt *ret=self->getProfileFromId(pflId);
1181 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1184 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1186 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1189 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1192 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1194 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1197 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1200 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1202 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1203 return convertVecPairVecStToPy(ret);
1206 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1208 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1209 return convertVecPairVecStToPy(ret);
1212 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1214 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1215 self->changePflsNames(v);
1218 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1220 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1221 self->changePflsRefsNamesGen(v);
1224 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1226 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1227 self->changePflsNamesInStruct(v);
1230 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1232 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1233 self->changeLocsNames(v);
1236 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1238 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1239 self->changeLocsRefsNamesGen(v);
1242 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1244 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1245 self->changeLocsNamesInStruct(v);
1248 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1250 std::ostringstream oss;
1251 self->simpleReprGlobs(oss);
1257 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1260 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1261 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1262 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1263 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1264 void loadArrays() throw(INTERP_KERNEL::Exception);
1265 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1266 void unloadArrays() throw(INTERP_KERNEL::Exception);
1267 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1268 int getDimension() const throw(INTERP_KERNEL::Exception);
1269 int getIteration() const throw(INTERP_KERNEL::Exception);
1270 int getOrder() const throw(INTERP_KERNEL::Exception);
1271 std::string getName() throw(INTERP_KERNEL::Exception);
1272 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1273 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1274 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1275 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1276 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1277 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1278 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1279 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1280 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1281 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1282 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1283 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1284 MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
1285 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1286 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1289 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1292 double tmp0=self->getTime(tmp1,tmp2);
1293 PyObject *res = PyList_New(3);
1294 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1295 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1296 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1300 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1302 std::pair<int,int> res=self->getDtIt();
1303 PyObject *elt=PyTuple_New(2);
1304 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1305 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1309 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1311 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1314 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1316 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1319 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1321 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1322 return self->changeMeshNames(modifTab);
1325 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1327 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1328 PyObject *ret2=PyList_New(ret.size());
1329 for(int i=0;i<(int)ret.size();i++)
1330 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1334 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1336 std::vector<int> ret1;
1337 int ret0=self->getNonEmptyLevels(mname,ret1);
1338 PyObject *elt=PyTuple_New(2);
1339 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1340 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1344 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1346 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1347 std::vector< std::vector<TypeOfField> > typesF;
1348 std::vector< std::vector<std::string> > pfls;
1349 std::vector< std::vector<std::string> > locs;
1350 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1352 PyObject *ret2=PyList_New(sz);
1353 for(int i=0;i<sz;i++)
1355 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1356 const std::vector<TypeOfField>& typesFI=typesF[i];
1357 const std::vector<std::string>& pflsI=pfls[i];
1358 const std::vector<std::string>& locsI=locs[i];
1359 PyObject *elt=PyTuple_New(2);
1360 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1361 int sz2=ret[i].size();
1362 PyObject *elt2=PyList_New(sz2);
1363 for(int j=0;j<sz2;j++)
1365 PyObject *elt3=PyTuple_New(4);
1366 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1367 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));
1368 PyTuple_SetItem(elt3,1,elt4);
1369 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1370 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1371 PyList_SetItem(elt2,j,elt3);
1373 PyTuple_SetItem(elt,1,elt2);
1374 PyList_SetItem(ret2,i,elt);
1379 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1381 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1382 std::size_t sz=ret.size();
1383 PyObject *retPy=PyList_New(sz);
1384 for(std::size_t i=0;i<sz;i++)
1385 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1389 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1391 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1392 std::size_t sz=ret.size();
1393 PyObject *retPy=PyList_New(sz);
1394 for(std::size_t i=0;i<sz;i++)
1395 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1399 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1401 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1402 std::size_t sz=ret.size();
1403 PyObject *retPy=PyList_New(sz);
1404 for(std::size_t i=0;i<sz;i++)
1405 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1411 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1414 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1415 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1416 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1417 static MEDFileField1TS *New();
1418 ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1419 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1420 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1421 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1422 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1423 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1425 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1426 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1427 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1428 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1431 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1433 return MEDFileField1TS::New(fileName,loadAll);
1436 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1438 return MEDFileField1TS::New(fileName,fieldName,loadAll);
1441 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1443 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
1448 return MEDFileField1TS::New();
1451 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
1453 const DataArrayDouble *arr=0;
1455 arr=field->getArray();
1456 self->copyTinyInfoFrom(field,arr);
1459 std::string __str__() const throw(INTERP_KERNEL::Exception)
1461 return self->simpleRepr();
1464 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1466 DataArrayInt *ret1=0;
1467 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1468 PyObject *ret=PyTuple_New(2);
1469 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1470 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1474 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1476 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1477 std::vector< std::vector<TypeOfField> > typesF;
1478 std::vector< std::vector<std::string> > pfls;
1479 std::vector< std::vector<std::string> > locs;
1480 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
1482 PyObject *ret2=PyList_New(sz);
1483 for(int i=0;i<sz;i++)
1485 const std::vector<DataArrayDouble *>& dadsI=ret[i];
1486 const std::vector<TypeOfField>& typesFI=typesF[i];
1487 const std::vector<std::string>& pflsI=pfls[i];
1488 const std::vector<std::string>& locsI=locs[i];
1489 PyObject *elt=PyTuple_New(2);
1490 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1491 int sz2=ret[i].size();
1492 PyObject *elt2=PyList_New(sz2);
1493 for(int j=0;j<sz2;j++)
1495 PyObject *elt3=PyTuple_New(4);
1496 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1497 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1498 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1499 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1500 PyList_SetItem(elt2,j,elt3);
1502 PyTuple_SetItem(elt,1,elt2);
1503 PyList_SetItem(ret2,i,elt);
1508 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1510 DataArrayDouble *ret=self->getUndergroundDataArray();
1516 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
1518 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
1519 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
1522 PyObject *ret=PyTuple_New(2);
1523 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1524 std::size_t sz=elt1Cpp.size();
1525 PyObject *elt=PyList_New(sz);
1526 for(std::size_t i=0;i<sz;i++)
1528 PyObject *elt1=PyTuple_New(2);
1529 PyObject *elt2=PyTuple_New(2);
1530 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
1531 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
1532 PyObject *elt3=PyTuple_New(2);
1533 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
1534 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
1535 PyTuple_SetItem(elt1,0,elt2);
1536 PyTuple_SetItem(elt1,1,elt3);
1537 PyList_SetItem(elt,i,elt1);
1539 PyTuple_SetItem(ret,1,elt);
1545 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
1548 static MEDFileIntField1TS *New();
1549 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1550 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1551 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1552 ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1554 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
1555 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1558 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
1560 return MEDFileIntField1TS::New();
1563 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1565 return MEDFileIntField1TS::New(fileName,loadAll);
1568 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1570 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
1573 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
1575 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
1578 std::string __str__() const throw(INTERP_KERNEL::Exception)
1580 return self->simpleRepr();
1583 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1585 DataArrayInt *ret1=0;
1586 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
1587 PyObject *ret=PyTuple_New(2);
1588 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1589 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1593 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1595 DataArrayInt *ret1=0;
1596 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
1597 PyObject *ret=PyTuple_New(2);
1598 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1599 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1603 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1605 DataArrayInt *ret1=0;
1606 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
1607 PyObject *ret=PyTuple_New(2);
1608 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1609 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1613 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1615 DataArrayInt *ret1=0;
1616 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
1617 PyObject *ret=PyTuple_New(2);
1618 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1619 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1623 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
1625 DataArrayInt *ret1=0;
1626 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
1627 PyObject *ret=PyTuple_New(2);
1628 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
1629 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1633 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
1635 DataArrayInt *ret1=0;
1636 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
1637 PyObject *ret=PyTuple_New(2);
1638 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1639 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1643 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
1645 DataArrayInt *ret=self->getUndergroundDataArray();
1653 class MEDFileAnyTypeFieldMultiTSIterator
1658 PyObject *next() throw(INTERP_KERNEL::Exception)
1660 MEDFileAnyTypeField1TS *ret=self->nextt();
1662 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
1665 PyErr_SetString(PyExc_StopIteration,"No more data.");
1672 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1675 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1676 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1677 MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
1678 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1679 std::string getName() const throw(INTERP_KERNEL::Exception);
1680 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1681 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1682 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1683 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
1684 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1685 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1686 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1687 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1688 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
1689 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
1690 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1691 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1692 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1693 void loadArrays() throw(INTERP_KERNEL::Exception);
1694 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1695 void unloadArrays() throw(INTERP_KERNEL::Exception);
1696 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1698 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
1699 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1700 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
1701 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
1702 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
1705 int __len__() const throw(INTERP_KERNEL::Exception)
1707 return self->getNumberOfTS();
1710 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1712 if(elt0 && PyInt_Check(elt0))
1714 int pos=PyInt_AS_LONG(elt0);
1717 else if(elt0 && PyTuple_Check(elt0))
1719 if(PyTuple_Size(elt0)==2)
1721 PyObject *o0=PyTuple_GetItem(elt0,0);
1722 PyObject *o1=PyTuple_GetItem(elt0,1);
1723 if(PyInt_Check(o0) && PyInt_Check(o1))
1725 int iter=PyInt_AS_LONG(o0);
1726 int order=PyInt_AS_LONG(o1);
1727 return self->getPosOfTimeStep(iter,order);
1730 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 !");
1733 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 !");
1735 else if(elt0 && PyFloat_Check(elt0))
1737 double val=PyFloat_AS_DOUBLE(elt0);
1738 return self->getPosGivenTime(val);
1741 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
1744 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
1746 std::vector< std::pair<int,int> > res=self->getIterations();
1747 PyObject *ret=PyList_New(res.size());
1749 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
1751 PyObject *elt=PyTuple_New(2);
1752 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
1753 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
1754 PyList_SetItem(ret,rk,elt);
1759 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
1761 std::vector<double> ret1;
1762 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
1763 std::size_t sz=ret.size();
1764 PyObject *ret2=PyList_New(sz);
1765 for(std::size_t i=0;i<sz;i++)
1767 PyObject *elt=PyTuple_New(3);
1768 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
1769 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
1770 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
1771 PyList_SetItem(ret2,i,elt);
1776 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1778 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
1779 PyObject *ret2=PyList_New(ret.size());
1780 for(int i=0;i<(int)ret.size();i++)
1782 const std::vector<TypeOfField>& rett=ret[i];
1783 PyObject *ret3=PyList_New(rett.size());
1784 for(int j=0;j<(int)rett.size();j++)
1785 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
1786 PyList_SetItem(ret2,i,ret3);
1791 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1793 std::vector<int> ret1;
1794 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
1795 PyObject *elt=PyTuple_New(2);
1796 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1797 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1801 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1803 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1804 std::vector< std::vector<TypeOfField> > typesF;
1805 std::vector< std::vector<std::string> > pfls;
1806 std::vector< std::vector<std::string> > locs;
1807 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
1809 PyObject *ret2=PyList_New(sz);
1810 for(int i=0;i<sz;i++)
1812 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1813 const std::vector<TypeOfField>& typesFI=typesF[i];
1814 const std::vector<std::string>& pflsI=pfls[i];
1815 const std::vector<std::string>& locsI=locs[i];
1816 PyObject *elt=PyTuple_New(2);
1817 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1818 int sz2=ret[i].size();
1819 PyObject *elt2=PyList_New(sz2);
1820 for(int j=0;j<sz2;j++)
1822 PyObject *elt3=PyTuple_New(4);
1823 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1824 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));
1825 PyTuple_SetItem(elt3,1,elt4);
1826 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1827 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1828 PyList_SetItem(elt2,j,elt3);
1830 PyTuple_SetItem(elt,1,elt2);
1831 PyList_SetItem(ret2,i,elt);
1836 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
1838 if(PyList_Check(elts))
1840 int sz=PyList_Size(elts);
1841 std::vector<int> ret(sz);
1842 for(int i=0;i<sz;i++)
1844 PyObject *elt=PyList_GetItem(elts,i);
1845 ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
1851 std::vector<int> ret(1);
1852 ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
1857 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
1859 if(PySlice_Check(elts))
1861 Py_ssize_t strt=2,stp=2,step=2;
1862 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
1863 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
1864 self->eraseTimeStepIds2(strt,stp,step);
1868 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
1869 if(!idsToRemove.empty())
1870 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
1874 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
1878 std::vector<int> pos2;
1879 DataArrayInt *pos3=0;
1880 DataArrayIntTuple *pos4=0;
1881 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
1886 self->eraseTimeStepIds(&pos1,&pos1+1);
1893 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
1898 self->eraseTimeStepIds(pos3->begin(),pos3->end());
1902 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
1906 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
1908 return self->iterator();
1911 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
1913 if(elt0 && PyList_Check(elt0))
1915 int sz=PyList_Size(elt0);
1916 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
1917 int *pt=da->getPointer();
1918 for(int i=0;i<sz;i++,pt++)
1920 PyObject *elt1=PyList_GetItem(elt0,i);
1921 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
1923 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
1925 else if(elt0 && PySlice_Check(elt0))
1927 Py_ssize_t strt=2,stp=2,step=2;
1928 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
1929 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
1930 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
1933 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
1936 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1938 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1939 return self->changeMeshNames(modifTab);
1942 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1944 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
1945 std::size_t sz=ret.size();
1946 PyObject *retPy=PyList_New(sz);
1947 for(std::size_t i=0;i<sz;i++)
1948 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1952 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1954 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
1955 std::size_t sz=ret.size();
1956 PyObject *retPy=PyList_New(sz);
1957 for(std::size_t i=0;i<sz;i++)
1958 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1962 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1964 std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
1965 std::size_t sz=ret.size();
1966 PyObject *retPy=PyList_New(sz);
1967 for(std::size_t i=0;i<sz;i++)
1968 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1972 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
1974 std::vector<MEDFileAnyTypeField1TS *> tmp;
1975 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
1976 self->pushBackTimeSteps(tmp);
1979 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
1981 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
1982 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
1983 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
1984 std::size_t sz=ret.size();
1985 PyObject *retPy=PyList_New(sz);
1986 for(std::size_t i=0;i<sz;i++)
1988 std::size_t sz2=ret[i].size();
1989 PyObject *ret1Py=PyList_New(sz2);
1990 for(std::size_t j=0;j<sz2;j++)
1992 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
1995 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
1997 PyList_SetItem(retPy,i,ret1Py);
2002 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2004 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2005 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2006 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
2007 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2008 if(ret2.size()!=ret.size())
2010 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2011 throw INTERP_KERNEL::Exception(oss.str().c_str());
2013 std::size_t sz=ret.size();
2014 PyObject *retPy=PyList_New(sz);
2015 for(std::size_t i=0;i<sz;i++)
2017 std::size_t sz2=ret[i].size();
2018 PyObject *ret0Py=PyTuple_New(2);
2019 PyObject *ret1Py=PyList_New(sz2);
2020 for(std::size_t j=0;j<sz2;j++)
2022 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2025 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2027 PyTuple_SetItem(ret0Py,0,ret1Py);
2028 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2029 PyList_SetItem(retPy,i,ret0Py);
2036 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2039 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2040 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2041 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2043 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2044 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2045 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2046 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2047 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2049 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2050 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2051 ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2054 MEDFileFieldMultiTS()
2056 return MEDFileFieldMultiTS::New();
2059 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2061 return MEDFileFieldMultiTS::New(fileName,loadAll);
2064 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2066 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2069 std::string __str__() const throw(INTERP_KERNEL::Exception)
2071 return self->simpleRepr();
2074 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2076 DataArrayInt *ret1=0;
2077 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2078 PyObject *ret=PyTuple_New(2);
2079 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2080 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2084 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2086 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2087 std::vector< std::vector<TypeOfField> > typesF;
2088 std::vector< std::vector<std::string> > pfls;
2089 std::vector< std::vector<std::string> > locs;
2090 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2092 PyObject *ret2=PyList_New(sz);
2093 for(int i=0;i<sz;i++)
2095 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2096 const std::vector<TypeOfField>& typesFI=typesF[i];
2097 const std::vector<std::string>& pflsI=pfls[i];
2098 const std::vector<std::string>& locsI=locs[i];
2099 PyObject *elt=PyTuple_New(2);
2100 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2101 int sz2=ret[i].size();
2102 PyObject *elt2=PyList_New(sz2);
2103 for(int j=0;j<sz2;j++)
2105 PyObject *elt3=PyTuple_New(4);
2106 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2107 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2108 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2109 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2110 PyList_SetItem(elt2,j,elt3);
2112 PyTuple_SetItem(elt,1,elt2);
2113 PyList_SetItem(ret2,i,elt);
2117 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2119 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2125 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2127 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2128 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2131 PyObject *ret=PyTuple_New(2);
2132 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2133 std::size_t sz=elt1Cpp.size();
2134 PyObject *elt=PyList_New(sz);
2135 for(std::size_t i=0;i<sz;i++)
2137 PyObject *elt1=PyTuple_New(2);
2138 PyObject *elt2=PyTuple_New(2);
2139 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2140 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2141 PyObject *elt3=PyTuple_New(2);
2142 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2143 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2144 PyTuple_SetItem(elt1,0,elt2);
2145 PyTuple_SetItem(elt1,1,elt3);
2146 PyList_SetItem(elt,i,elt1);
2148 PyTuple_SetItem(ret,1,elt);
2154 class MEDFileFieldsIterator
2159 PyObject *next() throw(INTERP_KERNEL::Exception)
2161 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2163 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2166 PyErr_SetString(PyExc_StopIteration,"No more data.");
2173 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2176 static MEDFileIntFieldMultiTS *New();
2177 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2178 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2180 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2181 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2182 ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2185 MEDFileIntFieldMultiTS()
2187 return MEDFileIntFieldMultiTS::New();
2190 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2192 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2195 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2197 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2200 std::string __str__() const throw(INTERP_KERNEL::Exception)
2202 return self->simpleRepr();
2205 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2207 DataArrayInt *ret1=0;
2208 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2209 PyObject *ret=PyTuple_New(2);
2210 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2211 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2215 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2217 DataArrayInt *ret1=0;
2218 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2219 PyObject *ret=PyTuple_New(2);
2220 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2221 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2225 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2227 DataArrayInt *ret1=0;
2228 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2229 PyObject *ret=PyTuple_New(2);
2230 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2231 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2235 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2237 DataArrayInt *ret1=0;
2238 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2239 PyObject *ret=PyTuple_New(2);
2240 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2241 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2245 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2247 DataArrayInt *ret1=0;
2248 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2249 PyObject *ret=PyTuple_New(2);
2250 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2251 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2255 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2257 DataArrayInt *ret1=0;
2258 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2259 PyObject *ret=PyTuple_New(2);
2260 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2261 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2265 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2267 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2275 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2278 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2279 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2280 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2281 MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
2282 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2283 void loadArrays() throw(INTERP_KERNEL::Exception);
2284 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2285 void unloadArrays() throw(INTERP_KERNEL::Exception);
2286 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2287 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2288 int getNumberOfFields() const;
2289 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2290 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2292 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2293 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2294 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2295 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2296 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2297 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2298 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2299 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2300 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2305 return MEDFileFields::New();
2308 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2310 return MEDFileFields::New(fileName,loadAll);
2313 std::string __str__() const throw(INTERP_KERNEL::Exception)
2315 return self->simpleRepr();
2318 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2321 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2322 PyObject *ret=PyTuple_New(2);
2323 PyObject *ret_0=PyList_New(ret0.size());
2325 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2327 PyObject *elt=PyTuple_New(2);
2328 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2329 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2330 PyList_SetItem(ret_0,rk,elt);
2332 PyTuple_SetItem(ret,0,ret_0);
2333 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2334 PyTuple_SetItem(ret,1,ret_1);
2338 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2340 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2341 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2344 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2346 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2347 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2350 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2352 if(obj && PyList_Check(obj))
2354 int sz=PyList_Size(obj);
2355 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2356 int *pt=da->getPointer();
2357 for(int i=0;i<sz;i++,pt++)
2359 PyObject *elt1=PyList_GetItem(obj,i);
2360 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2362 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
2365 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2368 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2370 self->setFieldAtPos(obj,field);
2374 int __len__() const throw(INTERP_KERNEL::Exception)
2376 return self->getNumberOfFields();
2379 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2381 return self->iterator();
2384 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2386 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2387 return self->changeMeshNames(modifTab);
2390 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2392 if(elt0 && PyInt_Check(elt0))
2394 return PyInt_AS_LONG(elt0);
2396 else if(elt0 && PyString_Check(elt0))
2397 return self->getPosFromFieldName(PyString_AsString(elt0));
2399 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2402 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2404 if(PyList_Check(elts))
2406 int sz=PyList_Size(elts);
2407 std::vector<int> ret(sz);
2408 for(int i=0;i<sz;i++)
2410 PyObject *elt=PyList_GetItem(elts,i);
2411 ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
2417 std::vector<int> ret(1);
2418 ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
2423 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2425 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2426 convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2427 self->pushFields(tmp);
2430 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2432 if(elts && PySlice_Check(elts))
2434 Py_ssize_t strt=2,stp=2,step=2;
2435 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2436 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2437 self->destroyFieldsAtPos2(strt,stp,step);
2441 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
2442 if(!idsToRemove.empty())
2443 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2449 class MEDFileParameter1TS : public RefCountObject
2452 void setIteration(int it);
2453 int getIteration() const;
2454 void setOrder(int order);
2455 int getOrder() const;
2456 void setTimeValue(double time);
2457 void setTime(int dt, int it, double time);
2458 double getTime(int& dt, int& it);
2459 double getTimeValue() const;
2462 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
2465 void setValue(double val) throw(INTERP_KERNEL::Exception);
2466 double getValue() const throw(INTERP_KERNEL::Exception);
2467 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2470 std::string __str__() const throw(INTERP_KERNEL::Exception)
2472 return self->simpleRepr();
2477 class MEDFileParameterTinyInfo : public MEDFileWritable
2480 void setDescription(const std::string& name);
2481 std::string getDescription() const;
2482 void setTimeUnit(const std::string& unit);
2483 std::string getTimeUnit() const;
2486 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
2489 static MEDFileParameterDouble1TS *New();
2490 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2491 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2492 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
2493 virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
2494 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2495 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2496 std::string getName() const throw(INTERP_KERNEL::Exception);
2497 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2500 MEDFileParameterDouble1TS()
2502 return MEDFileParameterDouble1TS::New();
2505 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2507 return MEDFileParameterDouble1TS::New(fileName);
2510 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
2512 return MEDFileParameterDouble1TS::New(fileName,paramName);
2515 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
2517 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
2520 std::string __str__() const throw(INTERP_KERNEL::Exception)
2522 return self->simpleRepr();
2525 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
2528 bool ret0=self->isEqual(other,eps,what);
2529 PyObject *res=PyList_New(2);
2530 PyObject *ret0Py=ret0?Py_True:Py_False;
2532 PyList_SetItem(res,0,ret0Py);
2533 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2539 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
2542 static MEDFileParameterMultiTS *New();
2543 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2544 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
2545 std::string getName() const;
2546 void setName(const std::string& name);
2547 MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
2548 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2549 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2550 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
2551 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2552 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2553 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2554 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2557 MEDFileParameterMultiTS()
2559 return MEDFileParameterMultiTS::New();
2562 MEDFileParameterMultiTS(const std::string& fileName)
2564 return MEDFileParameterMultiTS::New(fileName);
2567 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
2569 return MEDFileParameterMultiTS::New(fileName,paramName);
2572 std::string __str__() const throw(INTERP_KERNEL::Exception)
2574 return self->simpleRepr();
2577 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
2580 bool ret0=self->isEqual(other,eps,what);
2581 PyObject *res=PyList_New(2);
2582 PyObject *ret0Py=ret0?Py_True:Py_False;
2584 PyList_SetItem(res,0,ret0Py);
2585 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2589 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
2593 std::vector<int> pos2;
2594 DataArrayInt *pos3=0;
2595 DataArrayIntTuple *pos4=0;
2596 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
2601 self->eraseTimeStepIds(&pos1,&pos1+1);
2608 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2613 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2617 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2621 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2623 if(elt0 && PyInt_Check(elt0))
2625 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
2628 else if(elt0 && PyTuple_Check(elt0))
2630 if(PyTuple_Size(elt0)==2)
2632 PyObject *o0=PyTuple_GetItem(elt0,0);
2633 PyObject *o1=PyTuple_GetItem(elt0,1);
2634 if(PyInt_Check(o0) && PyInt_Check(o1))
2636 int iter=PyInt_AS_LONG(o0);
2637 int order=PyInt_AS_LONG(o1);
2638 return self->getPosOfTimeStep(iter,order);
2641 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 !");
2644 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 !");
2646 else if(elt0 && PyFloat_Check(elt0))
2648 double val=PyFloat_AS_DOUBLE(elt0);
2649 return self->getPosGivenTime(val);
2652 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2655 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2657 MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
2663 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2665 if(PyList_Check(elts))
2667 int sz=PyList_Size(elts);
2668 std::vector<int> ret(sz);
2669 for(int i=0;i<sz;i++)
2671 PyObject *elt=PyList_GetItem(elts,i);
2672 ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
2678 std::vector<int> ret(1);
2679 ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
2684 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2686 std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
2687 if(!idsToRemove.empty())
2688 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2691 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
2693 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
2699 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2701 std::vector< std::pair<int,int> > res=self->getIterations();
2702 PyObject *ret=PyList_New(res.size());
2704 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2706 PyObject *elt=PyTuple_New(2);
2707 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2708 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2709 PyList_SetItem(ret,rk,elt);
2714 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2716 std::vector<double> res2;
2717 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
2718 PyObject *ret=PyList_New(res.size());
2720 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2722 PyObject *elt=PyTuple_New(3);
2723 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2724 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2725 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
2726 PyList_SetItem(ret,rk,elt);
2733 class MEDFileParameters : public RefCountObject, public MEDFileWritable
2736 static MEDFileParameters *New();
2737 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2738 MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
2739 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2740 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
2741 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
2742 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2743 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2744 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
2745 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
2746 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
2747 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2752 return MEDFileParameters::New();
2755 MEDFileParameters(const std::string& fileName)
2757 return MEDFileParameters::New(fileName);
2760 std::string __str__() const throw(INTERP_KERNEL::Exception)
2762 return self->simpleRepr();
2765 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2767 if(PyInt_Check(obj))
2769 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
2774 else if(PyString_Check(obj))
2776 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
2782 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
2785 int __len__() const throw(INTERP_KERNEL::Exception)
2787 return self->getNumberOfParams();
2790 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
2792 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
2798 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
2800 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
2806 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
2809 bool ret0=self->isEqual(other,eps,what);
2810 PyObject *res=PyList_New(2);
2811 PyObject *ret0Py=ret0?Py_True:Py_False;
2813 PyList_SetItem(res,0,ret0Py);
2814 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
2820 class MEDFileData : public RefCountObject, public MEDFileWritable
2823 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2824 static MEDFileData *New();
2825 MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
2826 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
2827 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
2828 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
2829 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
2830 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
2831 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
2833 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2834 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
2836 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2839 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2841 return MEDFileData::New(fileName);
2846 return MEDFileData::New();
2849 std::string __str__() const throw(INTERP_KERNEL::Exception)
2851 return self->simpleRepr();
2854 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
2856 MEDFileMeshes *ret=self->getMeshes();
2862 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
2864 MEDFileParameters *ret=self->getParams();
2870 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
2872 MEDFileFields *ret=self->getFields();
2878 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2880 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2881 return self->changeMeshNames(modifTab);
2886 class SauvReader : public RefCountObject
2889 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2890 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
2893 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
2895 return SauvReader::New(fileName);
2900 class SauvWriter : public RefCountObject
2903 static SauvWriter * New();
2904 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
2905 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
2906 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
2907 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
2910 SauvWriter() throw(INTERP_KERNEL::Exception)
2912 return SauvWriter::New();
2919 class MEDFileMeshStruct;
2921 class MEDFileField1TSStructItem
2924 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
2927 class MEDFileMeshStruct : public RefCountObject
2930 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
2932 ~MEDFileMeshStruct();
2935 class MEDMeshMultiLev : public RefCountObject
2938 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
2939 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
2945 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
2947 DataArrayInt *famIds(0);
2948 bool isWithoutCopy(false);
2949 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
2950 PyObject *ret=PyTuple_New(2);
2951 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2953 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2954 PyTuple_SetItem(ret,1,ret1Py);
2958 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
2960 DataArrayInt *numIds(0);
2961 bool isWithoutCopy(false);
2962 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
2963 PyObject *ret=PyTuple_New(2);
2964 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2966 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2967 PyTuple_SetItem(ret,1,ret1Py);
2971 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2973 DataArrayInt *famIds(0);
2974 bool isWithoutCopy(false);
2975 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
2976 PyObject *ret=PyTuple_New(2);
2977 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2979 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2980 PyTuple_SetItem(ret,1,ret1Py);
2984 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
2986 DataArrayInt *numIds(0);
2987 bool isWithoutCopy(false);
2988 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
2989 PyObject *ret=PyTuple_New(2);
2990 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
2992 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2993 PyTuple_SetItem(ret,1,ret1Py);
2997 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
2999 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3000 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3001 PyObject *res(PyList_New(result.size()));
3002 for(int i=0;iL!=result.end(); i++, iL++)
3003 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3009 class MEDUMeshMultiLev : public MEDMeshMultiLev
3012 ~MEDUMeshMultiLev();
3016 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3018 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3019 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3020 PyObject *ret0Py=ncc?Py_True:Py_False;
3022 PyObject *ret=PyTuple_New(7);
3023 PyTuple_SetItem(ret,0,ret0Py);
3024 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3025 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3026 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3027 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3028 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3029 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3035 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3038 ~MEDStructuredMeshMultiLev();
3041 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3044 ~MEDCMeshMultiLev();
3048 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3051 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3052 std::size_t sz(objs.size());
3053 PyObject *ret(PyTuple_New(2));
3054 PyObject *ret0=PyList_New(sz);
3055 for(std::size_t i=0;i<sz;i++)
3056 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3057 PyTuple_SetItem(ret,0,ret0);
3058 PyObject *ret1Py(isInternal?Py_True:Py_False);
3060 PyTuple_SetItem(ret,1,ret1Py);
3066 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3069 ~MEDCurveLinearMeshMultiLev();
3073 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3075 DataArrayDouble *ret0(0);
3076 std::vector<int> ret1;
3078 self->buildVTUArrays(ret0,ret1,ret2);
3079 std::size_t sz(ret1.size());
3080 PyObject *ret=PyTuple_New(3);
3081 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3082 PyObject *ret1Py=PyList_New(sz);
3083 for(std::size_t i=0;i<sz;i++)
3084 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3085 PyTuple_SetItem(ret,1,ret1Py);
3086 PyObject *ret2Py(ret2?Py_True:Py_False);
3088 PyTuple_SetItem(ret,2,ret2Py);
3094 class MEDFileFastCellSupportComparator : public RefCountObject
3097 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3098 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3099 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3100 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3102 ~MEDFileFastCellSupportComparator();
3106 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3108 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3109 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3110 PyObject *res(PyList_New(result.size()));
3111 for(int i=0;iL!=result.end(); i++, iL++)
3112 PyList_SetItem(res,i,PyInt_FromLong(*iL));