1 // Copyright (C) 2007-2016 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 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
124 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
125 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
126 %newobject MEDCoupling::MEDFileCMesh::New;
127 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
128 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
129 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
130 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
131 %newobject MEDCoupling::MEDFileMeshes::New;
132 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
133 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
134 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
135 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
136 %newobject MEDCoupling::MEDFileMeshes::__iter__;
138 %newobject MEDCoupling::MEDFileFields::New;
139 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
140 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
141 %newobject MEDCoupling::MEDFileFields::deepCopy;
142 %newobject MEDCoupling::MEDFileFields::shallowCpy;
143 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
144 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
145 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
146 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
147 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
148 %newobject MEDCoupling::MEDFileFields::__iter__;
149 %newobject MEDCoupling::MEDFileFields::extractPart;
151 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
152 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
153 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
154 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
155 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
160 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
161 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
162 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
163 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
168 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
169 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
170 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
171 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
173 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
174 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
175 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
176 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
177 %newobject MEDCoupling::MEDFileField1TS::New;
178 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
179 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
180 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
181 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
182 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
183 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
185 %newobject MEDCoupling::MEDFileIntField1TS::New;
186 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
187 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
189 %newobject MEDCoupling::MEDFileData::New;
190 %newobject MEDCoupling::MEDFileData::deepCopy;
191 %newobject MEDCoupling::MEDFileData::getMeshes;
192 %newobject MEDCoupling::MEDFileData::getFields;
193 %newobject MEDCoupling::MEDFileData::getParams;
195 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
196 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
197 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
198 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
199 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
200 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
201 %newobject MEDCoupling::MEDFileParameters::New;
202 %newobject MEDCoupling::MEDFileParameters::deepCopy;
203 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
204 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
205 %newobject MEDCoupling::MEDFileParameters::__getitem__;
207 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
208 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
209 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
210 %newobject MEDCoupling::MEDFileJointOneStep::New;
211 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
212 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
213 %newobject MEDCoupling::MEDFileJoint::New;
214 %newobject MEDCoupling::MEDFileJoint::deepCopy;
215 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
216 %newobject MEDCoupling::MEDFileJoints::New;
217 %newobject MEDCoupling::MEDFileJoints::deepCopy;
218 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
219 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
220 %newobject MEDCoupling::MEDFileJoints::__getitem__;
221 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
222 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
223 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
224 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
225 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
226 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
227 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
228 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
229 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
231 %newobject MEDCoupling::SauvWriter::New;
232 %newobject MEDCoupling::SauvReader::New;
233 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
235 %newobject MEDCoupling::MEDFileMeshStruct::New;
236 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
237 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
238 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
239 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
240 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
242 %feature("unref") MEDFileMesh "$this->decrRef();"
243 %feature("unref") MEDFileUMesh "$this->decrRef();"
244 %feature("unref") MEDFileCMesh "$this->decrRef();"
245 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
246 %feature("unref") MEDFileMeshes "$this->decrRef();"
247 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
248 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
249 %feature("unref") MEDFileField1TS "$this->decrRef();"
250 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
251 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
252 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
253 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
254 %feature("unref") MEDFileFields "$this->decrRef();"
255 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
256 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
257 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
258 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
259 %feature("unref") MEDFileParameters "$this->decrRef();"
260 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
261 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
262 %feature("unref") MEDFileJoint "$this->decrRef();"
263 %feature("unref") MEDFileJoints "$this->decrRef();"
264 %feature("unref") MEDFileEquivalences "$this->decrRef();"
265 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
266 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
267 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
268 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
269 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
270 %feature("unref") MEDFileData "$this->decrRef();"
271 %feature("unref") SauvReader "$this->decrRef();"
272 %feature("unref") SauvWriter "$this->decrRef();"
273 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
274 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
275 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
276 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
277 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
278 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
280 namespace MEDCoupling
283 std::string MEDFileVersionStr();
284 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
285 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
286 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
287 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
288 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
289 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
290 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
291 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
292 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
293 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
294 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
295 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
296 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
297 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
298 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
299 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
300 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
301 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
302 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
303 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
304 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
305 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
306 MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
307 MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
308 MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
309 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
310 MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
311 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
312 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
313 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
314 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
315 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
316 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
319 %rename (MEDFileVersion) MEDFileVersionSwig;
320 %rename (GetFieldIterations) GetFieldIterationsSwig;
321 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
322 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
323 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
324 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
325 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
326 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
327 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
328 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
329 %rename (WriteUMeshes) WriteUMeshesSwig;
330 %rename (GetTypesOfField) GetTypesOfFieldSwig;
331 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
332 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
336 PyObject *MEDFileVersionSwig()
338 int major,minor,release;
339 MEDCoupling::MEDFileVersion(major,minor,release);
340 PyObject *ret(PyTuple_New(3));
341 PyTuple_SetItem(ret,0,SWIG_From_int(major));
342 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
343 PyTuple_SetItem(ret,2,SWIG_From_int(release));
347 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
349 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
350 PyObject *ret=PyList_New(res.size());
352 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
354 PyObject *elt=PyTuple_New(2);
355 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
356 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
357 PyList_SetItem(ret,rk,elt);
362 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
364 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
365 PyObject *ret=PyList_New(res.size());
367 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
369 PyObject *elt=PyTuple_New(3);
370 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
371 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
372 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
373 PyList_SetItem(ret,rk,elt);
378 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
380 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
381 PyObject *ret=PyList_New(res.size());
383 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
385 PyObject *elt=PyTuple_New(2);
386 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
387 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
388 PyList_SetItem(ret,rk,elt);
393 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
395 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
396 PyObject *ret=PyList_New(res.size());
398 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
400 PyObject *elt=PyTuple_New(2);
401 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
402 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
403 PyList_SetItem(ret,rk,elt);
408 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
410 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
411 PyObject *ret=PyList_New(res.size());
413 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
415 PyObject *elt=PyTuple_New(2);
416 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
417 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
418 PyList_SetItem(ret,rk,elt);
423 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
425 int meshDim,spaceDim,numberOfNodes;
426 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
427 PyObject *ret=PyTuple_New(4);
428 PyObject *elt0=PyList_New(res.size());
430 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
432 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
434 PyObject *elt1=PyList_New(obj2.size());
435 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
437 PyObject *elt2=PyTuple_New(2);
438 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
439 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
440 PyList_SetItem(elt1,j,elt2);
442 PyList_SetItem(elt0,i,elt1);
444 PyTuple_SetItem(ret,0,elt0);
445 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
446 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
447 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
451 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
452 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
454 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
455 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
456 return convertFieldDoubleVecToPy(res);
459 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
461 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
462 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
463 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
466 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
468 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
469 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
470 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
473 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
475 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
476 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
477 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
480 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
482 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
484 PyObject *ret=PyList_New(size);
485 for(int i=0;i<size;i++)
486 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
490 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
492 std::vector<std::string> grps;
493 converPyListToVecString(li,grps);
494 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
497 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
499 std::vector<std::string> fams;
500 converPyListToVecString(li,fams);
501 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
505 namespace MEDCoupling
507 class MEDFileWritable
510 void copyOptionsFrom(const MEDFileWritable& other) const;
511 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
512 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
513 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
514 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
517 class MEDFileMeshReadSelector
520 MEDFileMeshReadSelector();
521 MEDFileMeshReadSelector(unsigned int code);
522 unsigned int getCode() const;
523 void setCode(unsigned int newCode);
524 bool isCellFamilyFieldReading() const;
525 bool isNodeFamilyFieldReading() const;
526 bool isCellNameFieldReading() const;
527 bool isNodeNameFieldReading() const;
528 bool isCellNumFieldReading() const;
529 bool isNodeNumFieldReading() const;
530 void setCellFamilyFieldReading(bool b);
531 void setNodeFamilyFieldReading(bool b);
532 void setCellNameFieldReading(bool b);
533 void setNodeNameFieldReading(bool b);
534 void setCellNumFieldReading(bool b);
535 void setNodeNumFieldReading(bool b);
538 std::string __str__() const throw(INTERP_KERNEL::Exception)
540 std::ostringstream oss;
545 std::string __repr__() const throw(INTERP_KERNEL::Exception)
547 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
553 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
556 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
557 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
558 throw(INTERP_KERNEL::Exception);
559 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
560 INTERP_KERNEL::NormalizedCellType loc_geo_type,
561 INTERP_KERNEL::NormalizedCellType rem_geo_type)
562 throw(INTERP_KERNEL::Exception);
563 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
564 MEDFileJointCorrespondence *deepCopy() const;
565 MEDFileJointCorrespondence *shallowCpy() const;
566 void setIsNodal(bool isNodal);
567 bool getIsNodal() const;
568 bool isEqual(const MEDFileJointCorrespondence *other) const;
569 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
570 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
571 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
572 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
573 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
574 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
575 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const throw(INTERP_KERNEL::Exception);
576 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
579 MEDFileJointCorrespondence()
581 return MEDFileJointCorrespondence::New();
583 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
585 return MEDFileJointCorrespondence::New(correspondence);
587 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
588 INTERP_KERNEL::NormalizedCellType loc_geo_type,
589 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
591 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
594 std::string __str__() const throw(INTERP_KERNEL::Exception)
596 return self->simpleRepr();
601 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
604 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
605 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
606 MEDFileJointOneStep *deepCopy() const;
607 MEDFileJointOneStep *shallowCpy() const;
608 bool isEqual(const MEDFileJointOneStep *other) const;
609 void setOrder(int order);
610 int getOrder() const;
611 void setIteration(int it);
612 int getIteration() const;
613 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
614 int getNumberOfCorrespondences() const;
615 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
616 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
617 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
620 MEDFileJointOneStep()
622 return MEDFileJointOneStep::New();
625 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
627 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
630 std::string __str__() const throw(INTERP_KERNEL::Exception)
632 return self->simpleRepr();
637 class MEDFileJoint : public RefCountObject, public MEDFileWritable
640 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
641 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
642 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
643 MEDFileJoint *deepCopy() const;
644 MEDFileJoint *shallowCpy() const;
645 bool isEqual(const MEDFileJoint *other) const;
646 void setLocalMeshName(const std::string& name);
647 std::string getLocalMeshName() const;
648 void setRemoteMeshName(const std::string& name);
649 std::string getRemoteMeshName() const;
650 void setDescription(const std::string& name);
651 std::string getDescription() const;
652 void setJointName(const std::string& name);
653 std::string getJointName() const;
654 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
655 void setDomainNumber(const int& number);
656 int getDomainNumber() const;
657 void pushStep(MEDFileJointOneStep* step);
658 int getNumberOfSteps() const;
659 MEDFileJointOneStep *getStepAtPos(int i) const;
660 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
661 std::string simpleRepr() const;
666 return MEDFileJoint::New();
669 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
671 return MEDFileJoint::New(fileName,mName,num);
674 std::string __str__() const throw(INTERP_KERNEL::Exception)
676 return self->simpleRepr();
681 class MEDFileJoints : public RefCountObject, public MEDFileWritable
684 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
685 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
686 MEDFileJoints *deepCopy() const;
687 std::string simpleRepr() const;
688 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
689 std::string getMeshName() const;
690 int getNumberOfJoints() const;
691 std::vector<std::string> getJointsNames() const;
692 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
693 void resize(int newSize) throw(INTERP_KERNEL::Exception);
694 void pushJoint(MEDFileJoint *joint);
695 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
696 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
701 return MEDFileJoints::New();
704 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
706 return MEDFileJoints::New(fileName,meshName);
709 std::string __str__() const throw(INTERP_KERNEL::Exception)
711 return self->simpleRepr();
714 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
718 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
723 else if(PyString_Check(obj))
725 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
731 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
734 int __len__() const throw(INTERP_KERNEL::Exception)
736 return self->getNumberOfJoints();
739 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
741 MEDFileJoint *ret=self->getJointAtPos(i);
747 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
749 MEDFileJoint *ret=self->getJointWithName(paramName);
757 class MEDFileEquivalenceBase : public RefCountObject
760 MEDFileEquivalenceBase();
763 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
766 MEDFileEquivalenceData();
768 void setArray(DataArrayInt *data);
771 DataArrayInt *getArray()
773 DataArrayInt *ret(self->getArray());
774 if(ret) ret->incrRef();
780 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
783 MEDFileEquivalenceNode();
786 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
789 MEDFileEquivalenceCell();
792 std::size_t size() const;
793 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
794 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
797 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
799 DataArrayInt *ret(self->getArray(type));
800 if(ret) ret->incrRef();
804 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
806 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
807 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
808 PyObject *res=PyList_New(result.size());
809 for(int i=0;iL!=result.end(); i++, iL++)
810 PyList_SetItem(res,i,PyInt_FromLong(*iL));
816 class MEDFileEquivalencePair : public RefCountObject
819 MEDFileEquivalencePair();
821 std::string getName() const;
822 void setName(const std::string& name);
823 std::string getDescription() const;
824 void setDescription(const std::string& descr);
825 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
828 MEDFileEquivalenceCell *initCell()
830 MEDFileEquivalenceCell *ret(self->initCell());
831 if(ret) ret->incrRef();
835 MEDFileEquivalenceNode *initNode()
837 MEDFileEquivalenceNode *ret(self->initNode());
838 if(ret) ret->incrRef();
842 MEDFileEquivalenceCell *getCell()
844 MEDFileEquivalenceCell *ret(self->getCell());
845 if(ret) ret->incrRef();
849 MEDFileEquivalenceNode *getNode()
851 MEDFileEquivalenceNode *ret(self->getNode());
852 if(ret) ret->incrRef();
858 class MEDFileEquivalences : public RefCountObject
861 MEDFileEquivalences();
864 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
865 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
866 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
870 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
872 MEDFileEquivalencePair *ret(self->getEquivalence(i));
873 if(ret) ret->incrRef();
876 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
878 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
879 if(ret) ret->incrRef();
883 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
885 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
886 if(ret) ret->incrRef();
892 class MEDFileMesh : public RefCountObject, public MEDFileWritable
895 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
896 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
897 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
898 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
899 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
900 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
901 void setName(const std::string& name);
902 std::string getName();
903 std::string getUnivName() const;
904 bool getUnivNameWrStatus() const;
905 void setUnivNameWrStatus(bool newStatus);
906 void setDescription(const std::string& name);
907 std::string getDescription() const;
908 void setOrder(int order);
909 int getOrder() const;
910 void setIteration(int it);
912 void setTimeValue(double time);
913 void setTime(int dt, int it, double time);
914 double getTimeValue() const;
915 void setTimeUnit(const std::string& unit);
916 std::string getTimeUnit() const;
917 void setAxisType(MEDCouplingAxisType at);
918 MEDCouplingAxisType getAxisType() const;
919 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
920 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
921 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
922 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
923 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
924 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
925 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
926 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
927 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
928 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
929 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
930 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
931 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
932 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
933 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
935 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
936 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
937 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
938 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
939 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
940 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
941 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
942 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
943 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
944 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
945 void clearGrpMap() throw(INTERP_KERNEL::Exception);
946 void clearFamMap() throw(INTERP_KERNEL::Exception);
947 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
948 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
949 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
950 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
951 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
952 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
953 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
954 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
955 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
956 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
957 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
958 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
959 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
960 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
961 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
962 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
963 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
964 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
965 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
966 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
967 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
968 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
969 static std::string GetMagicFamilyStr();
970 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
971 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
972 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
973 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
974 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
975 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
976 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
977 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
978 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
979 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
980 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
981 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
982 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
983 void setFamilyInfo(const std::map<std::string,int>& info);
984 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
985 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
986 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
987 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
988 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
989 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
990 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
991 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
992 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
993 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
994 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
995 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
996 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
997 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
998 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
999 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1000 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1001 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1002 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1003 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1004 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1006 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1007 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1008 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1009 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1010 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1011 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1012 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1013 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1014 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1015 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1016 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1017 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1018 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1019 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1020 int getNumberOfJoints();
1021 MEDFileJoints *getJoints();
1022 void setJoints( MEDFileJoints* joints );
1023 void initializeEquivalences();
1024 void killEquivalences();
1027 std::string __str__() const throw(INTERP_KERNEL::Exception)
1029 return self->simpleRepr();
1032 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1034 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1037 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1040 double tmp0=self->getTime(tmp1,tmp2);
1041 PyObject *res = PyList_New(3);
1042 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1043 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1044 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1048 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1051 bool ret0=self->isEqual(other,eps,what);
1052 PyObject *res=PyList_New(2);
1053 PyObject *ret0Py=ret0?Py_True:Py_False;
1055 PyList_SetItem(res,0,ret0Py);
1056 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1060 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1062 std::vector<const DataArrayInt *> grps;
1063 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1064 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1067 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1070 bool ret0=self->areFamsEqual(other,what);
1071 PyObject *res=PyList_New(2);
1072 PyObject *ret0Py=ret0?Py_True:Py_False;
1074 PyList_SetItem(res,0,ret0Py);
1075 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1079 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1082 bool ret0=self->areGrpsEqual(other,what);
1083 PyObject *res=PyList_New(2);
1084 PyObject *ret0Py=ret0?Py_True:Py_False;
1086 PyList_SetItem(res,0,ret0Py);
1087 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1091 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1093 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1094 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1095 PyObject *res=PyList_New(result.size());
1096 for(int i=0;iL!=result.end(); i++, iL++)
1097 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1101 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1103 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1104 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1105 PyObject *res=PyList_New(result.size());
1106 for(int i=0;iL!=result.end(); i++, iL++)
1107 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1111 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1113 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1116 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1119 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1121 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1124 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1127 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1129 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1132 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1135 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1137 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1140 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1143 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1145 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1148 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1151 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1154 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1155 PyObject *ret=PyTuple_New(2);
1156 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1157 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1161 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1163 DataArrayInt *ret3=0;
1164 std::vector<int> ret1,ret2;
1165 bool ret0=self->unPolyze(ret1,ret2,ret3);
1166 PyObject *ret=PyTuple_New(4);
1167 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1169 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1170 for(int j=0;j<(int)ret1.size()/3;j++)
1172 PyObject *retLev2=PyList_New(3);
1173 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1174 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1175 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1176 PyList_SetItem(retLev1_0,j,retLev2);
1178 PyTuple_SetItem(ret,1,retLev1_0);
1180 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1181 for(int j=0;j<(int)ret2.size()/3;j++)
1183 PyObject *retLev2=PyList_New(3);
1184 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1185 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1186 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1187 PyList_SetItem(retLev1_1,j,retLev2);
1189 PyTuple_SetItem(ret,2,retLev1_1);
1191 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1195 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1197 MEDFileEquivalences *ret(self->getEquivalences());
1198 if(ret) ret->incrRef();
1204 class MEDFileUMesh : public MEDFileMesh
1207 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1208 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1209 static MEDFileUMesh *New();
1211 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1212 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1213 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1214 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1215 void clearNodeAndCellNumbers();
1217 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1218 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1219 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1220 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1221 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1222 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1223 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1224 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1225 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1226 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1228 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1229 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1230 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1231 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1232 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1233 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1234 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1235 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1236 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1237 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1238 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1239 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1240 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1243 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1245 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1248 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1250 return MEDFileUMesh::New(fileName,mrs);
1255 return MEDFileUMesh::New();
1259 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1261 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1264 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)
1266 std::vector<int> typesCpp1;
1267 convertPyToNewIntArr3(types,typesCpp1);
1268 std::size_t sz(typesCpp1.size());
1269 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1270 for(std::size_t ii=0;ii<sz;ii++)
1271 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1272 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1275 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1276 {// put an empty dict in input to say to __new__ to call __init__...
1277 PyObject *ret(PyTuple_New(1));
1278 PyObject *ret0(PyDict_New());
1279 PyTuple_SetItem(ret,0,ret0);
1283 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1285 std::vector<double> a0;
1286 std::vector<int> a1;
1287 std::vector<std::string> a2;
1288 std::vector< MCAuto<DataArrayInt> > a3;
1289 MCAuto<DataArrayDouble> a4;
1290 self->serialize(a0,a1,a2,a3,a4);
1291 PyObject *ret(PyTuple_New(5));
1292 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1293 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1295 PyObject *ret2(PyList_New(sz));
1296 for(int i=0;i<sz;i++)
1297 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1298 PyTuple_SetItem(ret,2,ret2);
1300 PyObject *ret3(PyList_New(sz));
1301 for(int i=0;i<sz;i++)
1303 DataArrayInt *elt(a3[i]);
1306 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1308 PyTuple_SetItem(ret,3,ret3);
1309 DataArrayDouble *ret4(a4);
1312 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1316 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1318 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1319 if(!PyTuple_Check(inp))
1320 throw INTERP_KERNEL::Exception(MSG);
1321 int sz(PyTuple_Size(inp));
1323 throw INTERP_KERNEL::Exception(MSG);
1324 std::vector<double> a0;
1325 std::vector<int> a1;
1326 std::vector<std::string> a2;
1327 std::vector< MCAuto<DataArrayInt> > a3;
1328 MCAuto<DataArrayDouble> a4;
1330 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1332 fillArrayWithPyListDbl3(a0py,tmp,a0);
1333 convertPyToNewIntArr3(a1py,a1);
1334 fillStringVector(a2py,a2);
1336 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1338 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1339 if(!SWIG_IsOK(status))
1340 throw INTERP_KERNEL::Exception(MSG);
1341 a4=reinterpret_cast<DataArrayDouble *>(argp);
1342 if((DataArrayDouble *)a4)
1345 std::vector< DataArrayInt * > a3Tmp;
1346 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1347 std::size_t sz(a3Tmp.size());
1349 for(std::size_t i=0;i<sz;i++)
1353 a3Tmp[i]->incrRef();
1355 self->unserialize(a0,a1,a2,a3,a4);
1359 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1362 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1363 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1366 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1369 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1372 self->setMeshAtLevel(meshDimRelToMax,m1);
1375 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1378 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1380 self->removeMeshAtLevel(meshDimRelToMax);
1383 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1385 std::vector<const MEDCouplingUMesh *> ms;
1386 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1387 self->setMeshes(ms,renum);
1390 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1392 std::vector<const MEDCouplingUMesh *> ms;
1393 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1394 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1397 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1399 std::vector<const MEDCouplingUMesh *> ms;
1400 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1401 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1404 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1406 DataArrayDouble *ret=self->getCoords();
1412 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1414 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1417 return const_cast<PartDefinition *>(ret);
1420 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1422 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1423 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1424 PyObject *ret=PyTuple_New(3);
1425 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1427 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1431 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1433 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1439 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1441 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1442 std::size_t sz(tmp.size());
1443 PyObject *ret=PyList_New(sz);
1444 for(std::size_t i=0;i<sz;i++)
1448 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1455 class MEDFileStructuredMesh : public MEDFileMesh
1460 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1462 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1470 class MEDFileCMesh : public MEDFileStructuredMesh
1473 static MEDFileCMesh *New();
1474 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1475 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1476 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1477 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1482 return MEDFileCMesh::New();
1485 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1487 return MEDFileCMesh::New(fileName,mrs);
1490 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1492 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1495 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1497 const MEDCouplingCMesh *tmp=self->getMesh();
1500 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1505 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1508 static MEDFileCurveLinearMesh *New();
1509 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1510 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1511 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1514 MEDFileCurveLinearMesh()
1516 return MEDFileCurveLinearMesh::New();
1519 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1521 return MEDFileCurveLinearMesh::New(fileName,mrs);
1524 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1526 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1529 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1531 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1534 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1539 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1542 static MEDFileMeshMultiTS *New();
1543 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1544 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1545 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1546 std::string getName() const throw(INTERP_KERNEL::Exception);
1547 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1548 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1549 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1552 MEDFileMeshMultiTS()
1554 return MEDFileMeshMultiTS::New();
1557 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1559 return MEDFileMeshMultiTS::New(fileName);
1562 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1564 return MEDFileMeshMultiTS::New(fileName,mName);
1567 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1569 MEDFileMesh *ret=self->getOneTimeStep();
1577 class MEDFileMeshesIterator
1582 PyObject *next() throw(INTERP_KERNEL::Exception)
1584 MEDFileMesh *ret=self->nextt();
1588 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1592 PyErr_SetString(PyExc_StopIteration,"No more data.");
1599 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1602 static MEDFileMeshes *New();
1603 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1604 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1605 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1606 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1607 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1609 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1610 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1611 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1612 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1613 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1618 return MEDFileMeshes::New();
1621 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1623 return MEDFileMeshes::New(fileName);
1626 std::string __str__() const throw(INTERP_KERNEL::Exception)
1628 return self->simpleRepr();
1631 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1633 if(PyInt_Check(obj))
1635 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1640 else if(PyString_Check(obj))
1642 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1648 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1651 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1653 self->setMeshAtPos(obj,mesh);
1657 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1659 return self->iterator();
1662 int __len__() const throw(INTERP_KERNEL::Exception)
1664 return self->getNumberOfMeshes();
1667 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1669 MEDFileMesh *ret=self->getMeshAtPos(i);
1674 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1676 MEDFileMesh *ret=self->getMeshWithName(mname);
1684 class MEDFileFieldLoc : public RefCountObject
1687 std::string getName() const;
1688 int getDimension() const;
1689 int getNumberOfGaussPoints() const;
1690 int getNumberOfPointsInCells() const;
1691 const std::vector<double>& getRefCoords() const;
1692 const std::vector<double>& getGaussCoords() const;
1693 const std::vector<double>& getGaussWeights() const;
1694 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1697 std::string __str__() const throw(INTERP_KERNEL::Exception)
1699 return self->repr();
1704 class MEDFileFieldGlobsReal
1707 void resetContent();
1708 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1709 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1710 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1711 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1712 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1713 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1714 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1715 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1716 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1717 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1718 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1719 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1720 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1721 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1722 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1723 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1724 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1725 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1726 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1727 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1728 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1729 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1730 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1731 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1732 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1733 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1736 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1738 const DataArrayInt *ret=self->getProfile(pflName);
1741 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1744 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1746 const DataArrayInt *ret=self->getProfileFromId(pflId);
1749 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1752 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1754 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1757 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1760 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1762 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1765 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1768 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1770 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1771 return convertVecPairVecStToPy(ret);
1774 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1776 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1777 return convertVecPairVecStToPy(ret);
1780 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1782 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1783 self->changePflsNames(v);
1786 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1788 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1789 self->changePflsRefsNamesGen(v);
1792 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1794 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1795 self->changePflsNamesInStruct(v);
1798 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1800 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1801 self->changeLocsNames(v);
1804 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1806 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1807 self->changeLocsRefsNamesGen(v);
1810 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1812 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1813 self->changeLocsNamesInStruct(v);
1816 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1818 std::ostringstream oss;
1819 self->simpleReprGlobs(oss);
1825 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1828 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1829 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1830 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1831 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1832 void loadArrays() throw(INTERP_KERNEL::Exception);
1833 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1834 void unloadArrays() throw(INTERP_KERNEL::Exception);
1835 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1836 int getDimension() const throw(INTERP_KERNEL::Exception);
1837 int getIteration() const throw(INTERP_KERNEL::Exception);
1838 int getOrder() const throw(INTERP_KERNEL::Exception);
1839 std::string getName() throw(INTERP_KERNEL::Exception);
1840 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1841 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1842 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1843 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1844 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1845 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1846 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1847 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1848 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1849 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1850 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1851 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1852 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1853 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1854 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1857 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1860 double tmp0=self->getTime(tmp1,tmp2);
1861 PyObject *res = PyList_New(3);
1862 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1863 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1864 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1868 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1870 std::pair<int,int> res=self->getDtIt();
1871 PyObject *elt=PyTuple_New(2);
1872 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1873 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1877 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1879 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1882 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1884 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1887 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1889 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1890 return self->changeMeshNames(modifTab);
1893 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1895 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1896 PyObject *ret2=PyList_New(ret.size());
1897 for(int i=0;i<(int)ret.size();i++)
1898 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1902 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1904 std::vector<int> ret1;
1905 int ret0=self->getNonEmptyLevels(mname,ret1);
1906 PyObject *elt=PyTuple_New(2);
1907 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1908 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1912 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1914 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1915 std::vector< std::vector<TypeOfField> > typesF;
1916 std::vector< std::vector<std::string> > pfls;
1917 std::vector< std::vector<std::string> > locs;
1918 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1920 PyObject *ret2=PyList_New(sz);
1921 for(int i=0;i<sz;i++)
1923 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1924 const std::vector<TypeOfField>& typesFI=typesF[i];
1925 const std::vector<std::string>& pflsI=pfls[i];
1926 const std::vector<std::string>& locsI=locs[i];
1927 PyObject *elt=PyTuple_New(2);
1928 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1929 int sz2=ret[i].size();
1930 PyObject *elt2=PyList_New(sz2);
1931 for(int j=0;j<sz2;j++)
1933 PyObject *elt3=PyTuple_New(4);
1934 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1935 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));
1936 PyTuple_SetItem(elt3,1,elt4);
1937 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1938 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1939 PyList_SetItem(elt2,j,elt3);
1941 PyTuple_SetItem(elt,1,elt2);
1942 PyList_SetItem(ret2,i,elt);
1947 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1949 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1950 std::size_t sz=ret.size();
1951 PyObject *retPy=PyList_New(sz);
1952 for(std::size_t i=0;i<sz;i++)
1953 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1957 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1959 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1960 std::size_t sz=ret.size();
1961 PyObject *retPy=PyList_New(sz);
1962 for(std::size_t i=0;i<sz;i++)
1963 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1967 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1969 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1970 std::size_t sz=ret.size();
1971 PyObject *retPy=PyList_New(sz);
1972 for(std::size_t i=0;i<sz;i++)
1973 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1977 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
1979 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1980 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1981 return self->extractPart(extractDefCpp,mm);
1986 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1989 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1990 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1991 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1992 static MEDFileField1TS *New();
1993 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1994 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1995 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1996 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1997 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1998 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2000 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2001 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2002 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2003 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2006 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2008 return MEDFileField1TS::New(fileName,loadAll);
2011 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2013 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2016 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2018 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2023 return MEDFileField1TS::New();
2026 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2028 const DataArrayDouble *arr=0;
2030 arr=field->getArray();
2031 self->copyTinyInfoFrom(field,arr);
2034 std::string __str__() const throw(INTERP_KERNEL::Exception)
2036 return self->simpleRepr();
2039 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2041 DataArrayInt *ret1=0;
2042 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2043 PyObject *ret=PyTuple_New(2);
2044 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2045 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2049 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2051 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2052 std::vector< std::vector<TypeOfField> > typesF;
2053 std::vector< std::vector<std::string> > pfls;
2054 std::vector< std::vector<std::string> > locs;
2055 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2057 PyObject *ret2=PyList_New(sz);
2058 for(int i=0;i<sz;i++)
2060 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2061 const std::vector<TypeOfField>& typesFI=typesF[i];
2062 const std::vector<std::string>& pflsI=pfls[i];
2063 const std::vector<std::string>& locsI=locs[i];
2064 PyObject *elt=PyTuple_New(2);
2065 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2066 int sz2=ret[i].size();
2067 PyObject *elt2=PyList_New(sz2);
2068 for(int j=0;j<sz2;j++)
2070 PyObject *elt3=PyTuple_New(4);
2071 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2072 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2073 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2074 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2075 PyList_SetItem(elt2,j,elt3);
2077 PyTuple_SetItem(elt,1,elt2);
2078 PyList_SetItem(ret2,i,elt);
2083 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2085 DataArrayDouble *ret=self->getUndergroundDataArray();
2091 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2093 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2094 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2097 PyObject *ret=PyTuple_New(2);
2098 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2099 std::size_t sz=elt1Cpp.size();
2100 PyObject *elt=PyList_New(sz);
2101 for(std::size_t i=0;i<sz;i++)
2103 PyObject *elt1=PyTuple_New(2);
2104 PyObject *elt2=PyTuple_New(2);
2105 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2106 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2107 PyObject *elt3=PyTuple_New(2);
2108 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2109 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2110 PyTuple_SetItem(elt1,0,elt2);
2111 PyTuple_SetItem(elt1,1,elt3);
2112 PyList_SetItem(elt,i,elt1);
2114 PyTuple_SetItem(ret,1,elt);
2120 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2123 static MEDFileIntField1TS *New();
2124 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2125 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2126 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2127 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2129 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2130 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2133 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2135 return MEDFileIntField1TS::New();
2138 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2140 return MEDFileIntField1TS::New(fileName,loadAll);
2143 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2145 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2148 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2150 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2153 std::string __str__() const throw(INTERP_KERNEL::Exception)
2155 return self->simpleRepr();
2158 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2160 DataArrayInt *ret1=0;
2161 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2162 PyObject *ret=PyTuple_New(2);
2163 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2164 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2168 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2170 DataArrayInt *ret1=0;
2171 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2172 PyObject *ret=PyTuple_New(2);
2173 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2174 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2180 DataArrayInt *ret1=0;
2181 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2182 PyObject *ret=PyTuple_New(2);
2183 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2184 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2188 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2190 DataArrayInt *ret1=0;
2191 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2192 PyObject *ret=PyTuple_New(2);
2193 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2194 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2198 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2200 DataArrayInt *ret1=0;
2201 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2202 PyObject *ret=PyTuple_New(2);
2203 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2204 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2208 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2210 DataArrayInt *ret1=0;
2211 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2212 PyObject *ret=PyTuple_New(2);
2213 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2214 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2218 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2220 DataArrayInt *ret=self->getUndergroundDataArray();
2228 class MEDFileAnyTypeFieldMultiTSIterator
2233 PyObject *next() throw(INTERP_KERNEL::Exception)
2235 MEDFileAnyTypeField1TS *ret=self->nextt();
2237 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2240 PyErr_SetString(PyExc_StopIteration,"No more data.");
2247 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2250 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2251 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2252 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2253 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2254 std::string getName() const throw(INTERP_KERNEL::Exception);
2255 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2256 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2257 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2258 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2259 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2260 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2261 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2262 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2263 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2264 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2265 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2266 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2267 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2268 void loadArrays() throw(INTERP_KERNEL::Exception);
2269 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2270 void unloadArrays() throw(INTERP_KERNEL::Exception);
2271 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2273 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2274 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2275 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2276 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2277 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2278 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2281 int __len__() const throw(INTERP_KERNEL::Exception)
2283 return self->getNumberOfTS();
2286 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2288 if(elt0 && PyInt_Check(elt0))
2290 int pos=PyInt_AS_LONG(elt0);
2293 else if(elt0 && PyTuple_Check(elt0))
2295 if(PyTuple_Size(elt0)==2)
2297 PyObject *o0=PyTuple_GetItem(elt0,0);
2298 PyObject *o1=PyTuple_GetItem(elt0,1);
2299 if(PyInt_Check(o0) && PyInt_Check(o1))
2301 int iter=PyInt_AS_LONG(o0);
2302 int order=PyInt_AS_LONG(o1);
2303 return self->getPosOfTimeStep(iter,order);
2306 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 !");
2309 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 !");
2311 else if(elt0 && PyFloat_Check(elt0))
2313 double val=PyFloat_AS_DOUBLE(elt0);
2314 return self->getPosGivenTime(val);
2317 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2320 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2322 std::vector< std::pair<int,int> > res=self->getIterations();
2323 PyObject *ret=PyList_New(res.size());
2325 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.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,rk,elt);
2335 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2337 std::vector<double> ret1;
2338 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2339 std::size_t sz=ret.size();
2340 PyObject *ret2=PyList_New(sz);
2341 for(std::size_t i=0;i<sz;i++)
2343 PyObject *elt=PyTuple_New(3);
2344 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2345 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2346 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2347 PyList_SetItem(ret2,i,elt);
2352 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2354 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2355 PyObject *ret2=PyList_New(ret.size());
2356 for(int i=0;i<(int)ret.size();i++)
2358 const std::vector<TypeOfField>& rett=ret[i];
2359 PyObject *ret3=PyList_New(rett.size());
2360 for(int j=0;j<(int)rett.size();j++)
2361 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2362 PyList_SetItem(ret2,i,ret3);
2367 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2369 std::vector<int> ret1;
2370 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2371 PyObject *elt=PyTuple_New(2);
2372 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2373 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2377 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2379 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2380 std::vector< std::vector<TypeOfField> > typesF;
2381 std::vector< std::vector<std::string> > pfls;
2382 std::vector< std::vector<std::string> > locs;
2383 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2385 PyObject *ret2=PyList_New(sz);
2386 for(int i=0;i<sz;i++)
2388 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2389 const std::vector<TypeOfField>& typesFI=typesF[i];
2390 const std::vector<std::string>& pflsI=pfls[i];
2391 const std::vector<std::string>& locsI=locs[i];
2392 PyObject *elt=PyTuple_New(2);
2393 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2394 int sz2=ret[i].size();
2395 PyObject *elt2=PyList_New(sz2);
2396 for(int j=0;j<sz2;j++)
2398 PyObject *elt3=PyTuple_New(4);
2399 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2400 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));
2401 PyTuple_SetItem(elt3,1,elt4);
2402 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2403 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2404 PyList_SetItem(elt2,j,elt3);
2406 PyTuple_SetItem(elt,1,elt2);
2407 PyList_SetItem(ret2,i,elt);
2412 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2414 if(PyList_Check(elts))
2416 int sz=PyList_Size(elts);
2417 std::vector<int> ret(sz);
2418 for(int i=0;i<sz;i++)
2420 PyObject *elt=PyList_GetItem(elts,i);
2421 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2427 std::vector<int> ret(1);
2428 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2433 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2435 if(PySlice_Check(elts))
2437 Py_ssize_t strt=2,stp=2,step=2;
2438 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2439 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2440 self->eraseTimeStepIds2(strt,stp,step);
2444 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2445 if(!idsToRemove.empty())
2446 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2450 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2454 std::vector<int> pos2;
2455 DataArrayInt *pos3=0;
2456 DataArrayIntTuple *pos4=0;
2457 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2462 self->eraseTimeStepIds(&pos1,&pos1+1);
2469 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2474 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2478 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2482 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2484 return self->iterator();
2487 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2489 if(elt0 && PyList_Check(elt0))
2491 int sz=PyList_Size(elt0);
2492 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2493 int *pt=da->getPointer();
2494 for(int i=0;i<sz;i++,pt++)
2496 PyObject *elt1=PyList_GetItem(elt0,i);
2497 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2499 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2501 else if(elt0 && PySlice_Check(elt0))
2503 Py_ssize_t strt=2,stp=2,step=2;
2504 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2505 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2506 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2509 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2512 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2514 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2515 return self->changeMeshNames(modifTab);
2518 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2520 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2521 std::size_t sz=ret.size();
2522 PyObject *retPy=PyList_New(sz);
2523 for(std::size_t i=0;i<sz;i++)
2524 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2528 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2530 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2531 std::size_t sz=ret.size();
2532 PyObject *retPy=PyList_New(sz);
2533 for(std::size_t i=0;i<sz;i++)
2534 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2538 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2540 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2541 std::size_t sz=ret.size();
2542 PyObject *retPy=PyList_New(sz);
2543 for(std::size_t i=0;i<sz;i++)
2544 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2548 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2551 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2552 if(SWIG_IsOK(status))
2554 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2558 std::vector<MEDFileAnyTypeField1TS *> tmp;
2559 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2560 self->pushBackTimeSteps(tmp);
2564 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2566 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2567 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2568 return self->extractPart(extractDefCpp,mm);
2571 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2573 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2574 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2575 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2576 std::size_t sz=ret.size();
2577 PyObject *retPy=PyList_New(sz);
2578 for(std::size_t i=0;i<sz;i++)
2580 std::size_t sz2=ret[i].size();
2581 PyObject *ret1Py=PyList_New(sz2);
2582 for(std::size_t j=0;j<sz2;j++)
2584 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2587 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2589 PyList_SetItem(retPy,i,ret1Py);
2594 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2596 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2597 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2598 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2599 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2600 if(ret2.size()!=ret.size())
2602 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2603 throw INTERP_KERNEL::Exception(oss.str().c_str());
2605 std::size_t sz=ret.size();
2606 PyObject *retPy=PyList_New(sz);
2607 for(std::size_t i=0;i<sz;i++)
2609 std::size_t sz2=ret[i].size();
2610 PyObject *ret0Py=PyTuple_New(2);
2611 PyObject *ret1Py=PyList_New(sz2);
2612 for(std::size_t j=0;j<sz2;j++)
2614 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2617 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2619 PyTuple_SetItem(ret0Py,0,ret1Py);
2620 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2621 PyList_SetItem(retPy,i,ret0Py);
2628 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2631 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2632 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2633 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2635 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2636 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2637 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2638 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2639 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2641 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2642 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2643 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2646 MEDFileFieldMultiTS()
2648 return MEDFileFieldMultiTS::New();
2651 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2653 return MEDFileFieldMultiTS::New(fileName,loadAll);
2656 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2658 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2661 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2663 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2664 std::size_t sz(tmp.size());
2665 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2666 for(std::size_t i=0;i<sz;i++)
2668 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2669 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2671 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2674 std::string __str__() const throw(INTERP_KERNEL::Exception)
2676 return self->simpleRepr();
2679 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2681 DataArrayInt *ret1=0;
2682 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2683 PyObject *ret=PyTuple_New(2);
2684 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2685 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2689 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2691 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2692 std::vector< std::vector<TypeOfField> > typesF;
2693 std::vector< std::vector<std::string> > pfls;
2694 std::vector< std::vector<std::string> > locs;
2695 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2697 PyObject *ret2=PyList_New(sz);
2698 for(int i=0;i<sz;i++)
2700 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2701 const std::vector<TypeOfField>& typesFI=typesF[i];
2702 const std::vector<std::string>& pflsI=pfls[i];
2703 const std::vector<std::string>& locsI=locs[i];
2704 PyObject *elt=PyTuple_New(2);
2705 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2706 int sz2=ret[i].size();
2707 PyObject *elt2=PyList_New(sz2);
2708 for(int j=0;j<sz2;j++)
2710 PyObject *elt3=PyTuple_New(4);
2711 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2712 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2713 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2714 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2715 PyList_SetItem(elt2,j,elt3);
2717 PyTuple_SetItem(elt,1,elt2);
2718 PyList_SetItem(ret2,i,elt);
2722 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2724 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2730 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2732 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2733 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2736 PyObject *ret=PyTuple_New(2);
2737 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2738 std::size_t sz=elt1Cpp.size();
2739 PyObject *elt=PyList_New(sz);
2740 for(std::size_t i=0;i<sz;i++)
2742 PyObject *elt1=PyTuple_New(2);
2743 PyObject *elt2=PyTuple_New(2);
2744 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2745 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2746 PyObject *elt3=PyTuple_New(2);
2747 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2748 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2749 PyTuple_SetItem(elt1,0,elt2);
2750 PyTuple_SetItem(elt1,1,elt3);
2751 PyList_SetItem(elt,i,elt1);
2753 PyTuple_SetItem(ret,1,elt);
2759 class MEDFileFieldsIterator
2764 PyObject *next() throw(INTERP_KERNEL::Exception)
2766 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2768 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2771 PyErr_SetString(PyExc_StopIteration,"No more data.");
2778 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2781 static MEDFileIntFieldMultiTS *New();
2782 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2783 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2785 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2786 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2787 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2790 MEDFileIntFieldMultiTS()
2792 return MEDFileIntFieldMultiTS::New();
2795 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2797 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2800 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2802 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2805 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2807 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2808 std::size_t sz(tmp.size());
2809 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2810 for(std::size_t i=0;i<sz;i++)
2812 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2813 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2815 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2818 std::string __str__() const throw(INTERP_KERNEL::Exception)
2820 return self->simpleRepr();
2823 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2825 DataArrayInt *ret1=0;
2826 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2827 PyObject *ret=PyTuple_New(2);
2828 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2829 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2833 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2835 DataArrayInt *ret1=0;
2836 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2837 PyObject *ret=PyTuple_New(2);
2838 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2839 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2843 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2845 DataArrayInt *ret1=0;
2846 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2847 PyObject *ret=PyTuple_New(2);
2848 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2849 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2853 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2855 DataArrayInt *ret1=0;
2856 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2857 PyObject *ret=PyTuple_New(2);
2858 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2859 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2863 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2865 DataArrayInt *ret1=0;
2866 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2867 PyObject *ret=PyTuple_New(2);
2868 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2869 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2873 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2875 DataArrayInt *ret1=0;
2876 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2877 PyObject *ret=PyTuple_New(2);
2878 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2879 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2883 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2885 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2893 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2896 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2897 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2898 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2899 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2900 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2901 void loadArrays() throw(INTERP_KERNEL::Exception);
2902 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2903 void unloadArrays() throw(INTERP_KERNEL::Exception);
2904 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2905 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2906 int getNumberOfFields() const;
2907 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2908 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2910 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2911 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2912 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2913 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2914 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2915 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2916 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2917 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2918 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2923 return MEDFileFields::New();
2926 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2928 return MEDFileFields::New(fileName,loadAll);
2931 std::string __str__() const throw(INTERP_KERNEL::Exception)
2933 return self->simpleRepr();
2936 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2938 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2939 std::size_t sz(tmp.size());
2940 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2941 for(std::size_t i=0;i<sz;i++)
2943 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2944 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2946 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2949 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2952 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2953 PyObject *ret=PyTuple_New(2);
2954 PyObject *ret_0=PyList_New(ret0.size());
2956 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2958 PyObject *elt=PyTuple_New(2);
2959 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2960 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2961 PyList_SetItem(ret_0,rk,elt);
2963 PyTuple_SetItem(ret,0,ret_0);
2964 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2965 PyTuple_SetItem(ret,1,ret_1);
2969 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2971 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2972 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2975 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2977 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2978 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2981 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2983 if(obj && PyList_Check(obj))
2985 int sz=PyList_Size(obj);
2986 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2987 int *pt=da->getPointer();
2988 for(int i=0;i<sz;i++,pt++)
2990 PyObject *elt1=PyList_GetItem(obj,i);
2991 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2993 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2996 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2999 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3001 self->setFieldAtPos(obj,field);
3005 int __len__() const throw(INTERP_KERNEL::Exception)
3007 return self->getNumberOfFields();
3010 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3012 return self->iterator();
3015 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3017 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3018 return self->changeMeshNames(modifTab);
3021 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3023 if(elt0 && PyInt_Check(elt0))
3025 return PyInt_AS_LONG(elt0);
3027 else if(elt0 && PyString_Check(elt0))
3028 return self->getPosFromFieldName(PyString_AsString(elt0));
3030 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3033 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3035 if(PyList_Check(elts))
3037 int sz=PyList_Size(elts);
3038 std::vector<int> ret(sz);
3039 for(int i=0;i<sz;i++)
3041 PyObject *elt=PyList_GetItem(elts,i);
3042 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3048 std::vector<int> ret(1);
3049 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3054 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3056 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3057 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3058 self->pushFields(tmp);
3061 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3063 if(elts && PySlice_Check(elts))
3065 Py_ssize_t strt=2,stp=2,step=2;
3066 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3067 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3068 self->destroyFieldsAtPos2(strt,stp,step);
3072 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3073 if(!idsToRemove.empty())
3074 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3078 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3080 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3081 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3082 return self->extractPart(extractDefCpp,mm);
3087 class MEDFileParameter1TS : public RefCountObject
3090 void setIteration(int it);
3091 int getIteration() const;
3092 void setOrder(int order);
3093 int getOrder() const;
3094 void setTimeValue(double time);
3095 void setTime(int dt, int it, double time);
3096 double getTime(int& dt, int& it);
3097 double getTimeValue() const;
3100 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3103 void setValue(double val) throw(INTERP_KERNEL::Exception);
3104 double getValue() const throw(INTERP_KERNEL::Exception);
3105 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3108 std::string __str__() const throw(INTERP_KERNEL::Exception)
3110 return self->simpleRepr();
3115 class MEDFileParameterTinyInfo : public MEDFileWritable
3118 void setDescription(const std::string& name);
3119 std::string getDescription() const;
3120 void setTimeUnit(const std::string& unit);
3121 std::string getTimeUnit() const;
3124 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3127 static MEDFileParameterDouble1TS *New();
3128 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3129 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3130 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3131 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3132 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3133 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3134 std::string getName() const throw(INTERP_KERNEL::Exception);
3135 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3138 MEDFileParameterDouble1TS()
3140 return MEDFileParameterDouble1TS::New();
3143 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3145 return MEDFileParameterDouble1TS::New(fileName);
3148 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3150 return MEDFileParameterDouble1TS::New(fileName,paramName);
3153 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3155 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3158 std::string __str__() const throw(INTERP_KERNEL::Exception)
3160 return self->simpleRepr();
3163 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3166 bool ret0=self->isEqual(other,eps,what);
3167 PyObject *res=PyList_New(2);
3168 PyObject *ret0Py=ret0?Py_True:Py_False;
3170 PyList_SetItem(res,0,ret0Py);
3171 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3177 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3180 static MEDFileParameterMultiTS *New();
3181 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3182 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3183 std::string getName() const;
3184 void setName(const std::string& name);
3185 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3186 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3187 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3188 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3189 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3190 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3191 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3192 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3195 MEDFileParameterMultiTS()
3197 return MEDFileParameterMultiTS::New();
3200 MEDFileParameterMultiTS(const std::string& fileName)
3202 return MEDFileParameterMultiTS::New(fileName);
3205 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3207 return MEDFileParameterMultiTS::New(fileName,paramName);
3210 std::string __str__() const throw(INTERP_KERNEL::Exception)
3212 return self->simpleRepr();
3215 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3218 bool ret0=self->isEqual(other,eps,what);
3219 PyObject *res=PyList_New(2);
3220 PyObject *ret0Py=ret0?Py_True:Py_False;
3222 PyList_SetItem(res,0,ret0Py);
3223 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3227 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3231 std::vector<int> pos2;
3232 DataArrayInt *pos3=0;
3233 DataArrayIntTuple *pos4=0;
3234 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3239 self->eraseTimeStepIds(&pos1,&pos1+1);
3246 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3251 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3255 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3259 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3261 if(elt0 && PyInt_Check(elt0))
3263 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3266 else if(elt0 && PyTuple_Check(elt0))
3268 if(PyTuple_Size(elt0)==2)
3270 PyObject *o0=PyTuple_GetItem(elt0,0);
3271 PyObject *o1=PyTuple_GetItem(elt0,1);
3272 if(PyInt_Check(o0) && PyInt_Check(o1))
3274 int iter=PyInt_AS_LONG(o0);
3275 int order=PyInt_AS_LONG(o1);
3276 return self->getPosOfTimeStep(iter,order);
3279 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 !");
3282 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 !");
3284 else if(elt0 && PyFloat_Check(elt0))
3286 double val=PyFloat_AS_DOUBLE(elt0);
3287 return self->getPosGivenTime(val);
3290 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3293 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3295 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3301 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3303 if(PyList_Check(elts))
3305 int sz=PyList_Size(elts);
3306 std::vector<int> ret(sz);
3307 for(int i=0;i<sz;i++)
3309 PyObject *elt=PyList_GetItem(elts,i);
3310 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3316 std::vector<int> ret(1);
3317 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3322 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3324 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3325 if(!idsToRemove.empty())
3326 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3329 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3331 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3337 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3339 std::vector< std::pair<int,int> > res=self->getIterations();
3340 PyObject *ret=PyList_New(res.size());
3342 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3344 PyObject *elt=PyTuple_New(2);
3345 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3346 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3347 PyList_SetItem(ret,rk,elt);
3352 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3354 std::vector<double> res2;
3355 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3356 PyObject *ret=PyList_New(res.size());
3358 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3360 PyObject *elt=PyTuple_New(3);
3361 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3362 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3363 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3364 PyList_SetItem(ret,rk,elt);
3371 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3374 static MEDFileParameters *New();
3375 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3376 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3377 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3378 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3379 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3380 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3381 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3382 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3383 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3384 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3385 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3390 return MEDFileParameters::New();
3393 MEDFileParameters(const std::string& fileName)
3395 return MEDFileParameters::New(fileName);
3398 std::string __str__() const throw(INTERP_KERNEL::Exception)
3400 return self->simpleRepr();
3403 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3405 if(PyInt_Check(obj))
3407 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3412 else if(PyString_Check(obj))
3414 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3420 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3423 int __len__() const throw(INTERP_KERNEL::Exception)
3425 return self->getNumberOfParams();
3428 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3430 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3436 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3438 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3444 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3447 bool ret0=self->isEqual(other,eps,what);
3448 PyObject *res=PyList_New(2);
3449 PyObject *ret0Py=ret0?Py_True:Py_False;
3451 PyList_SetItem(res,0,ret0Py);
3452 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3458 class MEDFileData : public RefCountObject, public MEDFileWritable
3461 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3462 static MEDFileData *New();
3463 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3464 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3465 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3466 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3467 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3468 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3469 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3471 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3472 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3474 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3477 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3479 return MEDFileData::New(fileName);
3484 return MEDFileData::New();
3487 std::string __str__() const throw(INTERP_KERNEL::Exception)
3489 return self->simpleRepr();
3492 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3494 MEDFileMeshes *ret=self->getMeshes();
3500 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3502 MEDFileParameters *ret=self->getParams();
3508 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3510 MEDFileFields *ret=self->getFields();
3516 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3518 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3519 return self->changeMeshNames(modifTab);
3524 class SauvReader : public RefCountObject
3527 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3528 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3531 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3533 return SauvReader::New(fileName);
3538 class SauvWriter : public RefCountObject
3541 static SauvWriter * New();
3542 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3543 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3544 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3545 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3548 SauvWriter() throw(INTERP_KERNEL::Exception)
3550 return SauvWriter::New();
3557 class MEDFileMeshStruct;
3559 class MEDFileField1TSStructItem
3562 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3565 class MEDFileMeshStruct : public RefCountObject
3568 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3570 ~MEDFileMeshStruct();
3573 class MEDMeshMultiLev : public RefCountObject
3576 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3577 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3578 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3584 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3586 DataArrayInt *famIds(0);
3587 bool isWithoutCopy(false);
3588 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3589 PyObject *ret=PyTuple_New(2);
3590 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3592 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3593 PyTuple_SetItem(ret,1,ret1Py);
3597 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3599 DataArrayInt *numIds(0);
3600 bool isWithoutCopy(false);
3601 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3602 PyObject *ret=PyTuple_New(2);
3603 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3605 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3606 PyTuple_SetItem(ret,1,ret1Py);
3610 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3612 DataArrayInt *famIds(0);
3613 bool isWithoutCopy(false);
3614 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3615 PyObject *ret=PyTuple_New(2);
3616 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3618 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3619 PyTuple_SetItem(ret,1,ret1Py);
3623 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3625 DataArrayInt *numIds(0);
3626 bool isWithoutCopy(false);
3627 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3628 PyObject *ret=PyTuple_New(2);
3629 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3631 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3632 PyTuple_SetItem(ret,1,ret1Py);
3636 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3638 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3639 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3640 PyObject *res(PyList_New(result.size()));
3641 for(int i=0;iL!=result.end(); i++, iL++)
3642 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3648 class MEDUMeshMultiLev : public MEDMeshMultiLev
3651 ~MEDUMeshMultiLev();
3655 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3657 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3658 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3659 PyObject *ret0Py=ncc?Py_True:Py_False;
3661 PyObject *ret=PyTuple_New(7);
3662 PyTuple_SetItem(ret,0,ret0Py);
3663 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3664 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3665 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3666 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3667 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3668 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3674 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3677 ~MEDStructuredMeshMultiLev();
3680 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3683 ~MEDCMeshMultiLev();
3687 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3690 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3691 std::size_t sz(objs.size());
3692 PyObject *ret(PyTuple_New(2));
3693 PyObject *ret0=PyList_New(sz);
3694 for(std::size_t i=0;i<sz;i++)
3695 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3696 PyTuple_SetItem(ret,0,ret0);
3697 PyObject *ret1Py(isInternal?Py_True:Py_False);
3699 PyTuple_SetItem(ret,1,ret1Py);
3705 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3708 ~MEDCurveLinearMeshMultiLev();
3712 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3714 DataArrayDouble *ret0(0);
3715 std::vector<int> ret1;
3717 self->buildVTUArrays(ret0,ret1,ret2);
3718 std::size_t sz(ret1.size());
3719 PyObject *ret=PyTuple_New(3);
3720 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3721 PyObject *ret1Py=PyList_New(sz);
3722 for(std::size_t i=0;i<sz;i++)
3723 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3724 PyTuple_SetItem(ret,1,ret1Py);
3725 PyObject *ret2Py(ret2?Py_True:Py_False);
3727 PyTuple_SetItem(ret,2,ret2Py);
3733 class MEDFileFastCellSupportComparator : public RefCountObject
3736 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3737 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3738 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3739 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3741 ~MEDFileFastCellSupportComparator();
3745 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3747 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3748 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3749 PyObject *res(PyList_New(result.size()));
3750 for(int i=0;iL!=result.end(); i++, iL++)
3751 PyList_SetItem(res,i,PyInt_FromLong(*iL));