1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
124 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
125 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
126 %newobject MEDCoupling::MEDFileCMesh::New;
127 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
128 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
129 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
130 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
131 %newobject MEDCoupling::MEDFileMeshes::New;
132 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
133 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
134 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
135 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
136 %newobject MEDCoupling::MEDFileMeshes::__iter__;
138 %newobject MEDCoupling::MEDFileFields::New;
139 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
140 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
141 %newobject MEDCoupling::MEDFileFields::deepCopy;
142 %newobject MEDCoupling::MEDFileFields::shallowCpy;
143 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
144 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
145 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
146 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
147 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
148 %newobject MEDCoupling::MEDFileFields::__iter__;
149 %newobject MEDCoupling::MEDFileFields::extractPart;
151 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
152 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
153 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
154 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
155 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
156 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
157 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
160 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
161 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
162 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
163 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
164 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
165 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
166 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
169 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
170 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
171 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
172 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
173 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
174 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
175 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
179 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
180 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
181 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
182 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
183 %newobject MEDCoupling::MEDFileField1TS::New;
184 %newobject MEDCoupling::MEDFileField1TS::field;
185 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
186 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
187 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
188 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
189 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
190 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
192 %newobject MEDCoupling::MEDFileIntField1TS::New;
193 %newobject MEDCoupling::MEDFileIntField1TS::field;
194 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
195 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
196 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
197 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
198 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
199 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
201 %newobject MEDCoupling::MEDFileData::New;
202 %newobject MEDCoupling::MEDFileData::deepCopy;
203 %newobject MEDCoupling::MEDFileData::getMeshes;
204 %newobject MEDCoupling::MEDFileData::getFields;
205 %newobject MEDCoupling::MEDFileData::getParams;
207 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
208 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
209 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
210 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
211 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
212 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
213 %newobject MEDCoupling::MEDFileParameters::New;
214 %newobject MEDCoupling::MEDFileParameters::deepCopy;
215 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
216 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
217 %newobject MEDCoupling::MEDFileParameters::__getitem__;
219 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
220 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
221 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
222 %newobject MEDCoupling::MEDFileJointOneStep::New;
223 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
224 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
225 %newobject MEDCoupling::MEDFileJoint::New;
226 %newobject MEDCoupling::MEDFileJoint::deepCopy;
227 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
228 %newobject MEDCoupling::MEDFileJoints::New;
229 %newobject MEDCoupling::MEDFileJoints::deepCopy;
230 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
231 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
232 %newobject MEDCoupling::MEDFileJoints::__getitem__;
233 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
234 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
235 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
236 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
237 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
238 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
239 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
240 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
241 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
243 %newobject MEDCoupling::SauvWriter::New;
244 %newobject MEDCoupling::SauvReader::New;
245 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
247 %newobject MEDCoupling::MEDFileMeshStruct::New;
248 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
249 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
250 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
251 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
252 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
254 %feature("unref") MEDFileMesh "$this->decrRef();"
255 %feature("unref") MEDFileUMesh "$this->decrRef();"
256 %feature("unref") MEDFileCMesh "$this->decrRef();"
257 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
258 %feature("unref") MEDFileMeshes "$this->decrRef();"
259 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
260 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
261 %feature("unref") MEDFileField1TS "$this->decrRef();"
262 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
263 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
264 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
265 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
266 %feature("unref") MEDFileFields "$this->decrRef();"
267 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
268 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
269 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
270 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
271 %feature("unref") MEDFileParameters "$this->decrRef();"
272 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
273 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
274 %feature("unref") MEDFileJoint "$this->decrRef();"
275 %feature("unref") MEDFileJoints "$this->decrRef();"
276 %feature("unref") MEDFileEquivalences "$this->decrRef();"
277 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
278 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
279 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
280 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
281 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
282 %feature("unref") MEDFileData "$this->decrRef();"
283 %feature("unref") SauvReader "$this->decrRef();"
284 %feature("unref") SauvWriter "$this->decrRef();"
285 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
286 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
287 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
288 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
289 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
290 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
292 namespace MEDCoupling
295 std::string MEDFileVersionStr();
296 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
297 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
298 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
299 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
300 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
301 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
302 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
303 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
304 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
305 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
306 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
307 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
308 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
311 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
312 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
313 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
314 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
315 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
316 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
317 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
318 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);
319 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);
320 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);
321 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);
322 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);
323 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
324 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
325 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
326 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
327 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
328 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
331 %rename (MEDFileVersion) MEDFileVersionSwig;
332 %rename (GetFieldIterations) GetFieldIterationsSwig;
333 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
334 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
335 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
336 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
337 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
338 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
339 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
340 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
341 %rename (WriteUMeshes) WriteUMeshesSwig;
342 %rename (GetTypesOfField) GetTypesOfFieldSwig;
343 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
344 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
348 PyObject *MEDFileVersionSwig()
350 int major,minor,release;
351 MEDCoupling::MEDFileVersion(major,minor,release);
352 PyObject *ret(PyTuple_New(3));
353 PyTuple_SetItem(ret,0,SWIG_From_int(major));
354 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
355 PyTuple_SetItem(ret,2,SWIG_From_int(release));
359 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
361 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
362 PyObject *ret=PyList_New(res.size());
364 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
366 PyObject *elt=PyTuple_New(2);
367 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
368 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
369 PyList_SetItem(ret,rk,elt);
374 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
376 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
377 PyObject *ret=PyList_New(res.size());
379 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
381 PyObject *elt=PyTuple_New(3);
382 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
383 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
384 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
385 PyList_SetItem(ret,rk,elt);
390 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
392 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
393 PyObject *ret=PyList_New(res.size());
395 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
397 PyObject *elt=PyTuple_New(2);
398 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
399 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
400 PyList_SetItem(ret,rk,elt);
405 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
407 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
408 PyObject *ret=PyList_New(res.size());
410 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
412 PyObject *elt=PyTuple_New(2);
413 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
414 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
415 PyList_SetItem(ret,rk,elt);
420 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
422 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
423 PyObject *ret=PyList_New(res.size());
425 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
427 PyObject *elt=PyTuple_New(2);
428 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
429 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
430 PyList_SetItem(ret,rk,elt);
435 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
437 int meshDim,spaceDim,numberOfNodes;
438 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
439 PyObject *ret=PyTuple_New(4);
440 PyObject *elt0=PyList_New(res.size());
442 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
444 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
446 PyObject *elt1=PyList_New(obj2.size());
447 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
449 PyObject *elt2=PyTuple_New(2);
450 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
451 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
452 PyList_SetItem(elt1,j,elt2);
454 PyList_SetItem(elt0,i,elt1);
456 PyTuple_SetItem(ret,0,elt0);
457 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
458 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
459 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
463 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
464 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
466 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
467 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
468 return convertFieldDoubleVecToPy(res);
471 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
473 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
474 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
475 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
478 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
480 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
481 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
482 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
485 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
487 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
488 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
489 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
492 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
494 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
496 PyObject *ret=PyList_New(size);
497 for(int i=0;i<size;i++)
498 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
502 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
504 std::vector<std::string> grps;
505 converPyListToVecString(li,grps);
506 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
509 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
511 std::vector<std::string> fams;
512 converPyListToVecString(li,fams);
513 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
517 namespace MEDCoupling
519 class MEDFileWritable
522 void copyOptionsFrom(const MEDFileWritable& other) const;
523 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
524 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
525 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
526 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
529 class MEDFileMeshReadSelector
532 MEDFileMeshReadSelector();
533 MEDFileMeshReadSelector(unsigned int code);
534 unsigned int getCode() const;
535 void setCode(unsigned int newCode);
536 bool isCellFamilyFieldReading() const;
537 bool isNodeFamilyFieldReading() const;
538 bool isCellNameFieldReading() const;
539 bool isNodeNameFieldReading() const;
540 bool isCellNumFieldReading() const;
541 bool isNodeNumFieldReading() const;
542 void setCellFamilyFieldReading(bool b);
543 void setNodeFamilyFieldReading(bool b);
544 void setCellNameFieldReading(bool b);
545 void setNodeNameFieldReading(bool b);
546 void setCellNumFieldReading(bool b);
547 void setNodeNumFieldReading(bool b);
550 std::string __str__() const throw(INTERP_KERNEL::Exception)
552 std::ostringstream oss;
557 std::string __repr__() const throw(INTERP_KERNEL::Exception)
559 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
565 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
568 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
569 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
570 throw(INTERP_KERNEL::Exception);
571 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
572 INTERP_KERNEL::NormalizedCellType loc_geo_type,
573 INTERP_KERNEL::NormalizedCellType rem_geo_type)
574 throw(INTERP_KERNEL::Exception);
575 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
576 MEDFileJointCorrespondence *deepCopy() const;
577 MEDFileJointCorrespondence *shallowCpy() const;
578 void setIsNodal(bool isNodal);
579 bool getIsNodal() const;
580 bool isEqual(const MEDFileJointCorrespondence *other) const;
581 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
582 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
583 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
584 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
585 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
586 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
587 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);
588 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
591 MEDFileJointCorrespondence()
593 return MEDFileJointCorrespondence::New();
595 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
597 return MEDFileJointCorrespondence::New(correspondence);
599 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
600 INTERP_KERNEL::NormalizedCellType loc_geo_type,
601 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
603 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
606 std::string __str__() const throw(INTERP_KERNEL::Exception)
608 return self->simpleRepr();
613 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
616 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
617 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
618 MEDFileJointOneStep *deepCopy() const;
619 MEDFileJointOneStep *shallowCpy() const;
620 bool isEqual(const MEDFileJointOneStep *other) const;
621 void setOrder(int order);
622 int getOrder() const;
623 void setIteration(int it);
624 int getIteration() const;
625 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
626 int getNumberOfCorrespondences() const;
627 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
628 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
629 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
632 MEDFileJointOneStep()
634 return MEDFileJointOneStep::New();
637 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
639 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
642 std::string __str__() const throw(INTERP_KERNEL::Exception)
644 return self->simpleRepr();
649 class MEDFileJoint : public RefCountObject, public MEDFileWritable
652 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
653 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
654 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
655 MEDFileJoint *deepCopy() const;
656 MEDFileJoint *shallowCpy() const;
657 bool isEqual(const MEDFileJoint *other) const;
658 void setLocalMeshName(const std::string& name);
659 std::string getLocalMeshName() const;
660 void setRemoteMeshName(const std::string& name);
661 std::string getRemoteMeshName() const;
662 void setDescription(const std::string& name);
663 std::string getDescription() const;
664 void setJointName(const std::string& name);
665 std::string getJointName() const;
666 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
667 void setDomainNumber(const int& number);
668 int getDomainNumber() const;
669 void pushStep(MEDFileJointOneStep* step);
670 int getNumberOfSteps() const;
671 MEDFileJointOneStep *getStepAtPos(int i) const;
672 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
673 std::string simpleRepr() const;
678 return MEDFileJoint::New();
681 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
683 return MEDFileJoint::New(fileName,mName,num);
686 std::string __str__() const throw(INTERP_KERNEL::Exception)
688 return self->simpleRepr();
693 class MEDFileJoints : public RefCountObject, public MEDFileWritable
696 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
697 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
698 MEDFileJoints *deepCopy() const;
699 std::string simpleRepr() const;
700 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
701 std::string getMeshName() const;
702 int getNumberOfJoints() const;
703 std::vector<std::string> getJointsNames() const;
704 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
705 void resize(int newSize) throw(INTERP_KERNEL::Exception);
706 void pushJoint(MEDFileJoint *joint);
707 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
708 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
713 return MEDFileJoints::New();
716 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
718 return MEDFileJoints::New(fileName,meshName);
721 std::string __str__() const throw(INTERP_KERNEL::Exception)
723 return self->simpleRepr();
726 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
730 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
735 else if(PyString_Check(obj))
737 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
743 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
746 int __len__() const throw(INTERP_KERNEL::Exception)
748 return self->getNumberOfJoints();
751 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
753 MEDFileJoint *ret=self->getJointAtPos(i);
759 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
761 MEDFileJoint *ret=self->getJointWithName(paramName);
769 class MEDFileEquivalenceBase : public RefCountObject
772 MEDFileEquivalenceBase();
775 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
778 MEDFileEquivalenceData();
780 void setArray(DataArrayInt *data);
783 DataArrayInt *getArray()
785 DataArrayInt *ret(self->getArray());
786 if(ret) ret->incrRef();
792 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
795 MEDFileEquivalenceNode();
798 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
801 MEDFileEquivalenceCell();
804 std::size_t size() const;
805 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
806 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
809 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
811 DataArrayInt *ret(self->getArray(type));
812 if(ret) ret->incrRef();
816 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
818 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
819 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
820 PyObject *res=PyList_New(result.size());
821 for(int i=0;iL!=result.end(); i++, iL++)
822 PyList_SetItem(res,i,PyInt_FromLong(*iL));
828 class MEDFileEquivalencePair : public RefCountObject
831 MEDFileEquivalencePair();
833 std::string getName() const;
834 void setName(const std::string& name);
835 std::string getDescription() const;
836 void setDescription(const std::string& descr);
837 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
840 MEDFileEquivalenceCell *initCell()
842 MEDFileEquivalenceCell *ret(self->initCell());
843 if(ret) ret->incrRef();
847 MEDFileEquivalenceNode *initNode()
849 MEDFileEquivalenceNode *ret(self->initNode());
850 if(ret) ret->incrRef();
854 MEDFileEquivalenceCell *getCell()
856 MEDFileEquivalenceCell *ret(self->getCell());
857 if(ret) ret->incrRef();
861 MEDFileEquivalenceNode *getNode()
863 MEDFileEquivalenceNode *ret(self->getNode());
864 if(ret) ret->incrRef();
870 class MEDFileEquivalences : public RefCountObject
873 MEDFileEquivalences();
876 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
877 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
878 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
882 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
884 MEDFileEquivalencePair *ret(self->getEquivalence(i));
885 if(ret) ret->incrRef();
888 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
890 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
891 if(ret) ret->incrRef();
895 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
897 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
898 if(ret) ret->incrRef();
904 class MEDFileMesh : public RefCountObject, public MEDFileWritable
907 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
908 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
909 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
910 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
911 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
912 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
913 void setName(const std::string& name);
914 std::string getName();
915 std::string getUnivName() const;
916 bool getUnivNameWrStatus() const;
917 void setUnivNameWrStatus(bool newStatus);
918 void setDescription(const std::string& name);
919 std::string getDescription() const;
920 void setOrder(int order);
921 int getOrder() const;
922 void setIteration(int it);
924 void setTimeValue(double time);
925 void setTime(int dt, int it, double time);
926 double getTimeValue() const;
927 void setTimeUnit(const std::string& unit);
928 std::string getTimeUnit() const;
929 void setAxisType(MEDCouplingAxisType at);
930 MEDCouplingAxisType getAxisType() const;
931 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
932 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
933 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
934 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
935 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
936 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
937 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
938 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
939 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
940 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
941 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
942 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
943 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
944 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
945 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
947 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
948 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
949 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
950 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
951 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
952 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
953 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
954 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
955 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
956 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
957 void clearGrpMap() throw(INTERP_KERNEL::Exception);
958 void clearFamMap() throw(INTERP_KERNEL::Exception);
959 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
960 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
961 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
962 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
963 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
964 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
965 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
966 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
967 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
968 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
969 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
970 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
971 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
972 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
973 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
974 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
975 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
976 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
977 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
978 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
979 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
980 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
981 static std::string GetMagicFamilyStr();
982 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
983 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
984 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
985 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
986 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
987 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
988 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
989 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
990 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
991 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
992 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
993 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
994 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
995 void setFamilyInfo(const std::map<std::string,int>& info);
996 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
997 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
998 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
999 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1000 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1001 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1002 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1003 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1004 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1005 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1006 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1007 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1008 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1009 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1010 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1011 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1012 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1013 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1014 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1015 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1016 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1018 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1019 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1020 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1021 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1022 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1023 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1024 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1025 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1026 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1027 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1028 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1029 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1030 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1031 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1032 int getNumberOfJoints();
1033 MEDFileJoints *getJoints();
1034 void setJoints( MEDFileJoints* joints );
1035 void initializeEquivalences();
1036 void killEquivalences();
1039 std::string __str__() const throw(INTERP_KERNEL::Exception)
1041 return self->simpleRepr();
1044 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1046 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1049 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1052 double tmp0=self->getTime(tmp1,tmp2);
1053 PyObject *res = PyList_New(3);
1054 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1055 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1056 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1060 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1063 bool ret0=self->isEqual(other,eps,what);
1064 PyObject *res=PyList_New(2);
1065 PyObject *ret0Py=ret0?Py_True:Py_False;
1067 PyList_SetItem(res,0,ret0Py);
1068 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1072 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1074 std::vector<const DataArrayInt *> grps;
1075 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1076 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1079 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1082 bool ret0=self->areFamsEqual(other,what);
1083 PyObject *res=PyList_New(2);
1084 PyObject *ret0Py=ret0?Py_True:Py_False;
1086 PyList_SetItem(res,0,ret0Py);
1087 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1091 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1094 bool ret0=self->areGrpsEqual(other,what);
1095 PyObject *res=PyList_New(2);
1096 PyObject *ret0Py=ret0?Py_True:Py_False;
1098 PyList_SetItem(res,0,ret0Py);
1099 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1103 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1105 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1106 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1107 PyObject *res=PyList_New(result.size());
1108 for(int i=0;iL!=result.end(); i++, iL++)
1109 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1113 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1115 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1116 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1117 PyObject *res=PyList_New(result.size());
1118 for(int i=0;iL!=result.end(); i++, iL++)
1119 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1123 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1125 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1128 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1131 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1133 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1136 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1139 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1141 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1144 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1147 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1149 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1152 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1155 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1157 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1160 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1163 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1166 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1167 PyObject *ret=PyTuple_New(2);
1168 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1169 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1173 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1175 DataArrayInt *ret3=0;
1176 std::vector<int> ret1,ret2;
1177 bool ret0=self->unPolyze(ret1,ret2,ret3);
1178 PyObject *ret=PyTuple_New(4);
1179 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1181 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1182 for(int j=0;j<(int)ret1.size()/3;j++)
1184 PyObject *retLev2=PyList_New(3);
1185 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1186 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1187 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1188 PyList_SetItem(retLev1_0,j,retLev2);
1190 PyTuple_SetItem(ret,1,retLev1_0);
1192 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1193 for(int j=0;j<(int)ret2.size()/3;j++)
1195 PyObject *retLev2=PyList_New(3);
1196 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1197 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1198 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1199 PyList_SetItem(retLev1_1,j,retLev2);
1201 PyTuple_SetItem(ret,2,retLev1_1);
1203 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1207 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1209 MEDFileEquivalences *ret(self->getEquivalences());
1210 if(ret) ret->incrRef();
1216 class MEDFileUMesh : public MEDFileMesh
1219 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1220 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1221 static MEDFileUMesh *New();
1223 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1224 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1225 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1226 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1227 void clearNodeAndCellNumbers();
1229 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1230 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1231 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1232 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1233 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1234 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1235 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1236 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1237 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1238 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1240 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1241 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1242 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1243 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1244 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1245 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1246 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1247 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1248 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1249 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1250 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1251 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1252 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1255 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1257 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1260 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1262 return MEDFileUMesh::New(fileName,mrs);
1267 return MEDFileUMesh::New();
1271 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1273 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1276 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)
1278 std::vector<int> typesCpp1;
1279 convertPyToNewIntArr3(types,typesCpp1);
1280 std::size_t sz(typesCpp1.size());
1281 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1282 for(std::size_t ii=0;ii<sz;ii++)
1283 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1284 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1287 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1288 {// put an empty dict in input to say to __new__ to call __init__...
1289 PyObject *ret(PyTuple_New(1));
1290 PyObject *ret0(PyDict_New());
1291 PyTuple_SetItem(ret,0,ret0);
1295 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1297 std::vector<double> a0;
1298 std::vector<int> a1;
1299 std::vector<std::string> a2;
1300 std::vector< MCAuto<DataArrayInt> > a3;
1301 MCAuto<DataArrayDouble> a4;
1302 self->serialize(a0,a1,a2,a3,a4);
1303 PyObject *ret(PyTuple_New(5));
1304 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1305 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1307 PyObject *ret2(PyList_New(sz));
1308 for(int i=0;i<sz;i++)
1309 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1310 PyTuple_SetItem(ret,2,ret2);
1312 PyObject *ret3(PyList_New(sz));
1313 for(int i=0;i<sz;i++)
1315 DataArrayInt *elt(a3[i]);
1318 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1320 PyTuple_SetItem(ret,3,ret3);
1321 DataArrayDouble *ret4(a4);
1324 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1328 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1330 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1331 if(!PyTuple_Check(inp))
1332 throw INTERP_KERNEL::Exception(MSG);
1333 int sz(PyTuple_Size(inp));
1335 throw INTERP_KERNEL::Exception(MSG);
1336 std::vector<double> a0;
1337 std::vector<int> a1;
1338 std::vector<std::string> a2;
1339 std::vector< MCAuto<DataArrayInt> > a3;
1340 MCAuto<DataArrayDouble> a4;
1342 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1344 fillArrayWithPyListDbl3(a0py,tmp,a0);
1345 convertPyToNewIntArr3(a1py,a1);
1346 fillStringVector(a2py,a2);
1348 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1350 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1351 if(!SWIG_IsOK(status))
1352 throw INTERP_KERNEL::Exception(MSG);
1353 a4=reinterpret_cast<DataArrayDouble *>(argp);
1354 if((DataArrayDouble *)a4)
1357 std::vector< DataArrayInt * > a3Tmp;
1358 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1359 std::size_t sz(a3Tmp.size());
1361 for(std::size_t i=0;i<sz;i++)
1365 a3Tmp[i]->incrRef();
1367 self->unserialize(a0,a1,a2,a3,a4);
1371 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1374 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1375 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1378 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1381 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1384 self->setMeshAtLevel(meshDimRelToMax,m1);
1387 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1390 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1392 self->removeMeshAtLevel(meshDimRelToMax);
1395 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1397 std::vector<const MEDCouplingUMesh *> ms;
1398 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1399 self->setMeshes(ms,renum);
1402 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1404 std::vector<const MEDCouplingUMesh *> ms;
1405 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1406 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1409 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1411 std::vector<const MEDCouplingUMesh *> ms;
1412 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1413 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1416 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1418 DataArrayDouble *ret=self->getCoords();
1424 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1426 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1429 return const_cast<PartDefinition *>(ret);
1432 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1434 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1435 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1436 PyObject *ret=PyTuple_New(3);
1437 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1438 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1439 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1443 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1445 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1451 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1453 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1454 std::size_t sz(tmp.size());
1455 PyObject *ret=PyList_New(sz);
1456 for(std::size_t i=0;i<sz;i++)
1460 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1467 class MEDFileStructuredMesh : public MEDFileMesh
1472 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1474 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1482 class MEDFileCMesh : public MEDFileStructuredMesh
1485 static MEDFileCMesh *New();
1486 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1487 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1488 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1489 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1494 return MEDFileCMesh::New();
1497 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1499 return MEDFileCMesh::New(fileName,mrs);
1502 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1504 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1507 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1509 const MEDCouplingCMesh *tmp=self->getMesh();
1512 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1517 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1520 static MEDFileCurveLinearMesh *New();
1521 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1522 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1523 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1526 MEDFileCurveLinearMesh()
1528 return MEDFileCurveLinearMesh::New();
1531 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1533 return MEDFileCurveLinearMesh::New(fileName,mrs);
1536 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1538 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1541 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1543 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1546 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1551 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
1554 static MEDFileMeshMultiTS *New();
1555 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1556 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1557 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1558 std::string getName() const throw(INTERP_KERNEL::Exception);
1559 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1560 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1561 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1564 MEDFileMeshMultiTS()
1566 return MEDFileMeshMultiTS::New();
1569 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1571 return MEDFileMeshMultiTS::New(fileName);
1574 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1576 return MEDFileMeshMultiTS::New(fileName,mName);
1579 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1581 MEDFileMesh *ret=self->getOneTimeStep();
1589 class MEDFileMeshesIterator
1594 PyObject *next() throw(INTERP_KERNEL::Exception)
1596 MEDFileMesh *ret=self->nextt();
1600 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1604 PyErr_SetString(PyExc_StopIteration,"No more data.");
1611 class MEDFileMeshes : public RefCountObject, public MEDFileWritable
1614 static MEDFileMeshes *New();
1615 static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1616 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1617 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1618 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1619 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1621 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1622 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1623 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1624 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1625 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1630 return MEDFileMeshes::New();
1633 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1635 return MEDFileMeshes::New(fileName);
1638 std::string __str__() const throw(INTERP_KERNEL::Exception)
1640 return self->simpleRepr();
1643 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1645 if(PyInt_Check(obj))
1647 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1652 else if(PyString_Check(obj))
1654 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1660 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1663 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1665 self->setMeshAtPos(obj,mesh);
1669 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1671 return self->iterator();
1674 int __len__() const throw(INTERP_KERNEL::Exception)
1676 return self->getNumberOfMeshes();
1679 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1681 MEDFileMesh *ret=self->getMeshAtPos(i);
1686 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1688 MEDFileMesh *ret=self->getMeshWithName(mname);
1696 class MEDFileFieldLoc : public RefCountObject
1699 std::string getName() const;
1700 int getDimension() const;
1701 int getNumberOfGaussPoints() const;
1702 int getNumberOfPointsInCells() const;
1703 const std::vector<double>& getRefCoords() const;
1704 const std::vector<double>& getGaussCoords() const;
1705 const std::vector<double>& getGaussWeights() const;
1706 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1709 std::string __str__() const throw(INTERP_KERNEL::Exception)
1711 return self->repr();
1716 class MEDFileFieldGlobsReal
1719 void resetContent();
1720 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1721 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1722 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1723 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1724 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1725 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1726 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1727 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1728 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1729 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1730 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1731 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1732 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1733 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1734 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1735 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1736 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1737 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1738 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1739 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1740 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1741 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1742 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1743 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1744 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1745 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1748 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1750 const DataArrayInt *ret=self->getProfile(pflName);
1753 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1756 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1758 const DataArrayInt *ret=self->getProfileFromId(pflId);
1761 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1764 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1766 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1769 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1772 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1774 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1777 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1780 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1782 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1783 return convertVecPairVecStToPy(ret);
1786 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1788 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1789 return convertVecPairVecStToPy(ret);
1792 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1794 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1795 self->changePflsNames(v);
1798 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1800 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1801 self->changePflsRefsNamesGen(v);
1804 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1806 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1807 self->changePflsNamesInStruct(v);
1810 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1812 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1813 self->changeLocsNames(v);
1816 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1818 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1819 self->changeLocsRefsNamesGen(v);
1822 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1824 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1825 self->changeLocsNamesInStruct(v);
1828 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1830 std::ostringstream oss;
1831 self->simpleReprGlobs(oss);
1837 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
1840 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1841 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1842 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1843 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
1844 void loadArrays() throw(INTERP_KERNEL::Exception);
1845 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1846 void unloadArrays() throw(INTERP_KERNEL::Exception);
1847 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1848 int getDimension() const throw(INTERP_KERNEL::Exception);
1849 int getIteration() const throw(INTERP_KERNEL::Exception);
1850 int getOrder() const throw(INTERP_KERNEL::Exception);
1851 std::string getName() throw(INTERP_KERNEL::Exception);
1852 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1853 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1854 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1855 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1856 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
1857 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
1858 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
1859 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
1860 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
1861 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
1862 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
1863 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
1864 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
1865 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
1866 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
1869 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1872 double tmp0=self->getTime(tmp1,tmp2);
1873 PyObject *res = PyList_New(3);
1874 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1875 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1876 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1880 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
1882 std::pair<int,int> res=self->getDtIt();
1883 PyObject *elt=PyTuple_New(2);
1884 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
1885 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
1889 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1891 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
1894 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
1896 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
1899 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1901 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
1902 return self->changeMeshNames(modifTab);
1905 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
1907 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
1908 PyObject *ret2=PyList_New(ret.size());
1909 for(int i=0;i<(int)ret.size();i++)
1910 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
1914 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1916 std::vector<int> ret1;
1917 int ret0=self->getNonEmptyLevels(mname,ret1);
1918 PyObject *elt=PyTuple_New(2);
1919 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
1920 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
1924 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
1926 std::vector<INTERP_KERNEL::NormalizedCellType> types;
1927 std::vector< std::vector<TypeOfField> > typesF;
1928 std::vector< std::vector<std::string> > pfls;
1929 std::vector< std::vector<std::string> > locs;
1930 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
1932 PyObject *ret2=PyList_New(sz);
1933 for(int i=0;i<sz;i++)
1935 const std::vector< std::pair<int,int> >& dadsI=ret[i];
1936 const std::vector<TypeOfField>& typesFI=typesF[i];
1937 const std::vector<std::string>& pflsI=pfls[i];
1938 const std::vector<std::string>& locsI=locs[i];
1939 PyObject *elt=PyTuple_New(2);
1940 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
1941 int sz2=ret[i].size();
1942 PyObject *elt2=PyList_New(sz2);
1943 for(int j=0;j<sz2;j++)
1945 PyObject *elt3=PyTuple_New(4);
1946 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
1947 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));
1948 PyTuple_SetItem(elt3,1,elt4);
1949 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
1950 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
1951 PyList_SetItem(elt2,j,elt3);
1953 PyTuple_SetItem(elt,1,elt2);
1954 PyList_SetItem(ret2,i,elt);
1959 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
1961 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
1962 std::size_t sz=ret.size();
1963 PyObject *retPy=PyList_New(sz);
1964 for(std::size_t i=0;i<sz;i++)
1965 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1969 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
1971 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
1972 std::size_t sz=ret.size();
1973 PyObject *retPy=PyList_New(sz);
1974 for(std::size_t i=0;i<sz;i++)
1975 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1979 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
1981 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
1982 std::size_t sz=ret.size();
1983 PyObject *retPy=PyList_New(sz);
1984 for(std::size_t i=0;i<sz;i++)
1985 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
1989 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
1991 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1992 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1993 return self->extractPart(extractDefCpp,mm);
1998 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2001 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2002 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2003 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2004 static MEDFileField1TS *New();
2005 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2006 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2007 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2008 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2009 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2010 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2011 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2013 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2014 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2015 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2016 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2019 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2021 return MEDFileField1TS::New(fileName,loadAll);
2024 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2026 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2029 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2031 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2036 return MEDFileField1TS::New();
2039 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2041 const DataArrayDouble *arr=0;
2043 arr=field->getArray();
2044 self->copyTinyInfoFrom(field,arr);
2047 std::string __str__() const throw(INTERP_KERNEL::Exception)
2049 return self->simpleRepr();
2052 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2054 DataArrayInt *ret1=0;
2055 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2056 PyObject *ret=PyTuple_New(2);
2057 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2058 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2062 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2064 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2065 std::vector< std::vector<TypeOfField> > typesF;
2066 std::vector< std::vector<std::string> > pfls;
2067 std::vector< std::vector<std::string> > locs;
2068 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2070 PyObject *ret2=PyList_New(sz);
2071 for(int i=0;i<sz;i++)
2073 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2074 const std::vector<TypeOfField>& typesFI=typesF[i];
2075 const std::vector<std::string>& pflsI=pfls[i];
2076 const std::vector<std::string>& locsI=locs[i];
2077 PyObject *elt=PyTuple_New(2);
2078 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2079 int sz2=ret[i].size();
2080 PyObject *elt2=PyList_New(sz2);
2081 for(int j=0;j<sz2;j++)
2083 PyObject *elt3=PyTuple_New(4);
2084 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2085 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2086 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2087 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2088 PyList_SetItem(elt2,j,elt3);
2090 PyTuple_SetItem(elt,1,elt2);
2091 PyList_SetItem(ret2,i,elt);
2096 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2098 DataArrayDouble *ret=self->getUndergroundDataArray();
2104 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2106 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2107 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2110 PyObject *ret=PyTuple_New(2);
2111 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2112 std::size_t sz=elt1Cpp.size();
2113 PyObject *elt=PyList_New(sz);
2114 for(std::size_t i=0;i<sz;i++)
2116 PyObject *elt1=PyTuple_New(2);
2117 PyObject *elt2=PyTuple_New(2);
2118 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2119 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2120 PyObject *elt3=PyTuple_New(2);
2121 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2122 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2123 PyTuple_SetItem(elt1,0,elt2);
2124 PyTuple_SetItem(elt1,1,elt3);
2125 PyList_SetItem(elt,i,elt1);
2127 PyTuple_SetItem(ret,1,elt);
2133 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2136 static MEDFileIntField1TS *New();
2137 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2138 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2139 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2140 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2142 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2143 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2144 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2145 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2146 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2147 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2148 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2149 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2152 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2154 return MEDFileIntField1TS::New();
2157 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2159 return MEDFileIntField1TS::New(fileName,loadAll);
2162 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2164 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2167 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2169 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2172 std::string __str__() const throw(INTERP_KERNEL::Exception)
2174 return self->simpleRepr();
2177 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2179 DataArrayInt *ret1=0;
2180 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2181 PyObject *ret=PyTuple_New(2);
2182 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2183 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2187 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2189 DataArrayInt *ret=self->getUndergroundDataArray();
2197 class MEDFileAnyTypeFieldMultiTSIterator
2202 PyObject *next() throw(INTERP_KERNEL::Exception)
2204 MEDFileAnyTypeField1TS *ret=self->nextt();
2206 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2209 PyErr_SetString(PyExc_StopIteration,"No more data.");
2216 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2219 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2220 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2221 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2222 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2223 std::string getName() const throw(INTERP_KERNEL::Exception);
2224 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2225 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2226 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2227 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2228 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2229 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2230 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2231 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2232 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2233 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2234 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2235 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2236 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2237 void loadArrays() throw(INTERP_KERNEL::Exception);
2238 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2239 void unloadArrays() throw(INTERP_KERNEL::Exception);
2240 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2242 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2243 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2244 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2245 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2246 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2247 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2250 int __len__() const throw(INTERP_KERNEL::Exception)
2252 return self->getNumberOfTS();
2255 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2257 if(elt0 && PyInt_Check(elt0))
2259 int pos=PyInt_AS_LONG(elt0);
2262 else if(elt0 && PyTuple_Check(elt0))
2264 if(PyTuple_Size(elt0)==2)
2266 PyObject *o0=PyTuple_GetItem(elt0,0);
2267 PyObject *o1=PyTuple_GetItem(elt0,1);
2268 if(PyInt_Check(o0) && PyInt_Check(o1))
2270 int iter=PyInt_AS_LONG(o0);
2271 int order=PyInt_AS_LONG(o1);
2272 return self->getPosOfTimeStep(iter,order);
2275 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 !");
2278 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 !");
2280 else if(elt0 && PyFloat_Check(elt0))
2282 double val=PyFloat_AS_DOUBLE(elt0);
2283 return self->getPosGivenTime(val);
2286 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2289 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2291 std::vector< std::pair<int,int> > res=self->getIterations();
2292 PyObject *ret=PyList_New(res.size());
2294 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
2296 PyObject *elt=PyTuple_New(2);
2297 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2298 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2299 PyList_SetItem(ret,rk,elt);
2304 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2306 std::vector<double> ret1;
2307 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2308 std::size_t sz=ret.size();
2309 PyObject *ret2=PyList_New(sz);
2310 for(std::size_t i=0;i<sz;i++)
2312 PyObject *elt=PyTuple_New(3);
2313 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2314 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2315 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2316 PyList_SetItem(ret2,i,elt);
2321 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2323 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2324 PyObject *ret2=PyList_New(ret.size());
2325 for(int i=0;i<(int)ret.size();i++)
2327 const std::vector<TypeOfField>& rett=ret[i];
2328 PyObject *ret3=PyList_New(rett.size());
2329 for(int j=0;j<(int)rett.size();j++)
2330 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2331 PyList_SetItem(ret2,i,ret3);
2336 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2338 std::vector<int> ret1;
2339 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2340 PyObject *elt=PyTuple_New(2);
2341 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2342 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2346 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2348 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2349 std::vector< std::vector<TypeOfField> > typesF;
2350 std::vector< std::vector<std::string> > pfls;
2351 std::vector< std::vector<std::string> > locs;
2352 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2354 PyObject *ret2=PyList_New(sz);
2355 for(int i=0;i<sz;i++)
2357 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2358 const std::vector<TypeOfField>& typesFI=typesF[i];
2359 const std::vector<std::string>& pflsI=pfls[i];
2360 const std::vector<std::string>& locsI=locs[i];
2361 PyObject *elt=PyTuple_New(2);
2362 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2363 int sz2=ret[i].size();
2364 PyObject *elt2=PyList_New(sz2);
2365 for(int j=0;j<sz2;j++)
2367 PyObject *elt3=PyTuple_New(4);
2368 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2369 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));
2370 PyTuple_SetItem(elt3,1,elt4);
2371 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2372 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2373 PyList_SetItem(elt2,j,elt3);
2375 PyTuple_SetItem(elt,1,elt2);
2376 PyList_SetItem(ret2,i,elt);
2381 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2383 if(PyList_Check(elts))
2385 int sz=PyList_Size(elts);
2386 std::vector<int> ret(sz);
2387 for(int i=0;i<sz;i++)
2389 PyObject *elt=PyList_GetItem(elts,i);
2390 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2396 std::vector<int> ret(1);
2397 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2402 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2404 if(PySlice_Check(elts))
2406 Py_ssize_t strt=2,stp=2,step=2;
2407 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2408 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2409 self->eraseTimeStepIds2(strt,stp,step);
2413 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2414 if(!idsToRemove.empty())
2415 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2419 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2423 std::vector<int> pos2;
2424 DataArrayInt *pos3=0;
2425 DataArrayIntTuple *pos4=0;
2426 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2431 self->eraseTimeStepIds(&pos1,&pos1+1);
2438 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2443 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2447 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2451 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2453 return self->iterator();
2456 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2458 if(elt0 && PyList_Check(elt0))
2460 int sz=PyList_Size(elt0);
2461 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2462 int *pt=da->getPointer();
2463 for(int i=0;i<sz;i++,pt++)
2465 PyObject *elt1=PyList_GetItem(elt0,i);
2466 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2468 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2470 else if(elt0 && PySlice_Check(elt0))
2472 Py_ssize_t strt=2,stp=2,step=2;
2473 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2474 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2475 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2478 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2481 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2483 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2484 return self->changeMeshNames(modifTab);
2487 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2489 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2490 std::size_t sz=ret.size();
2491 PyObject *retPy=PyList_New(sz);
2492 for(std::size_t i=0;i<sz;i++)
2493 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2497 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2499 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2500 std::size_t sz=ret.size();
2501 PyObject *retPy=PyList_New(sz);
2502 for(std::size_t i=0;i<sz;i++)
2503 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2507 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2509 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2510 std::size_t sz=ret.size();
2511 PyObject *retPy=PyList_New(sz);
2512 for(std::size_t i=0;i<sz;i++)
2513 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2517 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2520 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2521 if(SWIG_IsOK(status))
2523 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2527 std::vector<MEDFileAnyTypeField1TS *> tmp;
2528 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2529 self->pushBackTimeSteps(tmp);
2533 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2535 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2536 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2537 return self->extractPart(extractDefCpp,mm);
2540 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2542 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2543 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2544 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2545 std::size_t sz=ret.size();
2546 PyObject *retPy=PyList_New(sz);
2547 for(std::size_t i=0;i<sz;i++)
2549 std::size_t sz2=ret[i].size();
2550 PyObject *ret1Py=PyList_New(sz2);
2551 for(std::size_t j=0;j<sz2;j++)
2553 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2556 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2558 PyList_SetItem(retPy,i,ret1Py);
2563 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2565 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2566 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2567 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2568 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2569 if(ret2.size()!=ret.size())
2571 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2572 throw INTERP_KERNEL::Exception(oss.str().c_str());
2574 std::size_t sz=ret.size();
2575 PyObject *retPy=PyList_New(sz);
2576 for(std::size_t i=0;i<sz;i++)
2578 std::size_t sz2=ret[i].size();
2579 PyObject *ret0Py=PyTuple_New(2);
2580 PyObject *ret1Py=PyList_New(sz2);
2581 for(std::size_t j=0;j<sz2;j++)
2583 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2586 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2588 PyTuple_SetItem(ret0Py,0,ret1Py);
2589 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2590 PyList_SetItem(retPy,i,ret0Py);
2597 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2600 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2601 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2602 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2604 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2605 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2606 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2607 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2608 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2609 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2611 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2612 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2613 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2616 MEDFileFieldMultiTS()
2618 return MEDFileFieldMultiTS::New();
2621 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2623 return MEDFileFieldMultiTS::New(fileName,loadAll);
2626 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2628 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2631 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2633 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2634 std::size_t sz(tmp.size());
2635 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2636 for(std::size_t i=0;i<sz;i++)
2638 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2639 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2641 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2644 std::string __str__() const throw(INTERP_KERNEL::Exception)
2646 return self->simpleRepr();
2649 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2651 DataArrayInt *ret1=0;
2652 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2653 PyObject *ret=PyTuple_New(2);
2654 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2655 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2659 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2661 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2662 std::vector< std::vector<TypeOfField> > typesF;
2663 std::vector< std::vector<std::string> > pfls;
2664 std::vector< std::vector<std::string> > locs;
2665 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2667 PyObject *ret2=PyList_New(sz);
2668 for(int i=0;i<sz;i++)
2670 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2671 const std::vector<TypeOfField>& typesFI=typesF[i];
2672 const std::vector<std::string>& pflsI=pfls[i];
2673 const std::vector<std::string>& locsI=locs[i];
2674 PyObject *elt=PyTuple_New(2);
2675 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2676 int sz2=ret[i].size();
2677 PyObject *elt2=PyList_New(sz2);
2678 for(int j=0;j<sz2;j++)
2680 PyObject *elt3=PyTuple_New(4);
2681 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2682 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2683 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2684 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2685 PyList_SetItem(elt2,j,elt3);
2687 PyTuple_SetItem(elt,1,elt2);
2688 PyList_SetItem(ret2,i,elt);
2692 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2694 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2700 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2702 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2703 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2706 PyObject *ret=PyTuple_New(2);
2707 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2708 std::size_t sz=elt1Cpp.size();
2709 PyObject *elt=PyList_New(sz);
2710 for(std::size_t i=0;i<sz;i++)
2712 PyObject *elt1=PyTuple_New(2);
2713 PyObject *elt2=PyTuple_New(2);
2714 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2715 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2716 PyObject *elt3=PyTuple_New(2);
2717 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2718 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2719 PyTuple_SetItem(elt1,0,elt2);
2720 PyTuple_SetItem(elt1,1,elt3);
2721 PyList_SetItem(elt,i,elt1);
2723 PyTuple_SetItem(ret,1,elt);
2729 class MEDFileFieldsIterator
2734 PyObject *next() throw(INTERP_KERNEL::Exception)
2736 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2738 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2741 PyErr_SetString(PyExc_StopIteration,"No more data.");
2748 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2751 static MEDFileIntFieldMultiTS *New();
2752 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2753 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2755 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2756 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2757 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2758 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2759 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2760 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2761 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2762 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2763 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2766 MEDFileIntFieldMultiTS()
2768 return MEDFileIntFieldMultiTS::New();
2771 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2773 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2776 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2778 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2781 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2783 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2784 std::size_t sz(tmp.size());
2785 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2786 for(std::size_t i=0;i<sz;i++)
2788 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2789 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2791 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2794 std::string __str__() const throw(INTERP_KERNEL::Exception)
2796 return self->simpleRepr();
2799 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2801 DataArrayInt *ret1=0;
2802 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2803 PyObject *ret=PyTuple_New(2);
2804 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2805 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2809 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2811 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
2819 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable
2822 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
2823 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2824 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
2825 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
2826 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
2827 void loadArrays() throw(INTERP_KERNEL::Exception);
2828 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2829 void unloadArrays() throw(INTERP_KERNEL::Exception);
2830 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2831 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
2832 int getNumberOfFields() const;
2833 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
2834 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
2836 void resize(int newSize) throw(INTERP_KERNEL::Exception);
2837 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2838 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
2839 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2840 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
2841 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
2842 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
2843 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
2844 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
2849 return MEDFileFields::New();
2852 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2854 return MEDFileFields::New(fileName,loadAll);
2857 std::string __str__() const throw(INTERP_KERNEL::Exception)
2859 return self->simpleRepr();
2862 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2864 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2865 std::size_t sz(tmp.size());
2866 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2867 for(std::size_t i=0;i<sz;i++)
2869 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2870 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2872 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
2875 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
2878 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
2879 PyObject *ret=PyTuple_New(2);
2880 PyObject *ret_0=PyList_New(ret0.size());
2882 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
2884 PyObject *elt=PyTuple_New(2);
2885 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
2886 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
2887 PyList_SetItem(ret_0,rk,elt);
2889 PyTuple_SetItem(ret,0,ret_0);
2890 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
2891 PyTuple_SetItem(ret,1,ret_1);
2895 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2897 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2898 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
2901 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
2903 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
2904 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
2907 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2909 if(obj && PyList_Check(obj))
2911 int sz=PyList_Size(obj);
2912 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2913 int *pt=da->getPointer();
2914 for(int i=0;i<sz;i++,pt++)
2916 PyObject *elt1=PyList_GetItem(obj,i);
2917 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
2919 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
2922 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
2925 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
2927 self->setFieldAtPos(obj,field);
2931 int __len__() const throw(INTERP_KERNEL::Exception)
2933 return self->getNumberOfFields();
2936 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
2938 return self->iterator();
2941 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2943 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2944 return self->changeMeshNames(modifTab);
2947 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2949 if(elt0 && PyInt_Check(elt0))
2951 return PyInt_AS_LONG(elt0);
2953 else if(elt0 && PyString_Check(elt0))
2954 return self->getPosFromFieldName(PyString_AsString(elt0));
2956 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
2959 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2961 if(PyList_Check(elts))
2963 int sz=PyList_Size(elts);
2964 std::vector<int> ret(sz);
2965 for(int i=0;i<sz;i++)
2967 PyObject *elt=PyList_GetItem(elts,i);
2968 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
2974 std::vector<int> ret(1);
2975 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
2980 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
2982 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
2983 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
2984 self->pushFields(tmp);
2987 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2989 if(elts && PySlice_Check(elts))
2991 Py_ssize_t strt=2,stp=2,step=2;
2992 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2993 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
2994 self->destroyFieldsAtPos2(strt,stp,step);
2998 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
2999 if(!idsToRemove.empty())
3000 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3004 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3006 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3007 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3008 return self->extractPart(extractDefCpp,mm);
3013 class MEDFileParameter1TS : public RefCountObject
3016 void setIteration(int it);
3017 int getIteration() const;
3018 void setOrder(int order);
3019 int getOrder() const;
3020 void setTimeValue(double time);
3021 void setTime(int dt, int it, double time);
3022 double getTime(int& dt, int& it);
3023 double getTimeValue() const;
3026 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3029 void setValue(double val) throw(INTERP_KERNEL::Exception);
3030 double getValue() const throw(INTERP_KERNEL::Exception);
3031 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3034 std::string __str__() const throw(INTERP_KERNEL::Exception)
3036 return self->simpleRepr();
3041 class MEDFileParameterTinyInfo : public MEDFileWritable
3044 void setDescription(const std::string& name);
3045 std::string getDescription() const;
3046 void setTimeUnit(const std::string& unit);
3047 std::string getTimeUnit() const;
3050 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3053 static MEDFileParameterDouble1TS *New();
3054 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3055 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3056 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3057 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3058 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3059 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3060 std::string getName() const throw(INTERP_KERNEL::Exception);
3061 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3064 MEDFileParameterDouble1TS()
3066 return MEDFileParameterDouble1TS::New();
3069 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3071 return MEDFileParameterDouble1TS::New(fileName);
3074 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3076 return MEDFileParameterDouble1TS::New(fileName,paramName);
3079 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3081 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3084 std::string __str__() const throw(INTERP_KERNEL::Exception)
3086 return self->simpleRepr();
3089 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3092 bool ret0=self->isEqual(other,eps,what);
3093 PyObject *res=PyList_New(2);
3094 PyObject *ret0Py=ret0?Py_True:Py_False;
3096 PyList_SetItem(res,0,ret0Py);
3097 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3103 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3106 static MEDFileParameterMultiTS *New();
3107 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3108 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3109 std::string getName() const;
3110 void setName(const std::string& name);
3111 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3112 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3113 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3114 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3115 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3116 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3117 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3118 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3121 MEDFileParameterMultiTS()
3123 return MEDFileParameterMultiTS::New();
3126 MEDFileParameterMultiTS(const std::string& fileName)
3128 return MEDFileParameterMultiTS::New(fileName);
3131 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3133 return MEDFileParameterMultiTS::New(fileName,paramName);
3136 std::string __str__() const throw(INTERP_KERNEL::Exception)
3138 return self->simpleRepr();
3141 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3144 bool ret0=self->isEqual(other,eps,what);
3145 PyObject *res=PyList_New(2);
3146 PyObject *ret0Py=ret0?Py_True:Py_False;
3148 PyList_SetItem(res,0,ret0Py);
3149 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3153 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3157 std::vector<int> pos2;
3158 DataArrayInt *pos3=0;
3159 DataArrayIntTuple *pos4=0;
3160 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3165 self->eraseTimeStepIds(&pos1,&pos1+1);
3172 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3177 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3181 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3185 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3187 if(elt0 && PyInt_Check(elt0))
3189 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3192 else if(elt0 && PyTuple_Check(elt0))
3194 if(PyTuple_Size(elt0)==2)
3196 PyObject *o0=PyTuple_GetItem(elt0,0);
3197 PyObject *o1=PyTuple_GetItem(elt0,1);
3198 if(PyInt_Check(o0) && PyInt_Check(o1))
3200 int iter=PyInt_AS_LONG(o0);
3201 int order=PyInt_AS_LONG(o1);
3202 return self->getPosOfTimeStep(iter,order);
3205 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 !");
3208 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 !");
3210 else if(elt0 && PyFloat_Check(elt0))
3212 double val=PyFloat_AS_DOUBLE(elt0);
3213 return self->getPosGivenTime(val);
3216 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3219 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3221 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3227 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3229 if(PyList_Check(elts))
3231 int sz=PyList_Size(elts);
3232 std::vector<int> ret(sz);
3233 for(int i=0;i<sz;i++)
3235 PyObject *elt=PyList_GetItem(elts,i);
3236 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3242 std::vector<int> ret(1);
3243 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3248 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3250 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3251 if(!idsToRemove.empty())
3252 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3255 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3257 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3263 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3265 std::vector< std::pair<int,int> > res=self->getIterations();
3266 PyObject *ret=PyList_New(res.size());
3268 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3270 PyObject *elt=PyTuple_New(2);
3271 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3272 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3273 PyList_SetItem(ret,rk,elt);
3278 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3280 std::vector<double> res2;
3281 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
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(3);
3287 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3288 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3289 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3290 PyList_SetItem(ret,rk,elt);
3297 class MEDFileParameters : public RefCountObject, public MEDFileWritable
3300 static MEDFileParameters *New();
3301 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3302 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3303 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3304 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3305 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3306 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3307 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3308 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3309 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3310 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3311 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3316 return MEDFileParameters::New();
3319 MEDFileParameters(const std::string& fileName)
3321 return MEDFileParameters::New(fileName);
3324 std::string __str__() const throw(INTERP_KERNEL::Exception)
3326 return self->simpleRepr();
3329 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3331 if(PyInt_Check(obj))
3333 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3338 else if(PyString_Check(obj))
3340 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3346 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3349 int __len__() const throw(INTERP_KERNEL::Exception)
3351 return self->getNumberOfParams();
3354 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3356 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3362 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3364 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3370 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3373 bool ret0=self->isEqual(other,eps,what);
3374 PyObject *res=PyList_New(2);
3375 PyObject *ret0Py=ret0?Py_True:Py_False;
3377 PyList_SetItem(res,0,ret0Py);
3378 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3384 class MEDFileData : public RefCountObject, public MEDFileWritable
3387 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3388 static MEDFileData *New();
3389 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3390 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3391 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3392 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3393 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3394 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3395 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3397 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3398 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3400 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3403 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3405 return MEDFileData::New(fileName);
3410 return MEDFileData::New();
3413 std::string __str__() const throw(INTERP_KERNEL::Exception)
3415 return self->simpleRepr();
3418 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3420 MEDFileMeshes *ret=self->getMeshes();
3426 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3428 MEDFileParameters *ret=self->getParams();
3434 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3436 MEDFileFields *ret=self->getFields();
3442 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3444 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3445 return self->changeMeshNames(modifTab);
3450 class SauvReader : public RefCountObject
3453 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3454 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3457 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3459 return SauvReader::New(fileName);
3464 class SauvWriter : public RefCountObject
3467 static SauvWriter * New();
3468 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3469 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3470 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3471 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3474 SauvWriter() throw(INTERP_KERNEL::Exception)
3476 return SauvWriter::New();
3483 class MEDFileMeshStruct;
3485 class MEDFileField1TSStructItem
3488 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3491 class MEDFileMeshStruct : public RefCountObject
3494 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3496 ~MEDFileMeshStruct();
3499 class MEDMeshMultiLev : public RefCountObject
3502 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3503 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3504 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3510 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3512 DataArrayInt *famIds(0);
3513 bool isWithoutCopy(false);
3514 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3515 PyObject *ret=PyTuple_New(2);
3516 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3518 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3519 PyTuple_SetItem(ret,1,ret1Py);
3523 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3525 DataArrayInt *numIds(0);
3526 bool isWithoutCopy(false);
3527 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3528 PyObject *ret=PyTuple_New(2);
3529 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3531 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3532 PyTuple_SetItem(ret,1,ret1Py);
3536 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3538 DataArrayInt *famIds(0);
3539 bool isWithoutCopy(false);
3540 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3541 PyObject *ret=PyTuple_New(2);
3542 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3544 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3545 PyTuple_SetItem(ret,1,ret1Py);
3549 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3551 DataArrayInt *numIds(0);
3552 bool isWithoutCopy(false);
3553 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3554 PyObject *ret=PyTuple_New(2);
3555 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3557 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3558 PyTuple_SetItem(ret,1,ret1Py);
3562 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3564 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3565 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3566 PyObject *res(PyList_New(result.size()));
3567 for(int i=0;iL!=result.end(); i++, iL++)
3568 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3574 class MEDUMeshMultiLev : public MEDMeshMultiLev
3577 ~MEDUMeshMultiLev();
3581 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3583 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3584 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3585 PyObject *ret0Py=ncc?Py_True:Py_False;
3587 PyObject *ret=PyTuple_New(7);
3588 PyTuple_SetItem(ret,0,ret0Py);
3589 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3590 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3591 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3592 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3593 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3594 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3600 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3603 ~MEDStructuredMeshMultiLev();
3606 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3609 ~MEDCMeshMultiLev();
3613 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3616 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3617 std::size_t sz(objs.size());
3618 PyObject *ret(PyTuple_New(2));
3619 PyObject *ret0=PyList_New(sz);
3620 for(std::size_t i=0;i<sz;i++)
3621 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3622 PyTuple_SetItem(ret,0,ret0);
3623 PyObject *ret1Py(isInternal?Py_True:Py_False);
3625 PyTuple_SetItem(ret,1,ret1Py);
3631 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3634 ~MEDCurveLinearMeshMultiLev();
3638 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3640 DataArrayDouble *ret0(0);
3641 std::vector<int> ret1;
3643 self->buildVTUArrays(ret0,ret1,ret2);
3644 std::size_t sz(ret1.size());
3645 PyObject *ret=PyTuple_New(3);
3646 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3647 PyObject *ret1Py=PyList_New(sz);
3648 for(std::size_t i=0;i<sz;i++)
3649 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3650 PyTuple_SetItem(ret,1,ret1Py);
3651 PyObject *ret2Py(ret2?Py_True:Py_False);
3653 PyTuple_SetItem(ret,2,ret2Py);
3659 class MEDFileFastCellSupportComparator : public RefCountObject
3662 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3663 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3664 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3665 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3667 ~MEDFileFastCellSupportComparator();
3671 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3673 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3674 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3675 PyObject *res(PyList_New(result.size()));
3676 for(int i=0;iL!=result.end(); i++, iL++)
3677 PyList_SetItem(res,i,PyInt_FromLong(*iL));