1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileCMesh::New;
129 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
130 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
131 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
132 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
133 %newobject MEDCoupling::MEDFileMeshes::New;
134 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
136 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
137 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
138 %newobject MEDCoupling::MEDFileMeshes::__iter__;
140 %newobject MEDCoupling::MEDFileFields::New;
141 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
142 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
143 %newobject MEDCoupling::MEDFileFields::deepCopy;
144 %newobject MEDCoupling::MEDFileFields::shallowCpy;
145 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
146 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
147 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
148 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
149 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
150 %newobject MEDCoupling::MEDFileFields::__iter__;
151 %newobject MEDCoupling::MEDFileFields::extractPart;
153 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
154 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
155 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
162 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
163 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
171 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
172 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
173 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
174 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
181 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
182 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
183 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
184 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
185 %newobject MEDCoupling::MEDFileField1TS::New;
186 %newobject MEDCoupling::MEDFileField1TS::field;
187 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
188 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
189 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
190 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
191 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
192 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
194 %newobject MEDCoupling::MEDFileIntField1TS::New;
195 %newobject MEDCoupling::MEDFileIntField1TS::field;
196 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
197 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
198 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
199 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
200 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
201 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
203 %newobject MEDCoupling::MEDFileData::New;
204 %newobject MEDCoupling::MEDFileData::deepCopy;
205 %newobject MEDCoupling::MEDFileData::getMeshes;
206 %newobject MEDCoupling::MEDFileData::getFields;
207 %newobject MEDCoupling::MEDFileData::getParams;
209 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
210 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
211 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
212 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
213 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
214 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
215 %newobject MEDCoupling::MEDFileParameters::New;
216 %newobject MEDCoupling::MEDFileParameters::deepCopy;
217 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
218 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
219 %newobject MEDCoupling::MEDFileParameters::__getitem__;
221 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
222 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
223 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
224 %newobject MEDCoupling::MEDFileJointOneStep::New;
225 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
226 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
227 %newobject MEDCoupling::MEDFileJoint::New;
228 %newobject MEDCoupling::MEDFileJoint::deepCopy;
229 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
230 %newobject MEDCoupling::MEDFileJoints::New;
231 %newobject MEDCoupling::MEDFileJoints::deepCopy;
232 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
233 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
234 %newobject MEDCoupling::MEDFileJoints::__getitem__;
235 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
236 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
237 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
238 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
239 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
240 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
241 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
242 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
243 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
245 %newobject MEDCoupling::SauvWriter::New;
246 %newobject MEDCoupling::SauvReader::New;
247 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
249 %newobject MEDCoupling::MEDFileMeshStruct::New;
250 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
251 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
252 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
253 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
254 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
256 %feature("unref") MEDFileMesh "$this->decrRef();"
257 %feature("unref") MEDFileUMesh "$this->decrRef();"
258 %feature("unref") MEDFileCMesh "$this->decrRef();"
259 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
260 %feature("unref") MEDFileMeshes "$this->decrRef();"
261 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
262 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
263 %feature("unref") MEDFileField1TS "$this->decrRef();"
264 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
265 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
266 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
267 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
268 %feature("unref") MEDFileFields "$this->decrRef();"
269 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
270 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
271 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
272 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
273 %feature("unref") MEDFileParameters "$this->decrRef();"
274 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
275 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
276 %feature("unref") MEDFileJoint "$this->decrRef();"
277 %feature("unref") MEDFileJoints "$this->decrRef();"
278 %feature("unref") MEDFileEquivalences "$this->decrRef();"
279 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
280 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
281 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
282 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
283 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
284 %feature("unref") MEDFileData "$this->decrRef();"
285 %feature("unref") SauvReader "$this->decrRef();"
286 %feature("unref") SauvWriter "$this->decrRef();"
287 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
288 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
289 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
290 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
291 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
292 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
294 namespace MEDCoupling
297 std::string MEDFileVersionStr();
298 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
299 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
300 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
301 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
302 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
303 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
304 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
305 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
306 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
307 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
313 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
314 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
315 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
316 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
317 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
318 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
319 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
320 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);
321 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);
322 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);
323 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);
324 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);
325 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
326 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
327 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
328 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
329 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
330 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
333 %rename (MEDFileVersion) MEDFileVersionSwig;
334 %rename (GetFieldIterations) GetFieldIterationsSwig;
335 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
336 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
337 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
338 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
339 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
340 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
341 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
342 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
343 %rename (WriteUMeshes) WriteUMeshesSwig;
344 %rename (GetTypesOfField) GetTypesOfFieldSwig;
345 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
346 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
350 PyObject *MEDFileVersionSwig()
352 int major,minor,release;
353 MEDCoupling::MEDFileVersion(major,minor,release);
354 PyObject *ret(PyTuple_New(3));
355 PyTuple_SetItem(ret,0,SWIG_From_int(major));
356 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
357 PyTuple_SetItem(ret,2,SWIG_From_int(release));
361 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
363 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
364 PyObject *ret=PyList_New(res.size());
366 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
368 PyObject *elt=PyTuple_New(2);
369 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
370 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
371 PyList_SetItem(ret,rk,elt);
376 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
378 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
379 PyObject *ret=PyList_New(res.size());
381 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
383 PyObject *elt=PyTuple_New(3);
384 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
385 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
386 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
387 PyList_SetItem(ret,rk,elt);
392 PyObject *GetCellFieldIterationsSwig(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::GetCellFieldIterations(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 *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
409 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
410 PyObject *ret=PyList_New(res.size());
412 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
414 PyObject *elt=PyTuple_New(2);
415 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
416 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
417 PyList_SetItem(ret,rk,elt);
422 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
424 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
425 PyObject *ret=PyList_New(res.size());
427 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
429 PyObject *elt=PyTuple_New(2);
430 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
431 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
432 PyList_SetItem(ret,rk,elt);
437 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
439 int meshDim,spaceDim,numberOfNodes;
440 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
441 PyObject *ret=PyTuple_New(4);
442 PyObject *elt0=PyList_New(res.size());
444 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
446 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
448 PyObject *elt1=PyList_New(obj2.size());
449 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
451 PyObject *elt2=PyTuple_New(2);
452 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
453 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
454 PyList_SetItem(elt1,j,elt2);
456 PyList_SetItem(elt0,i,elt1);
458 PyTuple_SetItem(ret,0,elt0);
459 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
460 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
461 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
465 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
466 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
468 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
469 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
470 return convertFieldDoubleVecToPy(res);
473 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
475 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
476 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
477 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
480 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
482 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
483 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
484 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
487 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
489 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
490 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
491 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
494 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
496 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
498 PyObject *ret=PyList_New(size);
499 for(int i=0;i<size;i++)
500 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
504 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
506 std::vector<std::string> grps;
507 converPyListToVecString(li,grps);
508 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
511 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
513 std::vector<std::string> fams;
514 converPyListToVecString(li,fams);
515 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
519 namespace MEDCoupling
521 class MEDFileWritable
524 void copyOptionsFrom(const MEDFileWritable& other) const;
525 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
526 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
527 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
528 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
531 class MEDFileMeshReadSelector
534 MEDFileMeshReadSelector();
535 MEDFileMeshReadSelector(unsigned int code);
536 unsigned int getCode() const;
537 void setCode(unsigned int newCode);
538 bool isCellFamilyFieldReading() const;
539 bool isNodeFamilyFieldReading() const;
540 bool isCellNameFieldReading() const;
541 bool isNodeNameFieldReading() const;
542 bool isCellNumFieldReading() const;
543 bool isNodeNumFieldReading() const;
544 void setCellFamilyFieldReading(bool b);
545 void setNodeFamilyFieldReading(bool b);
546 void setCellNameFieldReading(bool b);
547 void setNodeNameFieldReading(bool b);
548 void setCellNumFieldReading(bool b);
549 void setNodeNumFieldReading(bool b);
552 std::string __str__() const throw(INTERP_KERNEL::Exception)
554 std::ostringstream oss;
559 std::string __repr__() const throw(INTERP_KERNEL::Exception)
561 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
567 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
570 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
571 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
572 throw(INTERP_KERNEL::Exception);
573 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
574 INTERP_KERNEL::NormalizedCellType loc_geo_type,
575 INTERP_KERNEL::NormalizedCellType rem_geo_type)
576 throw(INTERP_KERNEL::Exception);
577 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
578 MEDFileJointCorrespondence *deepCopy() const;
579 MEDFileJointCorrespondence *shallowCpy() const;
580 void setIsNodal(bool isNodal);
581 bool getIsNodal() const;
582 bool isEqual(const MEDFileJointCorrespondence *other) const;
583 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
584 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
585 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
586 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
587 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
588 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
589 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);
590 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
593 MEDFileJointCorrespondence()
595 return MEDFileJointCorrespondence::New();
597 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
599 return MEDFileJointCorrespondence::New(correspondence);
601 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
602 INTERP_KERNEL::NormalizedCellType loc_geo_type,
603 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
605 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
608 std::string __str__() const throw(INTERP_KERNEL::Exception)
610 return self->simpleRepr();
615 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
618 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
619 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
620 MEDFileJointOneStep *deepCopy() const;
621 MEDFileJointOneStep *shallowCpy() const;
622 bool isEqual(const MEDFileJointOneStep *other) const;
623 void setOrder(int order);
624 int getOrder() const;
625 void setIteration(int it);
626 int getIteration() const;
627 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
628 int getNumberOfCorrespondences() const;
629 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
630 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
631 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
634 MEDFileJointOneStep()
636 return MEDFileJointOneStep::New();
639 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
641 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
644 std::string __str__() const throw(INTERP_KERNEL::Exception)
646 return self->simpleRepr();
651 class MEDFileJoint : public RefCountObject, public MEDFileWritable
654 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
655 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
656 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
657 MEDFileJoint *deepCopy() const;
658 MEDFileJoint *shallowCpy() const;
659 bool isEqual(const MEDFileJoint *other) const;
660 void setLocalMeshName(const std::string& name);
661 std::string getLocalMeshName() const;
662 void setRemoteMeshName(const std::string& name);
663 std::string getRemoteMeshName() const;
664 void setDescription(const std::string& name);
665 std::string getDescription() const;
666 void setJointName(const std::string& name);
667 std::string getJointName() const;
668 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
669 void setDomainNumber(const int& number);
670 int getDomainNumber() const;
671 void pushStep(MEDFileJointOneStep* step);
672 int getNumberOfSteps() const;
673 MEDFileJointOneStep *getStepAtPos(int i) const;
674 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
675 std::string simpleRepr() const;
680 return MEDFileJoint::New();
683 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
685 return MEDFileJoint::New(fileName,mName,num);
688 std::string __str__() const throw(INTERP_KERNEL::Exception)
690 return self->simpleRepr();
695 class MEDFileJoints : public RefCountObject, public MEDFileWritable
698 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
699 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
700 MEDFileJoints *deepCopy() const;
701 std::string simpleRepr() const;
702 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
703 std::string getMeshName() const;
704 int getNumberOfJoints() const;
705 std::vector<std::string> getJointsNames() const;
706 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
707 void resize(int newSize) throw(INTERP_KERNEL::Exception);
708 void pushJoint(MEDFileJoint *joint);
709 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
710 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
715 return MEDFileJoints::New();
718 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
720 return MEDFileJoints::New(fileName,meshName);
723 std::string __str__() const throw(INTERP_KERNEL::Exception)
725 return self->simpleRepr();
728 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
732 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
737 else if(PyString_Check(obj))
739 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
745 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
748 int __len__() const throw(INTERP_KERNEL::Exception)
750 return self->getNumberOfJoints();
753 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
755 MEDFileJoint *ret=self->getJointAtPos(i);
761 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
763 MEDFileJoint *ret=self->getJointWithName(paramName);
771 class MEDFileEquivalenceBase : public RefCountObject
774 MEDFileEquivalenceBase();
777 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
780 MEDFileEquivalenceData();
782 void setArray(DataArrayInt *data);
785 DataArrayInt *getArray()
787 DataArrayInt *ret(self->getArray());
788 if(ret) ret->incrRef();
794 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
797 MEDFileEquivalenceNode();
800 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
803 MEDFileEquivalenceCell();
806 std::size_t size() const;
807 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
808 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
811 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
813 DataArrayInt *ret(self->getArray(type));
814 if(ret) ret->incrRef();
818 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
820 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
821 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
822 PyObject *res=PyList_New(result.size());
823 for(int i=0;iL!=result.end(); i++, iL++)
824 PyList_SetItem(res,i,PyInt_FromLong(*iL));
830 class MEDFileEquivalencePair : public RefCountObject
833 MEDFileEquivalencePair();
835 std::string getName() const;
836 void setName(const std::string& name);
837 std::string getDescription() const;
838 void setDescription(const std::string& descr);
839 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
842 MEDFileEquivalenceCell *initCell()
844 MEDFileEquivalenceCell *ret(self->initCell());
845 if(ret) ret->incrRef();
849 MEDFileEquivalenceNode *initNode()
851 MEDFileEquivalenceNode *ret(self->initNode());
852 if(ret) ret->incrRef();
856 MEDFileEquivalenceCell *getCell()
858 MEDFileEquivalenceCell *ret(self->getCell());
859 if(ret) ret->incrRef();
863 MEDFileEquivalenceNode *getNode()
865 MEDFileEquivalenceNode *ret(self->getNode());
866 if(ret) ret->incrRef();
872 class MEDFileEquivalences : public RefCountObject
875 MEDFileEquivalences();
878 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
879 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
880 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
884 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
886 MEDFileEquivalencePair *ret(self->getEquivalence(i));
887 if(ret) ret->incrRef();
890 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
892 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
893 if(ret) ret->incrRef();
897 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
899 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
900 if(ret) ret->incrRef();
906 class MEDFileMesh : public RefCountObject, public MEDFileWritable
909 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
910 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
911 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
912 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
913 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
914 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
915 void setName(const std::string& name);
916 std::string getName();
917 std::string getUnivName() const;
918 bool getUnivNameWrStatus() const;
919 void setUnivNameWrStatus(bool newStatus);
920 void setDescription(const std::string& name);
921 std::string getDescription() const;
922 void setOrder(int order);
923 int getOrder() const;
924 void setIteration(int it);
926 void setTimeValue(double time);
927 void setTime(int dt, int it, double time);
928 double getTimeValue() const;
929 void setTimeUnit(const std::string& unit);
930 std::string getTimeUnit() const;
931 void setAxisType(MEDCouplingAxisType at);
932 MEDCouplingAxisType getAxisType() const;
933 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
934 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
935 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
936 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
937 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
938 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
939 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
940 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
941 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
942 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
943 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
944 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
945 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
946 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
947 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
949 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
950 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
951 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
952 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
953 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
954 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
955 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
956 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
957 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
958 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
959 void clearGrpMap() throw(INTERP_KERNEL::Exception);
960 void clearFamMap() throw(INTERP_KERNEL::Exception);
961 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
962 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
963 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
964 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
965 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
966 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
967 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
968 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
969 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
970 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
971 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
972 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
973 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
974 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
975 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
976 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
977 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
978 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
979 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
980 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
981 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
982 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
983 static std::string GetMagicFamilyStr();
984 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
985 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
986 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
987 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
988 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
989 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
990 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
991 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
992 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
993 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
994 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
995 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
996 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
997 void setFamilyInfo(const std::map<std::string,int>& info);
998 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
999 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1000 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1001 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1002 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1003 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1004 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1005 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1006 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1007 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1008 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1009 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1010 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1011 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1012 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1013 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1014 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1015 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1016 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1017 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1018 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1020 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1021 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1022 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1023 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1024 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1025 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1026 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1027 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1028 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1029 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1030 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1031 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1032 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1033 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1034 int getNumberOfJoints();
1035 MEDFileJoints *getJoints();
1036 void setJoints( MEDFileJoints* joints );
1037 void initializeEquivalences();
1038 void killEquivalences();
1041 std::string __str__() const throw(INTERP_KERNEL::Exception)
1043 return self->simpleRepr();
1046 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1048 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1051 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1054 double tmp0=self->getTime(tmp1,tmp2);
1055 PyObject *res = PyList_New(3);
1056 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1057 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1058 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1062 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1065 bool ret0=self->isEqual(other,eps,what);
1066 PyObject *res=PyList_New(2);
1067 PyObject *ret0Py=ret0?Py_True:Py_False;
1069 PyList_SetItem(res,0,ret0Py);
1070 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1074 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1076 std::vector<const DataArrayInt *> grps;
1077 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1078 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1081 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1084 bool ret0=self->areFamsEqual(other,what);
1085 PyObject *res=PyList_New(2);
1086 PyObject *ret0Py=ret0?Py_True:Py_False;
1088 PyList_SetItem(res,0,ret0Py);
1089 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1093 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1096 bool ret0=self->areGrpsEqual(other,what);
1097 PyObject *res=PyList_New(2);
1098 PyObject *ret0Py=ret0?Py_True:Py_False;
1100 PyList_SetItem(res,0,ret0Py);
1101 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1105 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1107 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1108 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1109 PyObject *res=PyList_New(result.size());
1110 for(int i=0;iL!=result.end(); i++, iL++)
1111 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1115 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1117 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1118 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1119 PyObject *res=PyList_New(result.size());
1120 for(int i=0;iL!=result.end(); i++, iL++)
1121 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1125 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1127 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1130 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1133 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1135 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1138 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1141 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1143 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1146 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1149 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1151 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1154 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1157 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1159 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1162 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1165 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1168 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1169 PyObject *ret=PyTuple_New(2);
1170 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1171 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1175 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1177 DataArrayInt *ret3=0;
1178 std::vector<int> ret1,ret2;
1179 bool ret0=self->unPolyze(ret1,ret2,ret3);
1180 PyObject *ret=PyTuple_New(4);
1181 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1183 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1184 for(int j=0;j<(int)ret1.size()/3;j++)
1186 PyObject *retLev2=PyList_New(3);
1187 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1188 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1189 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1190 PyList_SetItem(retLev1_0,j,retLev2);
1192 PyTuple_SetItem(ret,1,retLev1_0);
1194 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1195 for(int j=0;j<(int)ret2.size()/3;j++)
1197 PyObject *retLev2=PyList_New(3);
1198 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1199 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1200 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1201 PyList_SetItem(retLev1_1,j,retLev2);
1203 PyTuple_SetItem(ret,2,retLev1_1);
1205 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1209 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1211 MEDFileEquivalences *ret(self->getEquivalences());
1212 if(ret) ret->incrRef();
1218 class MEDFileUMesh : public MEDFileMesh
1221 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1222 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1223 static MEDFileUMesh *New();
1225 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1226 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1227 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1228 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1229 void clearNodeAndCellNumbers();
1231 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1232 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1233 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1234 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1235 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1236 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1237 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1238 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1239 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1240 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1242 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1243 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1244 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1245 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1246 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1247 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1248 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1249 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1250 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1251 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1252 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1253 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1254 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1257 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1259 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1262 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1264 return MEDFileUMesh::New(fileName,mrs);
1269 return MEDFileUMesh::New();
1273 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1275 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1278 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)
1280 std::vector<int> typesCpp1;
1281 convertPyToNewIntArr3(types,typesCpp1);
1282 std::size_t sz(typesCpp1.size());
1283 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1284 for(std::size_t ii=0;ii<sz;ii++)
1285 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1286 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1289 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1290 {// put an empty dict in input to say to __new__ to call __init__...
1291 PyObject *ret(PyTuple_New(1));
1292 PyObject *ret0(PyDict_New());
1293 PyTuple_SetItem(ret,0,ret0);
1297 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1299 std::vector<double> a0;
1300 std::vector<int> a1;
1301 std::vector<std::string> a2;
1302 std::vector< MCAuto<DataArrayInt> > a3;
1303 MCAuto<DataArrayDouble> a4;
1304 self->serialize(a0,a1,a2,a3,a4);
1305 PyObject *ret(PyTuple_New(5));
1306 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1307 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1309 PyObject *ret2(PyList_New(sz));
1310 for(int i=0;i<sz;i++)
1311 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1312 PyTuple_SetItem(ret,2,ret2);
1314 PyObject *ret3(PyList_New(sz));
1315 for(int i=0;i<sz;i++)
1317 DataArrayInt *elt(a3[i]);
1320 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1322 PyTuple_SetItem(ret,3,ret3);
1323 DataArrayDouble *ret4(a4);
1326 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1330 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1332 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1333 if(!PyTuple_Check(inp))
1334 throw INTERP_KERNEL::Exception(MSG);
1335 int sz(PyTuple_Size(inp));
1337 throw INTERP_KERNEL::Exception(MSG);
1338 std::vector<double> a0;
1339 std::vector<int> a1;
1340 std::vector<std::string> a2;
1341 std::vector< MCAuto<DataArrayInt> > a3;
1342 MCAuto<DataArrayDouble> a4;
1344 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1346 fillArrayWithPyListDbl3(a0py,tmp,a0);
1347 convertPyToNewIntArr3(a1py,a1);
1348 fillStringVector(a2py,a2);
1350 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1352 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1353 if(!SWIG_IsOK(status))
1354 throw INTERP_KERNEL::Exception(MSG);
1355 a4=reinterpret_cast<DataArrayDouble *>(argp);
1356 if((DataArrayDouble *)a4)
1359 std::vector< DataArrayInt * > a3Tmp;
1360 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1361 std::size_t sz(a3Tmp.size());
1363 for(std::size_t i=0;i<sz;i++)
1367 a3Tmp[i]->incrRef();
1369 self->unserialize(a0,a1,a2,a3,a4);
1373 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1376 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1377 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1380 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1383 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1386 self->setMeshAtLevel(meshDimRelToMax,m1);
1389 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1392 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1394 self->removeMeshAtLevel(meshDimRelToMax);
1397 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1399 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1400 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1401 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1404 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1406 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1407 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1408 return self->extractPart(extractDefCpp);
1411 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1413 std::vector<const MEDCouplingUMesh *> ms;
1414 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1415 self->setMeshes(ms,renum);
1418 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1420 std::vector<const MEDCouplingUMesh *> ms;
1421 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1422 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1425 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1427 std::vector<const MEDCouplingUMesh *> ms;
1428 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1429 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1432 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1434 DataArrayDouble *ret=self->getCoords();
1440 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1442 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1445 return const_cast<PartDefinition *>(ret);
1448 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1450 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1451 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1452 PyObject *ret=PyTuple_New(3);
1453 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1454 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1455 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1459 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1461 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1467 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1469 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1470 std::size_t sz(tmp.size());
1471 PyObject *ret=PyList_New(sz);
1472 for(std::size_t i=0;i<sz;i++)
1476 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1483 class MEDFileStructuredMesh : public MEDFileMesh
1488 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1490 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1498 class MEDFileCMesh : public MEDFileStructuredMesh
1501 static MEDFileCMesh *New();
1502 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1503 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1504 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1505 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1510 return MEDFileCMesh::New();
1513 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1515 return MEDFileCMesh::New(fileName,mrs);
1518 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1520 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1523 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1525 const MEDCouplingCMesh *tmp=self->getMesh();
1528 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1533 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1536 static MEDFileCurveLinearMesh *New();
1537 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1538 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1539 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1542 MEDFileCurveLinearMesh()
1544 return MEDFileCurveLinearMesh::New();
1547 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1549 return MEDFileCurveLinearMesh::New(fileName,mrs);
1552 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1554 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1557 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1559 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1562 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1567 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1570 static MEDFileMeshMultiTS *New();
1571 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1572 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1573 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1574 std::string getName() const throw(INTERP_KERNEL::Exception);
1575 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1576 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1577 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1580 MEDFileMeshMultiTS()
1582 return MEDFileMeshMultiTS::New();
1585 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1587 return MEDFileMeshMultiTS::New(fileName);
1590 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1592 return MEDFileMeshMultiTS::New(fileName,mName);
1595 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1597 MEDFileMesh *ret=self->getOneTimeStep();
1605 class MEDFileMeshesIterator
1610 PyObject *next() throw(INTERP_KERNEL::Exception)
1612 MEDFileMesh *ret=self->nextt();
1616 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1620 PyErr_SetString(PyExc_StopIteration,"No more data.");
1627 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1630 static MEDFileMeshes *New();
1631 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1632 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1633 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1634 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1635 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1637 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1638 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1639 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1640 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1641 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1646 return MEDFileMeshes::New();
1649 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1651 return MEDFileMeshes::New(fileName);
1654 std::string __str__() const throw(INTERP_KERNEL::Exception)
1656 return self->simpleRepr();
1659 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1661 if(PyInt_Check(obj))
1663 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1668 else if(PyString_Check(obj))
1670 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1676 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1679 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1681 self->setMeshAtPos(obj,mesh);
1685 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1687 return self->iterator();
1690 int __len__() const throw(INTERP_KERNEL::Exception)
1692 return self->getNumberOfMeshes();
1695 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1697 MEDFileMesh *ret=self->getMeshAtPos(i);
1702 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1704 MEDFileMesh *ret=self->getMeshWithName(mname);
1712 class MEDFileFieldLoc : public RefCountObject
1715 std::string getName() const;
1716 int getDimension() const;
1717 int getNumberOfGaussPoints() const;
1718 int getNumberOfPointsInCells() const;
1719 const std::vector<double>& getRefCoords() const;
1720 const std::vector<double>& getGaussCoords() const;
1721 const std::vector<double>& getGaussWeights() const;
1722 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1725 std::string __str__() const throw(INTERP_KERNEL::Exception)
1727 return self->repr();
1732 class MEDFileFieldGlobsReal
1735 void resetContent();
1736 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1737 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1738 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1739 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1740 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1741 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1742 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1743 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1744 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1745 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1746 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1747 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1748 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1749 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1750 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1751 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1752 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1753 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1754 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1755 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1756 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1757 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1758 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1759 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1760 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1761 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1764 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1766 const DataArrayInt *ret=self->getProfile(pflName);
1769 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1772 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1774 const DataArrayInt *ret=self->getProfileFromId(pflId);
1777 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1780 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1782 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1785 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1788 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1790 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1793 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1796 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1798 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1799 return convertVecPairVecStToPy(ret);
1802 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1804 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1805 return convertVecPairVecStToPy(ret);
1808 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1810 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1811 self->changePflsNames(v);
1814 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1816 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1817 self->changePflsRefsNamesGen(v);
1820 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1822 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1823 self->changePflsNamesInStruct(v);
1826 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1828 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1829 self->changeLocsNames(v);
1832 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1834 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1835 self->changeLocsRefsNamesGen(v);
1838 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1840 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1841 self->changeLocsNamesInStruct(v);
1844 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1846 std::ostringstream oss;
1847 self->simpleReprGlobs(oss);
1853 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1856 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1857 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1858 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1859 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1860 void loadArrays() throw(INTERP_KERNEL::Exception);
1861 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1862 void unloadArrays() throw(INTERP_KERNEL::Exception);
1863 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1864 int getDimension() const throw(INTERP_KERNEL::Exception);
1865 int getIteration() const throw(INTERP_KERNEL::Exception);
1866 int getOrder() const throw(INTERP_KERNEL::Exception);
1867 std::string getName() throw(INTERP_KERNEL::Exception);
1868 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1869 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1870 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1871 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1872 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1873 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1874 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1875 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1876 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1877 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1878 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1879 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1880 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1881 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1882 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1885 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1888 double tmp0=self->getTime(tmp1,tmp2);
1889 PyObject *res = PyList_New(3);
1890 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1891 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1892 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1896 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1898 std::pair<int,int> res=self->getDtIt();
1899 PyObject *elt=PyTuple_New(2);
1900 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1901 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1905 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1907 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1910 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1912 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1915 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1917 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1918 return self->changeMeshNames(modifTab);
1921 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1923 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1924 PyObject *ret2=PyList_New(ret.size());
1925 for(int i=0;i<(int)ret.size();i++)
1926 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1930 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1932 std::vector<int> ret1;
1933 int ret0=self->getNonEmptyLevels(mname,ret1);
1934 PyObject *elt=PyTuple_New(2);
1935 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1936 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1940 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1942 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1943 std::vector< std::vector<TypeOfField> > typesF;
1944 std::vector< std::vector<std::string> > pfls;
1945 std::vector< std::vector<std::string> > locs;
1946 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1948 PyObject *ret2=PyList_New(sz);
1949 for(int i=0;i<sz;i++)
1951 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1952 const std::vector<TypeOfField>& typesFI=typesF[i];
1953 const std::vector<std::string>& pflsI=pfls[i];
1954 const std::vector<std::string>& locsI=locs[i];
1955 PyObject *elt=PyTuple_New(2);
1956 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1957 int sz2=ret[i].size();
1958 PyObject *elt2=PyList_New(sz2);
1959 for(int j=0;j<sz2;j++)
1961 PyObject *elt3=PyTuple_New(4);
1962 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1963 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));
1964 PyTuple_SetItem(elt3,1,elt4);
1965 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1966 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1967 PyList_SetItem(elt2,j,elt3);
1969 PyTuple_SetItem(elt,1,elt2);
1970 PyList_SetItem(ret2,i,elt);
1975 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1977 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1978 std::size_t sz=ret.size();
1979 PyObject *retPy=PyList_New(sz);
1980 for(std::size_t i=0;i<sz;i++)
1981 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1985 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1987 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1988 std::size_t sz=ret.size();
1989 PyObject *retPy=PyList_New(sz);
1990 for(std::size_t i=0;i<sz;i++)
1991 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1995 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1997 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1998 std::size_t sz=ret.size();
1999 PyObject *retPy=PyList_New(sz);
2000 for(std::size_t i=0;i<sz;i++)
2001 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2005 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2007 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2008 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2009 return self->extractPart(extractDefCpp,mm);
2014 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2017 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2018 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2019 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2020 static MEDFileField1TS *New();
2021 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2022 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2023 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2024 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2025 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2026 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2027 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2029 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2030 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2031 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2032 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2035 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2037 return MEDFileField1TS::New(fileName,loadAll);
2040 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2042 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2045 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2047 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2052 return MEDFileField1TS::New();
2055 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2057 const DataArrayDouble *arr=0;
2059 arr=field->getArray();
2060 self->copyTinyInfoFrom(field,arr);
2063 std::string __str__() const throw(INTERP_KERNEL::Exception)
2065 return self->simpleRepr();
2068 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2070 DataArrayInt *ret1=0;
2071 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2072 PyObject *ret=PyTuple_New(2);
2073 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2074 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2078 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2080 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2081 std::vector< std::vector<TypeOfField> > typesF;
2082 std::vector< std::vector<std::string> > pfls;
2083 std::vector< std::vector<std::string> > locs;
2084 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2086 PyObject *ret2=PyList_New(sz);
2087 for(int i=0;i<sz;i++)
2089 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2090 const std::vector<TypeOfField>& typesFI=typesF[i];
2091 const std::vector<std::string>& pflsI=pfls[i];
2092 const std::vector<std::string>& locsI=locs[i];
2093 PyObject *elt=PyTuple_New(2);
2094 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2095 int sz2=ret[i].size();
2096 PyObject *elt2=PyList_New(sz2);
2097 for(int j=0;j<sz2;j++)
2099 PyObject *elt3=PyTuple_New(4);
2100 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2101 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2102 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2103 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2104 PyList_SetItem(elt2,j,elt3);
2106 PyTuple_SetItem(elt,1,elt2);
2107 PyList_SetItem(ret2,i,elt);
2112 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2114 DataArrayDouble *ret=self->getUndergroundDataArray();
2120 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2122 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2123 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2126 PyObject *ret=PyTuple_New(2);
2127 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2128 std::size_t sz=elt1Cpp.size();
2129 PyObject *elt=PyList_New(sz);
2130 for(std::size_t i=0;i<sz;i++)
2132 PyObject *elt1=PyTuple_New(2);
2133 PyObject *elt2=PyTuple_New(2);
2134 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2135 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2136 PyObject *elt3=PyTuple_New(2);
2137 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2138 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2139 PyTuple_SetItem(elt1,0,elt2);
2140 PyTuple_SetItem(elt1,1,elt3);
2141 PyList_SetItem(elt,i,elt1);
2143 PyTuple_SetItem(ret,1,elt);
2149 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2152 static MEDFileIntField1TS *New();
2153 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2154 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2155 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2156 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2158 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2159 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2160 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2161 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2162 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2163 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2164 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2165 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2168 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2170 return MEDFileIntField1TS::New();
2173 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2175 return MEDFileIntField1TS::New(fileName,loadAll);
2178 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2180 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2183 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2185 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2188 std::string __str__() const throw(INTERP_KERNEL::Exception)
2190 return self->simpleRepr();
2193 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2195 DataArrayInt *ret1=0;
2196 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2197 PyObject *ret=PyTuple_New(2);
2198 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2199 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2203 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2205 DataArrayInt *ret=self->getUndergroundDataArray();
2213 class MEDFileAnyTypeFieldMultiTSIterator
2218 PyObject *next() throw(INTERP_KERNEL::Exception)
2220 MEDFileAnyTypeField1TS *ret=self->nextt();
2222 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2225 PyErr_SetString(PyExc_StopIteration,"No more data.");
2232 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2235 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2236 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2237 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2238 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2239 std::string getName() const throw(INTERP_KERNEL::Exception);
2240 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2241 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2242 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2243 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2244 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2245 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2246 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2247 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2248 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2249 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2250 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2251 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2252 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2253 void loadArrays() throw(INTERP_KERNEL::Exception);
2254 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2255 void unloadArrays() throw(INTERP_KERNEL::Exception);
2256 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2258 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2259 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2260 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2261 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2262 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2263 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2266 int __len__() const throw(INTERP_KERNEL::Exception)
2268 return self->getNumberOfTS();
2271 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2273 if(elt0 && PyInt_Check(elt0))
2275 int pos=PyInt_AS_LONG(elt0);
2278 else if(elt0 && PyTuple_Check(elt0))
2280 if(PyTuple_Size(elt0)==2)
2282 PyObject *o0=PyTuple_GetItem(elt0,0);
2283 PyObject *o1=PyTuple_GetItem(elt0,1);
2284 if(PyInt_Check(o0) && PyInt_Check(o1))
2286 int iter=PyInt_AS_LONG(o0);
2287 int order=PyInt_AS_LONG(o1);
2288 return self->getPosOfTimeStep(iter,order);
2291 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 !");
2294 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 !");
2296 else if(elt0 && PyFloat_Check(elt0))
2298 double val=PyFloat_AS_DOUBLE(elt0);
2299 return self->getPosGivenTime(val);
2302 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2305 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2307 std::vector< std::pair<int,int> > res=self->getIterations();
2308 PyObject *ret=PyList_New(res.size());
2310 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2312 PyObject *elt=PyTuple_New(2);
2313 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2314 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2315 PyList_SetItem(ret,rk,elt);
2320 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2322 std::vector<double> ret1;
2323 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2324 std::size_t sz=ret.size();
2325 PyObject *ret2=PyList_New(sz);
2326 for(std::size_t i=0;i<sz;i++)
2328 PyObject *elt=PyTuple_New(3);
2329 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2330 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2331 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2332 PyList_SetItem(ret2,i,elt);
2337 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2339 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2340 PyObject *ret2=PyList_New(ret.size());
2341 for(int i=0;i<(int)ret.size();i++)
2343 const std::vector<TypeOfField>& rett=ret[i];
2344 PyObject *ret3=PyList_New(rett.size());
2345 for(int j=0;j<(int)rett.size();j++)
2346 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2347 PyList_SetItem(ret2,i,ret3);
2352 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2354 std::vector<int> ret1;
2355 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2356 PyObject *elt=PyTuple_New(2);
2357 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2358 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2362 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2364 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2365 std::vector< std::vector<TypeOfField> > typesF;
2366 std::vector< std::vector<std::string> > pfls;
2367 std::vector< std::vector<std::string> > locs;
2368 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2370 PyObject *ret2=PyList_New(sz);
2371 for(int i=0;i<sz;i++)
2373 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2374 const std::vector<TypeOfField>& typesFI=typesF[i];
2375 const std::vector<std::string>& pflsI=pfls[i];
2376 const std::vector<std::string>& locsI=locs[i];
2377 PyObject *elt=PyTuple_New(2);
2378 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2379 int sz2=ret[i].size();
2380 PyObject *elt2=PyList_New(sz2);
2381 for(int j=0;j<sz2;j++)
2383 PyObject *elt3=PyTuple_New(4);
2384 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2385 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));
2386 PyTuple_SetItem(elt3,1,elt4);
2387 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2388 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2389 PyList_SetItem(elt2,j,elt3);
2391 PyTuple_SetItem(elt,1,elt2);
2392 PyList_SetItem(ret2,i,elt);
2397 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2399 if(PyList_Check(elts))
2401 int sz=PyList_Size(elts);
2402 std::vector<int> ret(sz);
2403 for(int i=0;i<sz;i++)
2405 PyObject *elt=PyList_GetItem(elts,i);
2406 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2412 std::vector<int> ret(1);
2413 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2418 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2420 if(PySlice_Check(elts))
2422 Py_ssize_t strt=2,stp=2,step=2;
2423 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2424 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2425 self->eraseTimeStepIds2(strt,stp,step);
2429 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2430 if(!idsToRemove.empty())
2431 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2435 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2439 std::vector<int> pos2;
2440 DataArrayInt *pos3=0;
2441 DataArrayIntTuple *pos4=0;
2442 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2447 self->eraseTimeStepIds(&pos1,&pos1+1);
2454 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2459 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2463 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2467 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2469 return self->iterator();
2472 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2474 if(elt0 && PyList_Check(elt0))
2476 int sz=PyList_Size(elt0);
2477 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2478 int *pt=da->getPointer();
2479 for(int i=0;i<sz;i++,pt++)
2481 PyObject *elt1=PyList_GetItem(elt0,i);
2482 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2484 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2486 else if(elt0 && PySlice_Check(elt0))
2488 Py_ssize_t strt=2,stp=2,step=2;
2489 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2490 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2491 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2494 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2497 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2499 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2500 return self->changeMeshNames(modifTab);
2503 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2505 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2506 std::size_t sz=ret.size();
2507 PyObject *retPy=PyList_New(sz);
2508 for(std::size_t i=0;i<sz;i++)
2509 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2513 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2515 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2516 std::size_t sz=ret.size();
2517 PyObject *retPy=PyList_New(sz);
2518 for(std::size_t i=0;i<sz;i++)
2519 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2523 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2525 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2526 std::size_t sz=ret.size();
2527 PyObject *retPy=PyList_New(sz);
2528 for(std::size_t i=0;i<sz;i++)
2529 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2533 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2536 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2537 if(SWIG_IsOK(status))
2539 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2543 std::vector<MEDFileAnyTypeField1TS *> tmp;
2544 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2545 self->pushBackTimeSteps(tmp);
2549 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2551 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2552 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2553 return self->extractPart(extractDefCpp,mm);
2556 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2558 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2559 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2560 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2561 std::size_t sz=ret.size();
2562 PyObject *retPy=PyList_New(sz);
2563 for(std::size_t i=0;i<sz;i++)
2565 std::size_t sz2=ret[i].size();
2566 PyObject *ret1Py=PyList_New(sz2);
2567 for(std::size_t j=0;j<sz2;j++)
2569 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2572 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2574 PyList_SetItem(retPy,i,ret1Py);
2579 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2581 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2582 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2583 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2584 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2585 if(ret2.size()!=ret.size())
2587 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2588 throw INTERP_KERNEL::Exception(oss.str().c_str());
2590 std::size_t sz=ret.size();
2591 PyObject *retPy=PyList_New(sz);
2592 for(std::size_t i=0;i<sz;i++)
2594 std::size_t sz2=ret[i].size();
2595 PyObject *ret0Py=PyTuple_New(2);
2596 PyObject *ret1Py=PyList_New(sz2);
2597 for(std::size_t j=0;j<sz2;j++)
2599 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2602 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2604 PyTuple_SetItem(ret0Py,0,ret1Py);
2605 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2606 PyList_SetItem(retPy,i,ret0Py);
2613 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2616 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2617 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2618 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2620 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2621 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2622 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2623 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2624 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2625 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2627 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2628 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2629 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2632 MEDFileFieldMultiTS()
2634 return MEDFileFieldMultiTS::New();
2637 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2639 return MEDFileFieldMultiTS::New(fileName,loadAll);
2642 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2644 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2647 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2649 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2650 std::size_t sz(tmp.size());
2651 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2652 for(std::size_t i=0;i<sz;i++)
2654 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2655 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2657 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2660 std::string __str__() const throw(INTERP_KERNEL::Exception)
2662 return self->simpleRepr();
2665 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2667 DataArrayInt *ret1=0;
2668 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2669 PyObject *ret=PyTuple_New(2);
2670 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2671 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2675 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2677 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2678 std::vector< std::vector<TypeOfField> > typesF;
2679 std::vector< std::vector<std::string> > pfls;
2680 std::vector< std::vector<std::string> > locs;
2681 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2683 PyObject *ret2=PyList_New(sz);
2684 for(int i=0;i<sz;i++)
2686 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2687 const std::vector<TypeOfField>& typesFI=typesF[i];
2688 const std::vector<std::string>& pflsI=pfls[i];
2689 const std::vector<std::string>& locsI=locs[i];
2690 PyObject *elt=PyTuple_New(2);
2691 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2692 int sz2=ret[i].size();
2693 PyObject *elt2=PyList_New(sz2);
2694 for(int j=0;j<sz2;j++)
2696 PyObject *elt3=PyTuple_New(4);
2697 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2698 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2699 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2700 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2701 PyList_SetItem(elt2,j,elt3);
2703 PyTuple_SetItem(elt,1,elt2);
2704 PyList_SetItem(ret2,i,elt);
2708 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2710 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2716 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2718 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2719 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2722 PyObject *ret=PyTuple_New(2);
2723 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2724 std::size_t sz=elt1Cpp.size();
2725 PyObject *elt=PyList_New(sz);
2726 for(std::size_t i=0;i<sz;i++)
2728 PyObject *elt1=PyTuple_New(2);
2729 PyObject *elt2=PyTuple_New(2);
2730 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2731 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2732 PyObject *elt3=PyTuple_New(2);
2733 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2734 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2735 PyTuple_SetItem(elt1,0,elt2);
2736 PyTuple_SetItem(elt1,1,elt3);
2737 PyList_SetItem(elt,i,elt1);
2739 PyTuple_SetItem(ret,1,elt);
2745 class MEDFileFieldsIterator
2750 PyObject *next() throw(INTERP_KERNEL::Exception)
2752 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2754 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2757 PyErr_SetString(PyExc_StopIteration,"No more data.");
2764 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2767 static MEDFileIntFieldMultiTS *New();
2768 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2769 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2771 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2772 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2773 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2774 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2775 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2776 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2777 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2778 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2779 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2782 MEDFileIntFieldMultiTS()
2784 return MEDFileIntFieldMultiTS::New();
2787 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2789 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2792 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2794 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2797 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2799 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2800 std::size_t sz(tmp.size());
2801 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2802 for(std::size_t i=0;i<sz;i++)
2804 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2805 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2807 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2810 std::string __str__() const throw(INTERP_KERNEL::Exception)
2812 return self->simpleRepr();
2815 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2817 DataArrayInt *ret1=0;
2818 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2819 PyObject *ret=PyTuple_New(2);
2820 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2821 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2825 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2827 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2835 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2838 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2839 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2840 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2841 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2842 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2843 void loadArrays() throw(INTERP_KERNEL::Exception);
2844 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2845 void unloadArrays() throw(INTERP_KERNEL::Exception);
2846 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2847 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2848 int getNumberOfFields() const;
2849 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2850 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2852 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2853 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2854 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2855 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2856 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2857 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2858 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2859 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2860 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2865 return MEDFileFields::New();
2868 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2870 return MEDFileFields::New(fileName,loadAll);
2873 std::string __str__() const throw(INTERP_KERNEL::Exception)
2875 return self->simpleRepr();
2878 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2880 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2881 std::size_t sz(tmp.size());
2882 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2883 for(std::size_t i=0;i<sz;i++)
2885 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2886 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2888 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2891 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2894 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2895 PyObject *ret=PyTuple_New(2);
2896 PyObject *ret_0=PyList_New(ret0.size());
2898 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2900 PyObject *elt=PyTuple_New(2);
2901 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2902 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2903 PyList_SetItem(ret_0,rk,elt);
2905 PyTuple_SetItem(ret,0,ret_0);
2906 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2907 PyTuple_SetItem(ret,1,ret_1);
2911 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2913 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2914 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2917 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2919 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2920 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2923 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2925 if(obj && PyList_Check(obj))
2927 int sz=PyList_Size(obj);
2928 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2929 int *pt=da->getPointer();
2930 for(int i=0;i<sz;i++,pt++)
2932 PyObject *elt1=PyList_GetItem(obj,i);
2933 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2935 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2938 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2941 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2943 self->setFieldAtPos(obj,field);
2947 int __len__() const throw(INTERP_KERNEL::Exception)
2949 return self->getNumberOfFields();
2952 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2954 return self->iterator();
2957 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2959 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2960 return self->changeMeshNames(modifTab);
2963 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2965 if(elt0 && PyInt_Check(elt0))
2967 return PyInt_AS_LONG(elt0);
2969 else if(elt0 && PyString_Check(elt0))
2970 return self->getPosFromFieldName(PyString_AsString(elt0));
2972 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2975 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2977 if(PyList_Check(elts))
2979 int sz=PyList_Size(elts);
2980 std::vector<int> ret(sz);
2981 for(int i=0;i<sz;i++)
2983 PyObject *elt=PyList_GetItem(elts,i);
2984 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
2990 std::vector<int> ret(1);
2991 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
2996 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2998 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2999 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3000 self->pushFields(tmp);
3003 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3005 if(elts && PySlice_Check(elts))
3007 Py_ssize_t strt=2,stp=2,step=2;
3008 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3009 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3010 self->destroyFieldsAtPos2(strt,stp,step);
3014 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3015 if(!idsToRemove.empty())
3016 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3020 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3022 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3023 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3024 return self->extractPart(extractDefCpp,mm);
3029 class MEDFileParameter1TS : public RefCountObject
3032 void setIteration(int it);
3033 int getIteration() const;
3034 void setOrder(int order);
3035 int getOrder() const;
3036 void setTimeValue(double time);
3037 void setTime(int dt, int it, double time);
3038 double getTime(int& dt, int& it);
3039 double getTimeValue() const;
3042 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3045 void setValue(double val) throw(INTERP_KERNEL::Exception);
3046 double getValue() const throw(INTERP_KERNEL::Exception);
3047 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3050 std::string __str__() const throw(INTERP_KERNEL::Exception)
3052 return self->simpleRepr();
3057 class MEDFileParameterTinyInfo : public MEDFileWritable
3060 void setDescription(const std::string& name);
3061 std::string getDescription() const;
3062 void setTimeUnit(const std::string& unit);
3063 std::string getTimeUnit() const;
3066 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3069 static MEDFileParameterDouble1TS *New();
3070 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3071 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3072 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3073 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3074 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3075 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3076 std::string getName() const throw(INTERP_KERNEL::Exception);
3077 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3080 MEDFileParameterDouble1TS()
3082 return MEDFileParameterDouble1TS::New();
3085 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3087 return MEDFileParameterDouble1TS::New(fileName);
3090 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3092 return MEDFileParameterDouble1TS::New(fileName,paramName);
3095 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3097 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3100 std::string __str__() const throw(INTERP_KERNEL::Exception)
3102 return self->simpleRepr();
3105 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3108 bool ret0=self->isEqual(other,eps,what);
3109 PyObject *res=PyList_New(2);
3110 PyObject *ret0Py=ret0?Py_True:Py_False;
3112 PyList_SetItem(res,0,ret0Py);
3113 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3119 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3122 static MEDFileParameterMultiTS *New();
3123 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3124 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3125 std::string getName() const;
3126 void setName(const std::string& name);
3127 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3128 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3129 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3130 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3131 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3132 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3133 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3134 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3137 MEDFileParameterMultiTS()
3139 return MEDFileParameterMultiTS::New();
3142 MEDFileParameterMultiTS(const std::string& fileName)
3144 return MEDFileParameterMultiTS::New(fileName);
3147 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3149 return MEDFileParameterMultiTS::New(fileName,paramName);
3152 std::string __str__() const throw(INTERP_KERNEL::Exception)
3154 return self->simpleRepr();
3157 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3160 bool ret0=self->isEqual(other,eps,what);
3161 PyObject *res=PyList_New(2);
3162 PyObject *ret0Py=ret0?Py_True:Py_False;
3164 PyList_SetItem(res,0,ret0Py);
3165 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3169 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3173 std::vector<int> pos2;
3174 DataArrayInt *pos3=0;
3175 DataArrayIntTuple *pos4=0;
3176 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3181 self->eraseTimeStepIds(&pos1,&pos1+1);
3188 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3193 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3197 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3201 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3203 if(elt0 && PyInt_Check(elt0))
3205 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3208 else if(elt0 && PyTuple_Check(elt0))
3210 if(PyTuple_Size(elt0)==2)
3212 PyObject *o0=PyTuple_GetItem(elt0,0);
3213 PyObject *o1=PyTuple_GetItem(elt0,1);
3214 if(PyInt_Check(o0) && PyInt_Check(o1))
3216 int iter=PyInt_AS_LONG(o0);
3217 int order=PyInt_AS_LONG(o1);
3218 return self->getPosOfTimeStep(iter,order);
3221 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 !");
3224 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 !");
3226 else if(elt0 && PyFloat_Check(elt0))
3228 double val=PyFloat_AS_DOUBLE(elt0);
3229 return self->getPosGivenTime(val);
3232 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3235 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3237 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3243 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3245 if(PyList_Check(elts))
3247 int sz=PyList_Size(elts);
3248 std::vector<int> ret(sz);
3249 for(int i=0;i<sz;i++)
3251 PyObject *elt=PyList_GetItem(elts,i);
3252 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3258 std::vector<int> ret(1);
3259 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3264 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3266 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3267 if(!idsToRemove.empty())
3268 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3271 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3273 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3279 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3281 std::vector< std::pair<int,int> > res=self->getIterations();
3282 PyObject *ret=PyList_New(res.size());
3284 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3286 PyObject *elt=PyTuple_New(2);
3287 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3288 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3289 PyList_SetItem(ret,rk,elt);
3294 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3296 std::vector<double> res2;
3297 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3298 PyObject *ret=PyList_New(res.size());
3300 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3302 PyObject *elt=PyTuple_New(3);
3303 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3304 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3305 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3306 PyList_SetItem(ret,rk,elt);
3313 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3316 static MEDFileParameters *New();
3317 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3318 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3319 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3320 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3321 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3322 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3323 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3324 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3325 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3326 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3327 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3332 return MEDFileParameters::New();
3335 MEDFileParameters(const std::string& fileName)
3337 return MEDFileParameters::New(fileName);
3340 std::string __str__() const throw(INTERP_KERNEL::Exception)
3342 return self->simpleRepr();
3345 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3347 if(PyInt_Check(obj))
3349 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3354 else if(PyString_Check(obj))
3356 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3362 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3365 int __len__() const throw(INTERP_KERNEL::Exception)
3367 return self->getNumberOfParams();
3370 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3372 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3378 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3380 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3386 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3389 bool ret0=self->isEqual(other,eps,what);
3390 PyObject *res=PyList_New(2);
3391 PyObject *ret0Py=ret0?Py_True:Py_False;
3393 PyList_SetItem(res,0,ret0Py);
3394 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3400 class MEDFileData : public RefCountObject, public MEDFileWritable
3403 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3404 static MEDFileData *New();
3405 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3406 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3407 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3408 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3409 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3410 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3411 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3413 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3414 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3416 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3419 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3421 return MEDFileData::New(fileName);
3426 return MEDFileData::New();
3429 std::string __str__() const throw(INTERP_KERNEL::Exception)
3431 return self->simpleRepr();
3434 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3436 MEDFileMeshes *ret=self->getMeshes();
3442 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3444 MEDFileParameters *ret=self->getParams();
3450 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3452 MEDFileFields *ret=self->getFields();
3458 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3460 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3461 return self->changeMeshNames(modifTab);
3466 class SauvReader : public RefCountObject
3469 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3470 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3473 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3475 return SauvReader::New(fileName);
3480 class SauvWriter : public RefCountObject
3483 static SauvWriter * New();
3484 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3485 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3486 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3487 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3490 SauvWriter() throw(INTERP_KERNEL::Exception)
3492 return SauvWriter::New();
3499 class MEDFileMeshStruct;
3501 class MEDFileField1TSStructItem
3504 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3507 class MEDFileMeshStruct : public RefCountObject
3510 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3512 ~MEDFileMeshStruct();
3515 class MEDMeshMultiLev : public RefCountObject
3518 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3519 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3520 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3526 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3528 DataArrayInt *famIds(0);
3529 bool isWithoutCopy(false);
3530 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3531 PyObject *ret=PyTuple_New(2);
3532 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3534 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3535 PyTuple_SetItem(ret,1,ret1Py);
3539 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3541 DataArrayInt *numIds(0);
3542 bool isWithoutCopy(false);
3543 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3544 PyObject *ret=PyTuple_New(2);
3545 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3547 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3548 PyTuple_SetItem(ret,1,ret1Py);
3552 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3554 DataArrayInt *famIds(0);
3555 bool isWithoutCopy(false);
3556 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3557 PyObject *ret=PyTuple_New(2);
3558 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3560 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3561 PyTuple_SetItem(ret,1,ret1Py);
3565 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3567 DataArrayInt *numIds(0);
3568 bool isWithoutCopy(false);
3569 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3570 PyObject *ret=PyTuple_New(2);
3571 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3573 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3574 PyTuple_SetItem(ret,1,ret1Py);
3578 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3580 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3581 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3582 PyObject *res(PyList_New(result.size()));
3583 for(int i=0;iL!=result.end(); i++, iL++)
3584 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3590 class MEDUMeshMultiLev : public MEDMeshMultiLev
3593 ~MEDUMeshMultiLev();
3597 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3599 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3600 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3601 PyObject *ret0Py=ncc?Py_True:Py_False;
3603 PyObject *ret=PyTuple_New(7);
3604 PyTuple_SetItem(ret,0,ret0Py);
3605 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3606 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3607 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3608 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3609 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3610 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3616 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3619 ~MEDStructuredMeshMultiLev();
3622 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3625 ~MEDCMeshMultiLev();
3629 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3632 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3633 std::size_t sz(objs.size());
3634 PyObject *ret(PyTuple_New(2));
3635 PyObject *ret0=PyList_New(sz);
3636 for(std::size_t i=0;i<sz;i++)
3637 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3638 PyTuple_SetItem(ret,0,ret0);
3639 PyObject *ret1Py(isInternal?Py_True:Py_False);
3641 PyTuple_SetItem(ret,1,ret1Py);
3647 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3650 ~MEDCurveLinearMeshMultiLev();
3654 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3656 DataArrayDouble *ret0(0);
3657 std::vector<int> ret1;
3659 self->buildVTUArrays(ret0,ret1,ret2);
3660 std::size_t sz(ret1.size());
3661 PyObject *ret=PyTuple_New(3);
3662 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3663 PyObject *ret1Py=PyList_New(sz);
3664 for(std::size_t i=0;i<sz;i++)
3665 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3666 PyTuple_SetItem(ret,1,ret1Py);
3667 PyObject *ret2Py(ret2?Py_True:Py_False);
3669 PyTuple_SetItem(ret,2,ret2Py);
3675 class MEDFileFastCellSupportComparator : public RefCountObject
3678 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3679 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3680 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3681 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3683 ~MEDFileFastCellSupportComparator();
3687 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3689 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3690 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3691 PyObject *res(PyList_New(result.size()));
3692 for(int i=0;iL!=result.end(); i++, iL++)
3693 PyList_SetItem(res,i,PyInt_FromLong(*iL));