1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #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::MEDFileFieldMultiTS::New;
160 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
161 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
162 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
163 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
167 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
168 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
169 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
170 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
172 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
173 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
174 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
175 %newobject MEDCoupling::MEDFileField1TS::New;
176 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
177 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
178 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
179 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
180 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
181 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
182 %newobject MEDCoupling::MEDFileField1TS::extractPart;
184 %newobject MEDCoupling::MEDFileIntField1TS::New;
185 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
186 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
188 %newobject MEDCoupling::MEDFileData::New;
189 %newobject MEDCoupling::MEDFileData::deepCopy;
190 %newobject MEDCoupling::MEDFileData::getMeshes;
191 %newobject MEDCoupling::MEDFileData::getFields;
192 %newobject MEDCoupling::MEDFileData::getParams;
194 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
195 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
196 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
197 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
198 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
199 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
200 %newobject MEDCoupling::MEDFileParameters::New;
201 %newobject MEDCoupling::MEDFileParameters::deepCopy;
202 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
203 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
204 %newobject MEDCoupling::MEDFileParameters::__getitem__;
206 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
207 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
208 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
209 %newobject MEDCoupling::MEDFileJointOneStep::New;
210 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
211 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
212 %newobject MEDCoupling::MEDFileJoint::New;
213 %newobject MEDCoupling::MEDFileJoint::deepCopy;
214 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
215 %newobject MEDCoupling::MEDFileJoints::New;
216 %newobject MEDCoupling::MEDFileJoints::deepCopy;
217 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
218 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
219 %newobject MEDCoupling::MEDFileJoints::__getitem__;
220 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
221 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
222 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
223 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
224 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
225 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
226 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
227 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
228 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
230 %newobject MEDCoupling::SauvWriter::New;
231 %newobject MEDCoupling::SauvReader::New;
232 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
234 %newobject MEDCoupling::MEDFileMeshStruct::New;
235 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
236 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
237 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
238 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
239 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
241 %feature("unref") MEDFileMesh "$this->decrRef();"
242 %feature("unref") MEDFileUMesh "$this->decrRef();"
243 %feature("unref") MEDFileCMesh "$this->decrRef();"
244 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
245 %feature("unref") MEDFileMeshes "$this->decrRef();"
246 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
247 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
248 %feature("unref") MEDFileField1TS "$this->decrRef();"
249 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
250 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
251 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
252 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
253 %feature("unref") MEDFileFields "$this->decrRef();"
254 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
255 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
256 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
257 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
258 %feature("unref") MEDFileParameters "$this->decrRef();"
259 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
260 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
261 %feature("unref") MEDFileJoint "$this->decrRef();"
262 %feature("unref") MEDFileJoints "$this->decrRef();"
263 %feature("unref") MEDFileEquivalences "$this->decrRef();"
264 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
265 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
266 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
267 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
268 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
269 %feature("unref") MEDFileData "$this->decrRef();"
270 %feature("unref") SauvReader "$this->decrRef();"
271 %feature("unref") SauvWriter "$this->decrRef();"
272 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
273 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
274 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
275 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
276 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
277 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
279 namespace MEDCoupling
282 std::string MEDFileVersionStr();
283 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
284 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
285 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
286 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
287 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
288 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
289 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
290 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
291 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
292 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
293 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
294 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
295 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
296 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
297 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
298 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
299 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
300 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
301 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
302 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
303 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
304 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
305 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);
306 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);
307 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);
308 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);
309 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);
310 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
311 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
312 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
313 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
314 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
315 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
318 %rename (MEDFileVersion) MEDFileVersionSwig;
319 %rename (GetFieldIterations) GetFieldIterationsSwig;
320 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
321 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
322 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
323 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
324 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
325 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
326 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
327 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
328 %rename (WriteUMeshes) WriteUMeshesSwig;
329 %rename (GetTypesOfField) GetTypesOfFieldSwig;
330 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
331 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
335 PyObject *MEDFileVersionSwig()
337 int major,minor,release;
338 MEDCoupling::MEDFileVersion(major,minor,release);
339 PyObject *ret(PyTuple_New(3));
340 PyTuple_SetItem(ret,0,SWIG_From_int(major));
341 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
342 PyTuple_SetItem(ret,2,SWIG_From_int(release));
346 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
348 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
349 PyObject *ret=PyList_New(res.size());
351 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
353 PyObject *elt=PyTuple_New(2);
354 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
355 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
356 PyList_SetItem(ret,rk,elt);
361 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
363 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
364 PyObject *ret=PyList_New(res.size());
366 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
368 PyObject *elt=PyTuple_New(3);
369 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
370 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
371 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
372 PyList_SetItem(ret,rk,elt);
377 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
379 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
380 PyObject *ret=PyList_New(res.size());
382 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
384 PyObject *elt=PyTuple_New(2);
385 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
386 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
387 PyList_SetItem(ret,rk,elt);
392 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
394 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
395 PyObject *ret=PyList_New(res.size());
397 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
399 PyObject *elt=PyTuple_New(2);
400 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
401 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
402 PyList_SetItem(ret,rk,elt);
407 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
409 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
410 PyObject *ret=PyList_New(res.size());
412 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
414 PyObject *elt=PyTuple_New(2);
415 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
416 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
417 PyList_SetItem(ret,rk,elt);
422 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
424 int meshDim,spaceDim,numberOfNodes;
425 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
426 PyObject *ret=PyTuple_New(4);
427 PyObject *elt0=PyList_New(res.size());
429 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
431 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
433 PyObject *elt1=PyList_New(obj2.size());
434 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
436 PyObject *elt2=PyTuple_New(2);
437 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
438 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
439 PyList_SetItem(elt1,j,elt2);
441 PyList_SetItem(elt0,i,elt1);
443 PyTuple_SetItem(ret,0,elt0);
444 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
445 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
446 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
450 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
451 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
453 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
454 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
455 return convertFieldDoubleVecToPy(res);
458 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
460 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
461 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
462 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
465 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
467 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
468 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
469 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
472 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
474 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
475 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
476 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
479 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
481 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
483 PyObject *ret=PyList_New(size);
484 for(int i=0;i<size;i++)
485 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
489 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
491 std::vector<std::string> grps;
492 converPyListToVecString(li,grps);
493 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
496 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
498 std::vector<std::string> fams;
499 converPyListToVecString(li,fams);
500 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
504 namespace MEDCoupling
506 class MEDFileWritable
509 void copyOptionsFrom(const MEDFileWritable& other) const;
510 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
511 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
512 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
513 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
516 class MEDFileMeshReadSelector
519 MEDFileMeshReadSelector();
520 MEDFileMeshReadSelector(unsigned int code);
521 unsigned int getCode() const;
522 void setCode(unsigned int newCode);
523 bool isCellFamilyFieldReading() const;
524 bool isNodeFamilyFieldReading() const;
525 bool isCellNameFieldReading() const;
526 bool isNodeNameFieldReading() const;
527 bool isCellNumFieldReading() const;
528 bool isNodeNumFieldReading() const;
529 void setCellFamilyFieldReading(bool b);
530 void setNodeFamilyFieldReading(bool b);
531 void setCellNameFieldReading(bool b);
532 void setNodeNameFieldReading(bool b);
533 void setCellNumFieldReading(bool b);
534 void setNodeNumFieldReading(bool b);
537 std::string __str__() const throw(INTERP_KERNEL::Exception)
539 std::ostringstream oss;
544 std::string __repr__() const throw(INTERP_KERNEL::Exception)
546 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
552 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
555 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
556 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
557 throw(INTERP_KERNEL::Exception);
558 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
559 INTERP_KERNEL::NormalizedCellType loc_geo_type,
560 INTERP_KERNEL::NormalizedCellType rem_geo_type)
561 throw(INTERP_KERNEL::Exception);
562 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
563 MEDFileJointCorrespondence *deepCopy() const;
564 MEDFileJointCorrespondence *shallowCpy() const;
565 void setIsNodal(bool isNodal);
566 bool getIsNodal() const;
567 bool isEqual(const MEDFileJointCorrespondence *other) const;
568 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
569 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
570 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
571 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
572 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
573 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
574 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);
575 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
578 MEDFileJointCorrespondence()
580 return MEDFileJointCorrespondence::New();
582 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
584 return MEDFileJointCorrespondence::New(correspondence);
586 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
587 INTERP_KERNEL::NormalizedCellType loc_geo_type,
588 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
590 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
593 std::string __str__() const throw(INTERP_KERNEL::Exception)
595 return self->simpleRepr();
600 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
603 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
604 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
605 MEDFileJointOneStep *deepCopy() const;
606 MEDFileJointOneStep *shallowCpy() const;
607 bool isEqual(const MEDFileJointOneStep *other) const;
608 void setOrder(int order);
609 int getOrder() const;
610 void setIteration(int it);
611 int getIteration() const;
612 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
613 int getNumberOfCorrespondences() const;
614 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
615 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
616 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
619 MEDFileJointOneStep()
621 return MEDFileJointOneStep::New();
624 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
626 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
629 std::string __str__() const throw(INTERP_KERNEL::Exception)
631 return self->simpleRepr();
636 class MEDFileJoint : public RefCountObject, public MEDFileWritable
639 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
640 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
641 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
642 MEDFileJoint *deepCopy() const;
643 MEDFileJoint *shallowCpy() const;
644 bool isEqual(const MEDFileJoint *other) const;
645 void setLocalMeshName(const std::string& name);
646 std::string getLocalMeshName() const;
647 void setRemoteMeshName(const std::string& name);
648 std::string getRemoteMeshName() const;
649 void setDescription(const std::string& name);
650 std::string getDescription() const;
651 void setJointName(const std::string& name);
652 std::string getJointName() const;
653 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
654 void setDomainNumber(const int& number);
655 int getDomainNumber() const;
656 void pushStep(MEDFileJointOneStep* step);
657 int getNumberOfSteps() const;
658 MEDFileJointOneStep *getStepAtPos(int i) const;
659 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
660 std::string simpleRepr() const;
665 return MEDFileJoint::New();
668 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
670 return MEDFileJoint::New(fileName,mName,num);
673 std::string __str__() const throw(INTERP_KERNEL::Exception)
675 return self->simpleRepr();
680 class MEDFileJoints : public RefCountObject, public MEDFileWritable
683 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
684 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
685 MEDFileJoints *deepCopy() const;
686 std::string simpleRepr() const;
687 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
688 std::string getMeshName() const;
689 int getNumberOfJoints() const;
690 std::vector<std::string> getJointsNames() const;
691 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
692 void resize(int newSize) throw(INTERP_KERNEL::Exception);
693 void pushJoint(MEDFileJoint *joint);
694 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
695 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
700 return MEDFileJoints::New();
703 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
705 return MEDFileJoints::New(fileName,meshName);
708 std::string __str__() const throw(INTERP_KERNEL::Exception)
710 return self->simpleRepr();
713 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
717 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
722 else if(PyString_Check(obj))
724 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
730 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
733 int __len__() const throw(INTERP_KERNEL::Exception)
735 return self->getNumberOfJoints();
738 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
740 MEDFileJoint *ret=self->getJointAtPos(i);
746 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
748 MEDFileJoint *ret=self->getJointWithName(paramName);
756 class MEDFileEquivalenceBase : public RefCountObject
759 MEDFileEquivalenceBase();
762 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
765 MEDFileEquivalenceData();
767 void setArray(DataArrayInt *data);
770 DataArrayInt *getArray()
772 DataArrayInt *ret(self->getArray());
773 if(ret) ret->incrRef();
779 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
782 MEDFileEquivalenceNode();
785 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
788 MEDFileEquivalenceCell();
791 std::size_t size() const;
792 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
793 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
796 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
798 DataArrayInt *ret(self->getArray(type));
799 if(ret) ret->incrRef();
803 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
805 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
806 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
807 PyObject *res=PyList_New(result.size());
808 for(int i=0;iL!=result.end(); i++, iL++)
809 PyList_SetItem(res,i,PyInt_FromLong(*iL));
815 class MEDFileEquivalencePair : public RefCountObject
818 MEDFileEquivalencePair();
820 std::string getName() const;
821 void setName(const std::string& name);
822 std::string getDescription() const;
823 void setDescription(const std::string& descr);
824 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
827 MEDFileEquivalenceCell *initCell()
829 MEDFileEquivalenceCell *ret(self->initCell());
830 if(ret) ret->incrRef();
834 MEDFileEquivalenceNode *initNode()
836 MEDFileEquivalenceNode *ret(self->initNode());
837 if(ret) ret->incrRef();
841 MEDFileEquivalenceCell *getCell()
843 MEDFileEquivalenceCell *ret(self->getCell());
844 if(ret) ret->incrRef();
848 MEDFileEquivalenceNode *getNode()
850 MEDFileEquivalenceNode *ret(self->getNode());
851 if(ret) ret->incrRef();
857 class MEDFileEquivalences : public RefCountObject
860 MEDFileEquivalences();
863 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
864 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
865 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
869 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
871 MEDFileEquivalencePair *ret(self->getEquivalence(i));
872 if(ret) ret->incrRef();
875 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
877 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
878 if(ret) ret->incrRef();
882 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
884 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
885 if(ret) ret->incrRef();
891 class MEDFileMesh : public RefCountObject, public MEDFileWritable
894 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
895 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
896 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
897 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
898 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
899 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
900 void setName(const std::string& name);
901 std::string getName();
902 std::string getUnivName() const;
903 bool getUnivNameWrStatus() const;
904 void setUnivNameWrStatus(bool newStatus);
905 void setDescription(const std::string& name);
906 std::string getDescription() const;
907 void setOrder(int order);
908 int getOrder() const;
909 void setIteration(int it);
911 void setTimeValue(double time);
912 void setTime(int dt, int it, double time);
913 double getTimeValue() const;
914 void setTimeUnit(const std::string& unit);
915 std::string getTimeUnit() const;
916 void setAxisType(MEDCouplingAxisType at);
917 MEDCouplingAxisType getAxisType() const;
918 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
919 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
920 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
921 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
922 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
923 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
924 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
925 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
926 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
927 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
928 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
929 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
930 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
931 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
932 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
934 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
935 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
936 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
937 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
938 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
939 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
940 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
941 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
942 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
943 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
944 void clearGrpMap() throw(INTERP_KERNEL::Exception);
945 void clearFamMap() throw(INTERP_KERNEL::Exception);
946 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
947 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
948 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
949 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
950 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
951 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
952 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
953 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
954 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
955 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
956 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
957 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
958 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
959 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
960 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
961 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
962 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
963 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
964 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
965 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
966 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
967 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
968 static std::string GetMagicFamilyStr();
969 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
970 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
971 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
972 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
973 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
974 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
975 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
976 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
977 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
978 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
979 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
980 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
981 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
982 void setFamilyInfo(const std::map<std::string,int>& info);
983 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
984 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
985 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
986 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
987 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
988 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
989 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
990 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
991 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
992 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
993 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
994 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
995 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
996 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
997 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
998 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
999 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1000 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1001 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1002 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1003 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1005 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1006 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1007 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1008 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1009 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1010 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1011 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1012 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1013 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1014 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1015 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1016 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1017 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1018 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1019 int getNumberOfJoints();
1020 MEDFileJoints *getJoints();
1021 void setJoints( MEDFileJoints* joints );
1022 void initializeEquivalences();
1023 void killEquivalences();
1026 std::string __str__() const throw(INTERP_KERNEL::Exception)
1028 return self->simpleRepr();
1031 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1033 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1036 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1039 double tmp0=self->getTime(tmp1,tmp2);
1040 PyObject *res = PyList_New(3);
1041 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1042 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1043 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1047 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1050 bool ret0=self->isEqual(other,eps,what);
1051 PyObject *res=PyList_New(2);
1052 PyObject *ret0Py=ret0?Py_True:Py_False;
1054 PyList_SetItem(res,0,ret0Py);
1055 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1059 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1061 std::vector<const DataArrayInt *> grps;
1062 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1063 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1066 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1069 bool ret0=self->areFamsEqual(other,what);
1070 PyObject *res=PyList_New(2);
1071 PyObject *ret0Py=ret0?Py_True:Py_False;
1073 PyList_SetItem(res,0,ret0Py);
1074 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1078 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1081 bool ret0=self->areGrpsEqual(other,what);
1082 PyObject *res=PyList_New(2);
1083 PyObject *ret0Py=ret0?Py_True:Py_False;
1085 PyList_SetItem(res,0,ret0Py);
1086 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1090 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1092 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1093 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1094 PyObject *res=PyList_New(result.size());
1095 for(int i=0;iL!=result.end(); i++, iL++)
1096 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1100 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1102 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1103 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1104 PyObject *res=PyList_New(result.size());
1105 for(int i=0;iL!=result.end(); i++, iL++)
1106 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1110 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1112 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1115 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1118 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1120 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1123 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1126 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1128 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1131 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1134 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1136 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1139 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1142 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1144 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1147 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1150 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1153 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1154 PyObject *ret=PyTuple_New(2);
1155 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1156 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1160 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1162 DataArrayInt *ret3=0;
1163 std::vector<int> ret1,ret2;
1164 bool ret0=self->unPolyze(ret1,ret2,ret3);
1165 PyObject *ret=PyTuple_New(4);
1166 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1168 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1169 for(int j=0;j<(int)ret1.size()/3;j++)
1171 PyObject *retLev2=PyList_New(3);
1172 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1173 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1174 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1175 PyList_SetItem(retLev1_0,j,retLev2);
1177 PyTuple_SetItem(ret,1,retLev1_0);
1179 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1180 for(int j=0;j<(int)ret2.size()/3;j++)
1182 PyObject *retLev2=PyList_New(3);
1183 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1184 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1185 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1186 PyList_SetItem(retLev1_1,j,retLev2);
1188 PyTuple_SetItem(ret,2,retLev1_1);
1190 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1194 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1196 MEDFileEquivalences *ret(self->getEquivalences());
1197 if(ret) ret->incrRef();
1203 class MEDFileUMesh : public MEDFileMesh
1206 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1207 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1208 static MEDFileUMesh *New();
1210 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1211 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1212 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1213 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1214 void clearNodeAndCellNumbers();
1216 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1217 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1218 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1219 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1220 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1221 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1222 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1223 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1224 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1225 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1227 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1228 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1229 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1230 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1231 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1232 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1233 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1234 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1235 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1236 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1237 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1238 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1239 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1242 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1244 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1247 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1249 return MEDFileUMesh::New(fileName,mrs);
1254 return MEDFileUMesh::New();
1258 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1260 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1263 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)
1265 std::vector<int> typesCpp1;
1266 convertPyToNewIntArr3(types,typesCpp1);
1267 std::size_t sz(typesCpp1.size());
1268 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1269 for(std::size_t ii=0;ii<sz;ii++)
1270 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1271 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1274 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1275 {// put an empty dict in input to say to __new__ to call __init__...
1276 PyObject *ret(PyTuple_New(1));
1277 PyObject *ret0(PyDict_New());
1278 PyTuple_SetItem(ret,0,ret0);
1282 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1284 std::vector<double> a0;
1285 std::vector<int> a1;
1286 std::vector<std::string> a2;
1287 std::vector< MCAuto<DataArrayInt> > a3;
1288 MCAuto<DataArrayDouble> a4;
1289 self->serialize(a0,a1,a2,a3,a4);
1290 PyObject *ret(PyTuple_New(5));
1291 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1292 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1294 PyObject *ret2(PyList_New(sz));
1295 for(int i=0;i<sz;i++)
1296 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1297 PyTuple_SetItem(ret,2,ret2);
1299 PyObject *ret3(PyList_New(sz));
1300 for(int i=0;i<sz;i++)
1302 DataArrayInt *elt(a3[i]);
1305 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1307 PyTuple_SetItem(ret,3,ret3);
1308 DataArrayDouble *ret4(a4);
1311 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1315 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1317 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1318 if(!PyTuple_Check(inp))
1319 throw INTERP_KERNEL::Exception(MSG);
1320 int sz(PyTuple_Size(inp));
1322 throw INTERP_KERNEL::Exception(MSG);
1323 std::vector<double> a0;
1324 std::vector<int> a1;
1325 std::vector<std::string> a2;
1326 std::vector< MCAuto<DataArrayInt> > a3;
1327 MCAuto<DataArrayDouble> a4;
1329 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1331 fillArrayWithPyListDbl3(a0py,tmp,a0);
1332 convertPyToNewIntArr3(a1py,a1);
1333 fillStringVector(a2py,a2);
1335 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1337 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1338 if(!SWIG_IsOK(status))
1339 throw INTERP_KERNEL::Exception(MSG);
1340 a4=reinterpret_cast<DataArrayDouble *>(argp);
1341 if((DataArrayDouble *)a4)
1344 std::vector< DataArrayInt * > a3Tmp;
1345 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1346 std::size_t sz(a3Tmp.size());
1348 for(std::size_t i=0;i<sz;i++)
1352 a3Tmp[i]->incrRef();
1354 self->unserialize(a0,a1,a2,a3,a4);
1358 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1361 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1362 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1365 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1368 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1371 self->setMeshAtLevel(meshDimRelToMax,m1);
1374 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1377 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1379 self->removeMeshAtLevel(meshDimRelToMax);
1382 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1384 std::vector<const MEDCouplingUMesh *> ms;
1385 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1386 self->setMeshes(ms,renum);
1389 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1391 std::vector<const MEDCouplingUMesh *> ms;
1392 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1393 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1396 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1398 std::vector<const MEDCouplingUMesh *> ms;
1399 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1400 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1403 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1405 DataArrayDouble *ret=self->getCoords();
1411 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1413 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1416 return const_cast<PartDefinition *>(ret);
1419 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1421 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1422 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1423 PyObject *ret=PyTuple_New(3);
1424 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1425 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1430 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1432 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1438 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1440 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1441 std::size_t sz(tmp.size());
1442 PyObject *ret=PyList_New(sz);
1443 for(std::size_t i=0;i<sz;i++)
1447 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1454 class MEDFileStructuredMesh : public MEDFileMesh
1459 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1461 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1469 class MEDFileCMesh : public MEDFileStructuredMesh
1472 static MEDFileCMesh *New();
1473 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1474 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1475 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1476 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1481 return MEDFileCMesh::New();
1484 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1486 return MEDFileCMesh::New(fileName,mrs);
1489 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1491 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1494 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1496 const MEDCouplingCMesh *tmp=self->getMesh();
1499 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1504 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1507 static MEDFileCurveLinearMesh *New();
1508 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1509 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1510 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1513 MEDFileCurveLinearMesh()
1515 return MEDFileCurveLinearMesh::New();
1518 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1520 return MEDFileCurveLinearMesh::New(fileName,mrs);
1523 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1525 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1528 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1530 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1533 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1538 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1541 static MEDFileMeshMultiTS *New();
1542 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1543 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1544 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1545 std::string getName() const throw(INTERP_KERNEL::Exception);
1546 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1547 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1548 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1551 MEDFileMeshMultiTS()
1553 return MEDFileMeshMultiTS::New();
1556 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1558 return MEDFileMeshMultiTS::New(fileName);
1561 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1563 return MEDFileMeshMultiTS::New(fileName,mName);
1566 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1568 MEDFileMesh *ret=self->getOneTimeStep();
1576 class MEDFileMeshesIterator
1581 PyObject *next() throw(INTERP_KERNEL::Exception)
1583 MEDFileMesh *ret=self->nextt();
1587 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1591 PyErr_SetString(PyExc_StopIteration,"No more data.");
1598 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1601 static MEDFileMeshes *New();
1602 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1603 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1604 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1605 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1606 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1608 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1609 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1610 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1611 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1612 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1617 return MEDFileMeshes::New();
1620 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1622 return MEDFileMeshes::New(fileName);
1625 std::string __str__() const throw(INTERP_KERNEL::Exception)
1627 return self->simpleRepr();
1630 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1632 if(PyInt_Check(obj))
1634 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1639 else if(PyString_Check(obj))
1641 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1647 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1650 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1652 self->setMeshAtPos(obj,mesh);
1656 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1658 return self->iterator();
1661 int __len__() const throw(INTERP_KERNEL::Exception)
1663 return self->getNumberOfMeshes();
1666 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1668 MEDFileMesh *ret=self->getMeshAtPos(i);
1673 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1675 MEDFileMesh *ret=self->getMeshWithName(mname);
1683 class MEDFileFieldLoc : public RefCountObject
1686 std::string getName() const;
1687 int getDimension() const;
1688 int getNumberOfGaussPoints() const;
1689 int getNumberOfPointsInCells() const;
1690 const std::vector<double>& getRefCoords() const;
1691 const std::vector<double>& getGaussCoords() const;
1692 const std::vector<double>& getGaussWeights() const;
1693 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1696 std::string __str__() const throw(INTERP_KERNEL::Exception)
1698 return self->repr();
1703 class MEDFileFieldGlobsReal
1706 void resetContent();
1707 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1708 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1709 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1710 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1711 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1712 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1713 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1714 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1715 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1716 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1717 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1718 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1719 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1720 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1721 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1722 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1723 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1724 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1725 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1726 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1727 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1728 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1729 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1730 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1731 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1732 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1735 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1737 const DataArrayInt *ret=self->getProfile(pflName);
1740 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1743 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1745 const DataArrayInt *ret=self->getProfileFromId(pflId);
1748 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1751 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1753 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1756 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1759 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1761 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1764 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1767 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1769 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1770 return convertVecPairVecStToPy(ret);
1773 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1775 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1776 return convertVecPairVecStToPy(ret);
1779 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1781 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1782 self->changePflsNames(v);
1785 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1787 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1788 self->changePflsRefsNamesGen(v);
1791 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1793 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1794 self->changePflsNamesInStruct(v);
1797 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1799 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1800 self->changeLocsNames(v);
1803 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1805 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1806 self->changeLocsRefsNamesGen(v);
1809 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1811 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1812 self->changeLocsNamesInStruct(v);
1815 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1817 std::ostringstream oss;
1818 self->simpleReprGlobs(oss);
1824 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1827 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1828 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1829 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1830 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1831 void loadArrays() throw(INTERP_KERNEL::Exception);
1832 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1833 void unloadArrays() throw(INTERP_KERNEL::Exception);
1834 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1835 int getDimension() const throw(INTERP_KERNEL::Exception);
1836 int getIteration() const throw(INTERP_KERNEL::Exception);
1837 int getOrder() const throw(INTERP_KERNEL::Exception);
1838 std::string getName() throw(INTERP_KERNEL::Exception);
1839 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1840 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1841 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1842 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1843 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1844 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1845 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1846 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1847 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1848 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1849 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1850 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1851 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1852 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1853 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1856 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1859 double tmp0=self->getTime(tmp1,tmp2);
1860 PyObject *res = PyList_New(3);
1861 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1862 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1863 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1867 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1869 std::pair<int,int> res=self->getDtIt();
1870 PyObject *elt=PyTuple_New(2);
1871 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1872 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1876 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1878 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1881 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1883 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1886 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1888 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1889 return self->changeMeshNames(modifTab);
1892 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1894 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1895 PyObject *ret2=PyList_New(ret.size());
1896 for(int i=0;i<(int)ret.size();i++)
1897 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1901 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1903 std::vector<int> ret1;
1904 int ret0=self->getNonEmptyLevels(mname,ret1);
1905 PyObject *elt=PyTuple_New(2);
1906 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1907 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1911 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1913 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1914 std::vector< std::vector<TypeOfField> > typesF;
1915 std::vector< std::vector<std::string> > pfls;
1916 std::vector< std::vector<std::string> > locs;
1917 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1919 PyObject *ret2=PyList_New(sz);
1920 for(int i=0;i<sz;i++)
1922 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1923 const std::vector<TypeOfField>& typesFI=typesF[i];
1924 const std::vector<std::string>& pflsI=pfls[i];
1925 const std::vector<std::string>& locsI=locs[i];
1926 PyObject *elt=PyTuple_New(2);
1927 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1928 int sz2=ret[i].size();
1929 PyObject *elt2=PyList_New(sz2);
1930 for(int j=0;j<sz2;j++)
1932 PyObject *elt3=PyTuple_New(4);
1933 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1934 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));
1935 PyTuple_SetItem(elt3,1,elt4);
1936 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1937 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1938 PyList_SetItem(elt2,j,elt3);
1940 PyTuple_SetItem(elt,1,elt2);
1941 PyList_SetItem(ret2,i,elt);
1946 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1948 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1949 std::size_t sz=ret.size();
1950 PyObject *retPy=PyList_New(sz);
1951 for(std::size_t i=0;i<sz;i++)
1952 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1956 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1958 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1959 std::size_t sz=ret.size();
1960 PyObject *retPy=PyList_New(sz);
1961 for(std::size_t i=0;i<sz;i++)
1962 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1966 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1968 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1969 std::size_t sz=ret.size();
1970 PyObject *retPy=PyList_New(sz);
1971 for(std::size_t i=0;i<sz;i++)
1972 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1978 class MEDFileField1TS : public MEDFileAnyTypeField1TS
1981 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1982 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1983 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1984 static MEDFileField1TS *New();
1985 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
1986 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1987 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1988 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1989 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1990 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
1992 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
1993 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
1994 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1995 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
1998 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2000 return MEDFileField1TS::New(fileName,loadAll);
2003 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2005 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2008 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2010 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2015 return MEDFileField1TS::New();
2018 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2020 const DataArrayDouble *arr=0;
2022 arr=field->getArray();
2023 self->copyTinyInfoFrom(field,arr);
2026 std::string __str__() const throw(INTERP_KERNEL::Exception)
2028 return self->simpleRepr();
2031 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2033 DataArrayInt *ret1=0;
2034 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2035 PyObject *ret=PyTuple_New(2);
2036 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2037 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2041 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2043 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2044 std::vector< std::vector<TypeOfField> > typesF;
2045 std::vector< std::vector<std::string> > pfls;
2046 std::vector< std::vector<std::string> > locs;
2047 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2049 PyObject *ret2=PyList_New(sz);
2050 for(int i=0;i<sz;i++)
2052 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2053 const std::vector<TypeOfField>& typesFI=typesF[i];
2054 const std::vector<std::string>& pflsI=pfls[i];
2055 const std::vector<std::string>& locsI=locs[i];
2056 PyObject *elt=PyTuple_New(2);
2057 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2058 int sz2=ret[i].size();
2059 PyObject *elt2=PyList_New(sz2);
2060 for(int j=0;j<sz2;j++)
2062 PyObject *elt3=PyTuple_New(4);
2063 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2064 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2065 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2066 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2067 PyList_SetItem(elt2,j,elt3);
2069 PyTuple_SetItem(elt,1,elt2);
2070 PyList_SetItem(ret2,i,elt);
2075 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2077 DataArrayDouble *ret=self->getUndergroundDataArray();
2083 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2085 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2086 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2089 PyObject *ret=PyTuple_New(2);
2090 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2091 std::size_t sz=elt1Cpp.size();
2092 PyObject *elt=PyList_New(sz);
2093 for(std::size_t i=0;i<sz;i++)
2095 PyObject *elt1=PyTuple_New(2);
2096 PyObject *elt2=PyTuple_New(2);
2097 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2098 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2099 PyObject *elt3=PyTuple_New(2);
2100 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2101 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2102 PyTuple_SetItem(elt1,0,elt2);
2103 PyTuple_SetItem(elt1,1,elt3);
2104 PyList_SetItem(elt,i,elt1);
2106 PyTuple_SetItem(ret,1,elt);
2110 MEDFileField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2112 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2113 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2114 return self->extractPart(extractDefCpp,mm);
2119 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2122 static MEDFileIntField1TS *New();
2123 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2124 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2125 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2126 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2128 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2129 void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2132 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2134 return MEDFileIntField1TS::New();
2137 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2139 return MEDFileIntField1TS::New(fileName,loadAll);
2142 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2144 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2147 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2149 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2152 std::string __str__() const throw(INTERP_KERNEL::Exception)
2154 return self->simpleRepr();
2157 PyObject *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2159 DataArrayInt *ret1=0;
2160 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
2161 PyObject *ret=PyTuple_New(2);
2162 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2163 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2167 PyObject *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2169 DataArrayInt *ret1=0;
2170 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
2171 PyObject *ret=PyTuple_New(2);
2172 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2173 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2179 DataArrayInt *ret1=0;
2180 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
2181 PyObject *ret=PyTuple_New(2);
2182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2187 PyObject *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2189 DataArrayInt *ret1=0;
2190 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
2191 PyObject *ret=PyTuple_New(2);
2192 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2193 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2197 PyObject *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2199 DataArrayInt *ret1=0;
2200 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
2201 PyObject *ret=PyTuple_New(2);
2202 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2203 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2209 DataArrayInt *ret1=0;
2210 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2211 PyObject *ret=PyTuple_New(2);
2212 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2213 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2217 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2219 DataArrayInt *ret=self->getUndergroundDataArray();
2227 class MEDFileAnyTypeFieldMultiTSIterator
2232 PyObject *next() throw(INTERP_KERNEL::Exception)
2234 MEDFileAnyTypeField1TS *ret=self->nextt();
2236 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2239 PyErr_SetString(PyExc_StopIteration,"No more data.");
2246 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2249 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2250 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2251 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2252 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2253 std::string getName() const throw(INTERP_KERNEL::Exception);
2254 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2255 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2256 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2257 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2258 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2259 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2260 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2261 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2262 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2263 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2264 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2265 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2266 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2267 void loadArrays() throw(INTERP_KERNEL::Exception);
2268 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2269 void unloadArrays() throw(INTERP_KERNEL::Exception);
2270 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2272 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2273 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2274 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2275 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2276 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2279 int __len__() const throw(INTERP_KERNEL::Exception)
2281 return self->getNumberOfTS();
2284 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2286 if(elt0 && PyInt_Check(elt0))
2288 int pos=PyInt_AS_LONG(elt0);
2291 else if(elt0 && PyTuple_Check(elt0))
2293 if(PyTuple_Size(elt0)==2)
2295 PyObject *o0=PyTuple_GetItem(elt0,0);
2296 PyObject *o1=PyTuple_GetItem(elt0,1);
2297 if(PyInt_Check(o0) && PyInt_Check(o1))
2299 int iter=PyInt_AS_LONG(o0);
2300 int order=PyInt_AS_LONG(o1);
2301 return self->getPosOfTimeStep(iter,order);
2304 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 !");
2307 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 !");
2309 else if(elt0 && PyFloat_Check(elt0))
2311 double val=PyFloat_AS_DOUBLE(elt0);
2312 return self->getPosGivenTime(val);
2315 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2318 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2320 std::vector< std::pair<int,int> > res=self->getIterations();
2321 PyObject *ret=PyList_New(res.size());
2323 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2325 PyObject *elt=PyTuple_New(2);
2326 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2327 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2328 PyList_SetItem(ret,rk,elt);
2333 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2335 std::vector<double> ret1;
2336 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2337 std::size_t sz=ret.size();
2338 PyObject *ret2=PyList_New(sz);
2339 for(std::size_t i=0;i<sz;i++)
2341 PyObject *elt=PyTuple_New(3);
2342 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2343 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2344 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2345 PyList_SetItem(ret2,i,elt);
2350 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2352 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2353 PyObject *ret2=PyList_New(ret.size());
2354 for(int i=0;i<(int)ret.size();i++)
2356 const std::vector<TypeOfField>& rett=ret[i];
2357 PyObject *ret3=PyList_New(rett.size());
2358 for(int j=0;j<(int)rett.size();j++)
2359 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2360 PyList_SetItem(ret2,i,ret3);
2365 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2367 std::vector<int> ret1;
2368 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2369 PyObject *elt=PyTuple_New(2);
2370 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2371 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2375 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2377 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2378 std::vector< std::vector<TypeOfField> > typesF;
2379 std::vector< std::vector<std::string> > pfls;
2380 std::vector< std::vector<std::string> > locs;
2381 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2383 PyObject *ret2=PyList_New(sz);
2384 for(int i=0;i<sz;i++)
2386 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2387 const std::vector<TypeOfField>& typesFI=typesF[i];
2388 const std::vector<std::string>& pflsI=pfls[i];
2389 const std::vector<std::string>& locsI=locs[i];
2390 PyObject *elt=PyTuple_New(2);
2391 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2392 int sz2=ret[i].size();
2393 PyObject *elt2=PyList_New(sz2);
2394 for(int j=0;j<sz2;j++)
2396 PyObject *elt3=PyTuple_New(4);
2397 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2398 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));
2399 PyTuple_SetItem(elt3,1,elt4);
2400 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2401 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2402 PyList_SetItem(elt2,j,elt3);
2404 PyTuple_SetItem(elt,1,elt2);
2405 PyList_SetItem(ret2,i,elt);
2410 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2412 if(PyList_Check(elts))
2414 int sz=PyList_Size(elts);
2415 std::vector<int> ret(sz);
2416 for(int i=0;i<sz;i++)
2418 PyObject *elt=PyList_GetItem(elts,i);
2419 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2425 std::vector<int> ret(1);
2426 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2431 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2433 if(PySlice_Check(elts))
2435 Py_ssize_t strt=2,stp=2,step=2;
2436 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2437 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2438 self->eraseTimeStepIds2(strt,stp,step);
2442 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2443 if(!idsToRemove.empty())
2444 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2448 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2452 std::vector<int> pos2;
2453 DataArrayInt *pos3=0;
2454 DataArrayIntTuple *pos4=0;
2455 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2460 self->eraseTimeStepIds(&pos1,&pos1+1);
2467 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2472 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2476 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2480 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2482 return self->iterator();
2485 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2487 if(elt0 && PyList_Check(elt0))
2489 int sz=PyList_Size(elt0);
2490 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2491 int *pt=da->getPointer();
2492 for(int i=0;i<sz;i++,pt++)
2494 PyObject *elt1=PyList_GetItem(elt0,i);
2495 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2497 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2499 else if(elt0 && PySlice_Check(elt0))
2501 Py_ssize_t strt=2,stp=2,step=2;
2502 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2503 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2504 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2507 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2510 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2512 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2513 return self->changeMeshNames(modifTab);
2516 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2518 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2519 std::size_t sz=ret.size();
2520 PyObject *retPy=PyList_New(sz);
2521 for(std::size_t i=0;i<sz;i++)
2522 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2526 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2528 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2529 std::size_t sz=ret.size();
2530 PyObject *retPy=PyList_New(sz);
2531 for(std::size_t i=0;i<sz;i++)
2532 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2536 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2538 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2539 std::size_t sz=ret.size();
2540 PyObject *retPy=PyList_New(sz);
2541 for(std::size_t i=0;i<sz;i++)
2542 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2546 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2549 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2550 if(SWIG_IsOK(status))
2552 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2556 std::vector<MEDFileAnyTypeField1TS *> tmp;
2557 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2558 self->pushBackTimeSteps(tmp);
2562 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
2564 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2565 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2566 return self->extractPart(extractDefCpp,mm);
2569 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2571 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2572 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2573 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2574 std::size_t sz=ret.size();
2575 PyObject *retPy=PyList_New(sz);
2576 for(std::size_t i=0;i<sz;i++)
2578 std::size_t sz2=ret[i].size();
2579 PyObject *ret1Py=PyList_New(sz2);
2580 for(std::size_t j=0;j<sz2;j++)
2582 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2585 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2587 PyList_SetItem(retPy,i,ret1Py);
2592 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2594 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2595 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2596 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2597 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2598 if(ret2.size()!=ret.size())
2600 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2601 throw INTERP_KERNEL::Exception(oss.str().c_str());
2603 std::size_t sz=ret.size();
2604 PyObject *retPy=PyList_New(sz);
2605 for(std::size_t i=0;i<sz;i++)
2607 std::size_t sz2=ret[i].size();
2608 PyObject *ret0Py=PyTuple_New(2);
2609 PyObject *ret1Py=PyList_New(sz2);
2610 for(std::size_t j=0;j<sz2;j++)
2612 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2615 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2617 PyTuple_SetItem(ret0Py,0,ret1Py);
2618 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2619 PyList_SetItem(retPy,i,ret0Py);
2626 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2629 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2630 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2631 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2633 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2634 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2635 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2636 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2637 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2639 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2640 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2641 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2644 MEDFileFieldMultiTS()
2646 return MEDFileFieldMultiTS::New();
2649 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2651 return MEDFileFieldMultiTS::New(fileName,loadAll);
2654 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2656 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2659 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2661 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2662 std::size_t sz(tmp.size());
2663 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2664 for(std::size_t i=0;i<sz;i++)
2666 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2667 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2669 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2672 std::string __str__() const throw(INTERP_KERNEL::Exception)
2674 return self->simpleRepr();
2677 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2679 DataArrayInt *ret1=0;
2680 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2681 PyObject *ret=PyTuple_New(2);
2682 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2683 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2687 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2689 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2690 std::vector< std::vector<TypeOfField> > typesF;
2691 std::vector< std::vector<std::string> > pfls;
2692 std::vector< std::vector<std::string> > locs;
2693 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2695 PyObject *ret2=PyList_New(sz);
2696 for(int i=0;i<sz;i++)
2698 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2699 const std::vector<TypeOfField>& typesFI=typesF[i];
2700 const std::vector<std::string>& pflsI=pfls[i];
2701 const std::vector<std::string>& locsI=locs[i];
2702 PyObject *elt=PyTuple_New(2);
2703 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2704 int sz2=ret[i].size();
2705 PyObject *elt2=PyList_New(sz2);
2706 for(int j=0;j<sz2;j++)
2708 PyObject *elt3=PyTuple_New(4);
2709 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2710 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2711 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2712 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2713 PyList_SetItem(elt2,j,elt3);
2715 PyTuple_SetItem(elt,1,elt2);
2716 PyList_SetItem(ret2,i,elt);
2720 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2722 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2728 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2730 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2731 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2734 PyObject *ret=PyTuple_New(2);
2735 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2736 std::size_t sz=elt1Cpp.size();
2737 PyObject *elt=PyList_New(sz);
2738 for(std::size_t i=0;i<sz;i++)
2740 PyObject *elt1=PyTuple_New(2);
2741 PyObject *elt2=PyTuple_New(2);
2742 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2743 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2744 PyObject *elt3=PyTuple_New(2);
2745 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2746 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2747 PyTuple_SetItem(elt1,0,elt2);
2748 PyTuple_SetItem(elt1,1,elt3);
2749 PyList_SetItem(elt,i,elt1);
2751 PyTuple_SetItem(ret,1,elt);
2757 class MEDFileFieldsIterator
2762 PyObject *next() throw(INTERP_KERNEL::Exception)
2764 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2766 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2769 PyErr_SetString(PyExc_StopIteration,"No more data.");
2776 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2779 static MEDFileIntFieldMultiTS *New();
2780 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2781 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2783 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
2784 void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2785 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2788 MEDFileIntFieldMultiTS()
2790 return MEDFileIntFieldMultiTS::New();
2793 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2795 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2798 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2800 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2803 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2805 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2806 std::size_t sz(tmp.size());
2807 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2808 for(std::size_t i=0;i<sz;i++)
2810 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2811 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2813 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2816 std::string __str__() const throw(INTERP_KERNEL::Exception)
2818 return self->simpleRepr();
2821 PyObject *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2823 DataArrayInt *ret1=0;
2824 MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
2825 PyObject *ret=PyTuple_New(2);
2826 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2827 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2831 PyObject *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2833 DataArrayInt *ret1=0;
2834 MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
2835 PyObject *ret=PyTuple_New(2);
2836 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2837 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2841 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2843 DataArrayInt *ret1=0;
2844 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
2845 PyObject *ret=PyTuple_New(2);
2846 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2847 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2851 PyObject *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2853 DataArrayInt *ret1=0;
2854 MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
2855 PyObject *ret=PyTuple_New(2);
2856 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2857 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2861 PyObject *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception)
2863 DataArrayInt *ret1=0;
2864 MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
2865 PyObject *ret=PyTuple_New(2);
2866 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
2867 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2871 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2873 DataArrayInt *ret1=0;
2874 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2875 PyObject *ret=PyTuple_New(2);
2876 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2877 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2881 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2883 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2891 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2894 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2895 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2896 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2897 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2898 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2899 void loadArrays() throw(INTERP_KERNEL::Exception);
2900 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2901 void unloadArrays() throw(INTERP_KERNEL::Exception);
2902 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2903 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2904 int getNumberOfFields() const;
2905 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2906 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2908 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2909 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2910 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2911 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2912 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2913 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2914 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2915 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2916 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2921 return MEDFileFields::New();
2924 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2926 return MEDFileFields::New(fileName,loadAll);
2929 std::string __str__() const throw(INTERP_KERNEL::Exception)
2931 return self->simpleRepr();
2934 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2936 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2937 std::size_t sz(tmp.size());
2938 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2939 for(std::size_t i=0;i<sz;i++)
2941 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2942 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2944 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2947 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2950 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2951 PyObject *ret=PyTuple_New(2);
2952 PyObject *ret_0=PyList_New(ret0.size());
2954 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2956 PyObject *elt=PyTuple_New(2);
2957 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2958 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2959 PyList_SetItem(ret_0,rk,elt);
2961 PyTuple_SetItem(ret,0,ret_0);
2962 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2963 PyTuple_SetItem(ret,1,ret_1);
2967 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2969 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2970 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2973 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2975 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2976 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2979 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2981 if(obj && PyList_Check(obj))
2983 int sz=PyList_Size(obj);
2984 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2985 int *pt=da->getPointer();
2986 for(int i=0;i<sz;i++,pt++)
2988 PyObject *elt1=PyList_GetItem(obj,i);
2989 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2991 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2994 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2997 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2999 self->setFieldAtPos(obj,field);
3003 int __len__() const throw(INTERP_KERNEL::Exception)
3005 return self->getNumberOfFields();
3008 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3010 return self->iterator();
3013 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3015 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3016 return self->changeMeshNames(modifTab);
3019 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3021 if(elt0 && PyInt_Check(elt0))
3023 return PyInt_AS_LONG(elt0);
3025 else if(elt0 && PyString_Check(elt0))
3026 return self->getPosFromFieldName(PyString_AsString(elt0));
3028 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3031 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3033 if(PyList_Check(elts))
3035 int sz=PyList_Size(elts);
3036 std::vector<int> ret(sz);
3037 for(int i=0;i<sz;i++)
3039 PyObject *elt=PyList_GetItem(elts,i);
3040 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3046 std::vector<int> ret(1);
3047 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3052 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3054 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3055 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3056 self->pushFields(tmp);
3059 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3061 if(elts && PySlice_Check(elts))
3063 Py_ssize_t strt=2,stp=2,step=2;
3064 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3065 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3066 self->destroyFieldsAtPos2(strt,stp,step);
3070 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3071 if(!idsToRemove.empty())
3072 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3076 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3078 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3079 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3080 return self->extractPart(extractDefCpp,mm);
3085 class MEDFileParameter1TS : public RefCountObject
3088 void setIteration(int it);
3089 int getIteration() const;
3090 void setOrder(int order);
3091 int getOrder() const;
3092 void setTimeValue(double time);
3093 void setTime(int dt, int it, double time);
3094 double getTime(int& dt, int& it);
3095 double getTimeValue() const;
3098 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3101 void setValue(double val) throw(INTERP_KERNEL::Exception);
3102 double getValue() const throw(INTERP_KERNEL::Exception);
3103 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3106 std::string __str__() const throw(INTERP_KERNEL::Exception)
3108 return self->simpleRepr();
3113 class MEDFileParameterTinyInfo : public MEDFileWritable
3116 void setDescription(const std::string& name);
3117 std::string getDescription() const;
3118 void setTimeUnit(const std::string& unit);
3119 std::string getTimeUnit() const;
3122 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3125 static MEDFileParameterDouble1TS *New();
3126 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3127 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3128 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3129 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3130 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3131 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3132 std::string getName() const throw(INTERP_KERNEL::Exception);
3133 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3136 MEDFileParameterDouble1TS()
3138 return MEDFileParameterDouble1TS::New();
3141 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3143 return MEDFileParameterDouble1TS::New(fileName);
3146 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3148 return MEDFileParameterDouble1TS::New(fileName,paramName);
3151 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3153 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3156 std::string __str__() const throw(INTERP_KERNEL::Exception)
3158 return self->simpleRepr();
3161 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3164 bool ret0=self->isEqual(other,eps,what);
3165 PyObject *res=PyList_New(2);
3166 PyObject *ret0Py=ret0?Py_True:Py_False;
3168 PyList_SetItem(res,0,ret0Py);
3169 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3175 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3178 static MEDFileParameterMultiTS *New();
3179 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3180 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3181 std::string getName() const;
3182 void setName(const std::string& name);
3183 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3184 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3185 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3186 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3187 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3188 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3189 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3190 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3193 MEDFileParameterMultiTS()
3195 return MEDFileParameterMultiTS::New();
3198 MEDFileParameterMultiTS(const std::string& fileName)
3200 return MEDFileParameterMultiTS::New(fileName);
3203 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3205 return MEDFileParameterMultiTS::New(fileName,paramName);
3208 std::string __str__() const throw(INTERP_KERNEL::Exception)
3210 return self->simpleRepr();
3213 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3216 bool ret0=self->isEqual(other,eps,what);
3217 PyObject *res=PyList_New(2);
3218 PyObject *ret0Py=ret0?Py_True:Py_False;
3220 PyList_SetItem(res,0,ret0Py);
3221 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3225 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3229 std::vector<int> pos2;
3230 DataArrayInt *pos3=0;
3231 DataArrayIntTuple *pos4=0;
3232 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3237 self->eraseTimeStepIds(&pos1,&pos1+1);
3244 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3249 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3253 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3257 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3259 if(elt0 && PyInt_Check(elt0))
3261 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3264 else if(elt0 && PyTuple_Check(elt0))
3266 if(PyTuple_Size(elt0)==2)
3268 PyObject *o0=PyTuple_GetItem(elt0,0);
3269 PyObject *o1=PyTuple_GetItem(elt0,1);
3270 if(PyInt_Check(o0) && PyInt_Check(o1))
3272 int iter=PyInt_AS_LONG(o0);
3273 int order=PyInt_AS_LONG(o1);
3274 return self->getPosOfTimeStep(iter,order);
3277 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 !");
3280 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 !");
3282 else if(elt0 && PyFloat_Check(elt0))
3284 double val=PyFloat_AS_DOUBLE(elt0);
3285 return self->getPosGivenTime(val);
3288 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3291 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3293 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3299 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3301 if(PyList_Check(elts))
3303 int sz=PyList_Size(elts);
3304 std::vector<int> ret(sz);
3305 for(int i=0;i<sz;i++)
3307 PyObject *elt=PyList_GetItem(elts,i);
3308 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3314 std::vector<int> ret(1);
3315 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3320 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3322 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3323 if(!idsToRemove.empty())
3324 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3327 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3329 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3335 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3337 std::vector< std::pair<int,int> > res=self->getIterations();
3338 PyObject *ret=PyList_New(res.size());
3340 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3342 PyObject *elt=PyTuple_New(2);
3343 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3344 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3345 PyList_SetItem(ret,rk,elt);
3350 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3352 std::vector<double> res2;
3353 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3354 PyObject *ret=PyList_New(res.size());
3356 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3358 PyObject *elt=PyTuple_New(3);
3359 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3360 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3361 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3362 PyList_SetItem(ret,rk,elt);
3369 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3372 static MEDFileParameters *New();
3373 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3374 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3375 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3376 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3377 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3378 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3379 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3380 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3381 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3382 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3383 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3388 return MEDFileParameters::New();
3391 MEDFileParameters(const std::string& fileName)
3393 return MEDFileParameters::New(fileName);
3396 std::string __str__() const throw(INTERP_KERNEL::Exception)
3398 return self->simpleRepr();
3401 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3403 if(PyInt_Check(obj))
3405 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3410 else if(PyString_Check(obj))
3412 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3418 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3421 int __len__() const throw(INTERP_KERNEL::Exception)
3423 return self->getNumberOfParams();
3426 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3428 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3434 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3436 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3442 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3445 bool ret0=self->isEqual(other,eps,what);
3446 PyObject *res=PyList_New(2);
3447 PyObject *ret0Py=ret0?Py_True:Py_False;
3449 PyList_SetItem(res,0,ret0Py);
3450 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3456 class MEDFileData : public RefCountObject, public MEDFileWritable
3459 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3460 static MEDFileData *New();
3461 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3462 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3463 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3464 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3465 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3466 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3467 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3469 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3470 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3472 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3475 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3477 return MEDFileData::New(fileName);
3482 return MEDFileData::New();
3485 std::string __str__() const throw(INTERP_KERNEL::Exception)
3487 return self->simpleRepr();
3490 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3492 MEDFileMeshes *ret=self->getMeshes();
3498 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3500 MEDFileParameters *ret=self->getParams();
3506 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3508 MEDFileFields *ret=self->getFields();
3514 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3516 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3517 return self->changeMeshNames(modifTab);
3522 class SauvReader : public RefCountObject
3525 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3526 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3529 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3531 return SauvReader::New(fileName);
3536 class SauvWriter : public RefCountObject
3539 static SauvWriter * New();
3540 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3541 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3542 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3543 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3546 SauvWriter() throw(INTERP_KERNEL::Exception)
3548 return SauvWriter::New();
3555 class MEDFileMeshStruct;
3557 class MEDFileField1TSStructItem
3560 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3563 class MEDFileMeshStruct : public RefCountObject
3566 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3568 ~MEDFileMeshStruct();
3571 class MEDMeshMultiLev : public RefCountObject
3574 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3575 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3576 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3582 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3584 DataArrayInt *famIds(0);
3585 bool isWithoutCopy(false);
3586 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3587 PyObject *ret=PyTuple_New(2);
3588 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3590 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3591 PyTuple_SetItem(ret,1,ret1Py);
3595 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3597 DataArrayInt *numIds(0);
3598 bool isWithoutCopy(false);
3599 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3600 PyObject *ret=PyTuple_New(2);
3601 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3603 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3604 PyTuple_SetItem(ret,1,ret1Py);
3608 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3610 DataArrayInt *famIds(0);
3611 bool isWithoutCopy(false);
3612 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3613 PyObject *ret=PyTuple_New(2);
3614 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3616 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3617 PyTuple_SetItem(ret,1,ret1Py);
3621 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3623 DataArrayInt *numIds(0);
3624 bool isWithoutCopy(false);
3625 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3626 PyObject *ret=PyTuple_New(2);
3627 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3629 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3630 PyTuple_SetItem(ret,1,ret1Py);
3634 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3636 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3637 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3638 PyObject *res(PyList_New(result.size()));
3639 for(int i=0;iL!=result.end(); i++, iL++)
3640 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3646 class MEDUMeshMultiLev : public MEDMeshMultiLev
3649 ~MEDUMeshMultiLev();
3653 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3655 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3656 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3657 PyObject *ret0Py=ncc?Py_True:Py_False;
3659 PyObject *ret=PyTuple_New(7);
3660 PyTuple_SetItem(ret,0,ret0Py);
3661 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3662 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3663 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3664 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3665 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3666 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3672 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3675 ~MEDStructuredMeshMultiLev();
3678 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3681 ~MEDCMeshMultiLev();
3685 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3688 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3689 std::size_t sz(objs.size());
3690 PyObject *ret(PyTuple_New(2));
3691 PyObject *ret0=PyList_New(sz);
3692 for(std::size_t i=0;i<sz;i++)
3693 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3694 PyTuple_SetItem(ret,0,ret0);
3695 PyObject *ret1Py(isInternal?Py_True:Py_False);
3697 PyTuple_SetItem(ret,1,ret1Py);
3703 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3706 ~MEDCurveLinearMeshMultiLev();
3710 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3712 DataArrayDouble *ret0(0);
3713 std::vector<int> ret1;
3715 self->buildVTUArrays(ret0,ret1,ret2);
3716 std::size_t sz(ret1.size());
3717 PyObject *ret=PyTuple_New(3);
3718 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3719 PyObject *ret1Py=PyList_New(sz);
3720 for(std::size_t i=0;i<sz;i++)
3721 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3722 PyTuple_SetItem(ret,1,ret1Py);
3723 PyObject *ret2Py(ret2?Py_True:Py_False);
3725 PyTuple_SetItem(ret,2,ret2Py);
3731 class MEDFileFastCellSupportComparator : public RefCountObject
3734 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3735 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3736 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3737 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3739 ~MEDFileFastCellSupportComparator();
3743 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3745 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3746 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3747 PyObject *res(PyList_New(result.size()));
3748 for(int i=0;iL!=result.end(); i++, iL++)
3749 PyList_SetItem(res,i,PyInt_FromLong(*iL));