1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
23 #define MEDCOUPLING_EXPORT
24 #define MEDLOADER_EXPORT
26 #ifdef WITH_DOCSTRINGS
27 %include "MEDLoader_doc.i"
30 %include "MEDCouplingCommon.i"
33 #include "MEDLoader.hxx"
34 #include "MEDFileJoint.hxx"
35 #include "MEDFileMesh.hxx"
36 #include "MEDFileField.hxx"
37 #include "MEDFileParameter.hxx"
38 #include "MEDFileData.hxx"
39 #include "MEDFileEquivalence.hxx"
40 #include "MEDFileMeshReadSelector.hxx"
41 #include "MEDFileFieldOverView.hxx"
42 #include "MEDLoaderTypemaps.i"
43 #include "SauvReader.hxx"
44 #include "SauvWriter.hxx"
46 using namespace MEDCoupling;
49 #if SWIG_VERSION >= 0x010329
50 %template() std::vector<std::string>;
53 %typemap(out) MEDCoupling::MEDFileMesh*
55 $result=convertMEDFileMesh($1,$owner);
58 %typemap(out) MEDCoupling::MEDFileParameter1TS*
60 $result=convertMEDFileParameter1TS($1,$owner);
63 %typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
65 $result=convertMEDFileFieldMultiTS($1,$owner);
68 %typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
70 $result=convertMEDFileField1TS($1,$owner);
73 %typemap(out) MEDCoupling::MEDMeshMultiLev*
75 $result=convertMEDMeshMultiLev($1,$owner);
78 %newobject ReadUMeshFromFamiliesSwig;
79 %newobject ReadUMeshFromGroupsSwig;
80 %newobject MEDCoupling::ReadUMeshFromFile;
81 %newobject MEDCoupling::ReadMeshFromFile;
82 %newobject MEDCoupling::ReadField;
83 %newobject MEDCoupling::ReadFieldCell;
84 %newobject MEDCoupling::ReadFieldNode;
85 %newobject MEDCoupling::ReadFieldGauss;
86 %newobject MEDCoupling::ReadFieldGaussNE;
87 %newobject MEDCoupling::MEDFileMesh::New;
88 %newobject MEDCoupling::MEDFileMesh::createNewEmpty;
89 %newobject MEDCoupling::MEDFileMesh::deepCopy;
90 %newobject MEDCoupling::MEDFileMesh::shallowCpy;
91 %newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
92 %newobject MEDCoupling::MEDFileMesh::__getitem__;
93 %newobject MEDCoupling::MEDFileMesh::getGroupArr;
94 %newobject MEDCoupling::MEDFileMesh::getGroupsArr;
95 %newobject MEDCoupling::MEDFileMesh::getFamilyArr;
96 %newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
97 %newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
98 %newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
99 %newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
100 %newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
101 %newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
102 %newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
103 %newobject MEDCoupling::MEDFileMesh::getEquivalences;
104 %newobject MEDCoupling::MEDFileMesh::cartesianize;
105 %newobject MEDCoupling::MEDFileData::getJoints;
106 %newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
107 %newobject MEDCoupling::MEDFileUMesh::New;
108 %newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
109 %newobject MEDCoupling::MEDFileUMesh::getCoords;
110 %newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
111 %newobject MEDCoupling::MEDFileUMesh::getGroup;
112 %newobject MEDCoupling::MEDFileUMesh::getGroups;
113 %newobject MEDCoupling::MEDFileUMesh::getFamily;
114 %newobject MEDCoupling::MEDFileUMesh::getFamilies;
115 %newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
116 %newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
117 %newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
118 %newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
119 %newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
120 %newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
121 %newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
122 %newobject MEDCoupling::MEDFileUMesh::zipCoords;
123 %newobject MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart;
124 %newobject MEDCoupling::MEDFileUMesh::extractPart;
125 %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
126 %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
127 %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
128 %newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane;
129 %newobject MEDCoupling::MEDFileUMesh::Aggregate;
130 %newobject MEDCoupling::MEDFileUMesh::convertToExtrudedMesh;
131 %newobject MEDCoupling::MEDFileCMesh::New;
132 %newobject MEDCoupling::MEDFileCurveLinearMesh::New;
133 %newobject MEDCoupling::MEDFileMeshMultiTS::New;
134 %newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
135 %newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
136 %newobject MEDCoupling::MEDFileMeshes::New;
137 %newobject MEDCoupling::MEDFileMeshes::deepCopy;
138 %newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
139 %newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
140 %newobject MEDCoupling::MEDFileMeshes::__getitem__;
141 %newobject MEDCoupling::MEDFileMeshes::__iter__;
143 %newobject MEDCoupling::MEDFileFields::New;
144 %newobject MEDCoupling::MEDFileFields::LoadPartOf;
145 %newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
146 %newobject MEDCoupling::MEDFileFields::deepCopy;
147 %newobject MEDCoupling::MEDFileFields::shallowCpy;
148 %newobject MEDCoupling::MEDFileFields::getFieldWithName;
149 %newobject MEDCoupling::MEDFileFields::getFieldAtPos;
150 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
151 %newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
152 %newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
153 %newobject MEDCoupling::MEDFileFields::partOfThisOnStructureElements;
154 %newobject MEDCoupling::MEDFileFields::__iter__;
155 %newobject MEDCoupling::MEDFileFields::extractPart;
157 %newobject MEDCoupling::MEDFileWritableStandAlone::serialize;
158 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
159 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
160 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
161 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
162 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
163 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
164 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
165 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
166 %newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
167 %newobject MEDCoupling::MEDFileFieldMultiTS::New;
168 %newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
169 %newobject MEDCoupling::MEDFileFieldMultiTS::field;
170 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
171 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
172 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
173 %newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
174 %newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
175 %newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
176 %newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
177 %newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
178 %newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
179 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
180 %newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
181 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
182 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
183 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
184 %newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
186 %newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
187 %newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
188 %newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
189 %newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
190 %newobject MEDCoupling::MEDFileField1TS::New;
191 %newobject MEDCoupling::MEDFileField1TS::field;
192 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
193 %newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
194 %newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
195 %newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
196 %newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
197 %newobject MEDCoupling::MEDFileField1TS::convertToInt;
199 %newobject MEDCoupling::MEDFileIntField1TS::New;
200 %newobject MEDCoupling::MEDFileIntField1TS::field;
201 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
202 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
203 %newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
204 %newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
205 %newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
206 %newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
208 %newobject MEDCoupling::MEDFileData::New;
209 %newobject MEDCoupling::MEDFileData::deepCopy;
210 %newobject MEDCoupling::MEDFileData::getMeshes;
211 %newobject MEDCoupling::MEDFileData::getFields;
212 %newobject MEDCoupling::MEDFileData::getParams;
213 %newobject MEDCoupling::MEDFileData::Aggregate;
215 %newobject MEDCoupling::MEDFileParameterDouble1TS::New;
216 %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
217 %newobject MEDCoupling::MEDFileParameterMultiTS::New;
218 %newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
219 %newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
220 %newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
221 %newobject MEDCoupling::MEDFileParameters::New;
222 %newobject MEDCoupling::MEDFileParameters::deepCopy;
223 %newobject MEDCoupling::MEDFileParameters::getParamAtPos;
224 %newobject MEDCoupling::MEDFileParameters::getParamWithName;
225 %newobject MEDCoupling::MEDFileParameters::__getitem__;
227 %newobject MEDCoupling::MEDFileJointCorrespondence::New;
228 %newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
229 %newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
230 %newobject MEDCoupling::MEDFileJointOneStep::New;
231 %newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
232 %newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
233 %newobject MEDCoupling::MEDFileJoint::New;
234 %newobject MEDCoupling::MEDFileJoint::deepCopy;
235 %newobject MEDCoupling::MEDFileJoint::shallowCpy;
236 %newobject MEDCoupling::MEDFileJoints::New;
237 %newobject MEDCoupling::MEDFileJoints::deepCopy;
238 %newobject MEDCoupling::MEDFileJoints::getJointAtPos;
239 %newobject MEDCoupling::MEDFileJoints::getJointWithName;
240 %newobject MEDCoupling::MEDFileJoints::__getitem__;
241 %newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
242 %newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
243 %newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
244 %newobject MEDCoupling::MEDFileEquivalencePair::initCell;
245 %newobject MEDCoupling::MEDFileEquivalencePair::initNode;
246 %newobject MEDCoupling::MEDFileEquivalencePair::getCell;
247 %newobject MEDCoupling::MEDFileEquivalencePair::getNode;
248 %newobject MEDCoupling::MEDFileEquivalenceData::getArray;
249 %newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
251 %newobject MEDCoupling::SauvWriter::New;
252 %newobject MEDCoupling::SauvReader::New;
253 %newobject MEDCoupling::SauvReader::loadInMEDFileDS;
255 %newobject MEDCoupling::MEDFileMeshStruct::New;
256 %newobject MEDCoupling::MEDMeshMultiLev::prepare;
257 %newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
258 %newobject MEDCoupling::MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny;
259 %newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
260 %newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
262 %feature("unref") MEDFileMesh "$this->decrRef();"
263 %feature("unref") MEDFileUMesh "$this->decrRef();"
264 %feature("unref") MEDFileCMesh "$this->decrRef();"
265 %feature("unref") MEDFileMeshMultiTS "$this->decrRef();"
266 %feature("unref") MEDFileMeshes "$this->decrRef();"
267 %feature("unref") MEDFileFieldLoc "$this->decrRef();"
268 %feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
269 %feature("unref") MEDFileField1TS "$this->decrRef();"
270 %feature("unref") MEDFileIntField1TS "$this->decrRef();"
271 %feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
272 %feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
273 %feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
274 %feature("unref") MEDFileFields "$this->decrRef();"
275 %feature("unref") MEDFileParameter1TS "$this->decrRef();"
276 %feature("unref") MEDFileParameterDouble1TSWTI "$this->decrRef();"
277 %feature("unref") MEDFileParameterDouble1TS "$this->decrRef();"
278 %feature("unref") MEDFileParameterMultiTS "$this->decrRef();"
279 %feature("unref") MEDFileParameters "$this->decrRef();"
280 %feature("unref") MEDFileJointCorrespondence "$this->decrRef();"
281 %feature("unref") MEDFileJointOneStep "$this->decrRef();"
282 %feature("unref") MEDFileJoint "$this->decrRef();"
283 %feature("unref") MEDFileJoints "$this->decrRef();"
284 %feature("unref") MEDFileEquivalences "$this->decrRef();"
285 %feature("unref") MEDFileEquivalencePair "$this->decrRef();"
286 %feature("unref") MEDFileEquivalenceBase "$this->decrRef();"
287 %feature("unref") MEDFileEquivalenceData "$this->decrRef();"
288 %feature("unref") MEDFileEquivalenceCell "$this->decrRef();"
289 %feature("unref") MEDFileEquivalenceNode "$this->decrRef();"
290 %feature("unref") MEDFileData "$this->decrRef();"
291 %feature("unref") SauvReader "$this->decrRef();"
292 %feature("unref") SauvWriter "$this->decrRef();"
293 %feature("unref") MEDFileFastCellSupportComparator "$this->decrRef();"
294 %feature("unref") MEDMeshMultiLev "$this->decrRef();"
295 %feature("unref") MEDUMeshMultiLev "$this->decrRef();"
296 %feature("unref") MEDCMeshMultiLev "$this->decrRef();"
297 %feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
298 %feature("unref") MEDFileMeshStruct "$this->decrRef();"
300 namespace MEDCoupling
303 std::string MEDFileVersionStr() throw(INTERP_KERNEL::Exception);
304 std::string MEDFileVersionOfFileStr(const std::string& fileName) throw(INTERP_KERNEL::Exception);
305 void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
306 void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
307 void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
308 void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
309 std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
310 std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
311 std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
312 std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
313 std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
314 std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
315 std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
316 std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
317 std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
318 std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
319 std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
320 double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
321 void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
322 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
323 MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
324 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
325 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
326 int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
327 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);
328 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);
329 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);
330 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);
331 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);
332 void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
333 void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
334 void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
335 void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
336 void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
337 void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
340 %rename (MEDFileVersion) MEDFileVersionSwig;
341 %rename (GetFieldIterations) GetFieldIterationsSwig;
342 %rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
343 %rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
344 %rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
345 %rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
346 %rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
347 %rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
348 %rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
349 %rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
350 %rename (WriteUMeshes) WriteUMeshesSwig;
351 %rename (GetTypesOfField) GetTypesOfFieldSwig;
352 %rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
353 %rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
357 PyObject *MEDFileVersionSwig() throw(INTERP_KERNEL::Exception)
359 int major,minor,release;
360 MEDCoupling::MEDFileVersion(major,minor,release);
361 PyObject *ret(PyTuple_New(3));
362 PyTuple_SetItem(ret,0,SWIG_From_int(major));
363 PyTuple_SetItem(ret,1,SWIG_From_int(minor));
364 PyTuple_SetItem(ret,2,SWIG_From_int(release));
368 PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
370 std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
371 PyObject *ret=PyList_New(res.size());
373 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
375 PyObject *elt=PyTuple_New(2);
376 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
377 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
378 PyList_SetItem(ret,rk,elt);
383 PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
385 std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
386 PyObject *ret=PyList_New(res.size());
388 for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
390 PyObject *elt=PyTuple_New(3);
391 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
392 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
393 PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
394 PyList_SetItem(ret,rk,elt);
399 PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
401 std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
402 PyObject *ret=PyList_New(res.size());
404 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
406 PyObject *elt=PyTuple_New(2);
407 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
408 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
409 PyList_SetItem(ret,rk,elt);
414 PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
416 std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
417 PyObject *ret=PyList_New(res.size());
419 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
421 PyObject *elt=PyTuple_New(2);
422 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
423 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
424 PyList_SetItem(ret,rk,elt);
429 PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
431 std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
432 PyObject *ret=PyList_New(res.size());
434 for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
436 PyObject *elt=PyTuple_New(2);
437 PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
438 PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
439 PyList_SetItem(ret,rk,elt);
444 PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
446 int meshDim,spaceDim,numberOfNodes;
447 std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
448 PyObject *ret=PyTuple_New(4);
449 PyObject *elt0=PyList_New(res.size());
451 for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
453 const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
455 PyObject *elt1=PyList_New(obj2.size());
456 for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
458 PyObject *elt2=PyTuple_New(2);
459 PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
460 PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
461 PyList_SetItem(elt1,j,elt2);
463 PyList_SetItem(elt0,i,elt1);
465 PyTuple_SetItem(ret,0,elt0);
466 PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
467 PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
468 PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
472 PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
473 const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
475 std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
476 std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
477 return convertFieldDoubleVecToPy(res);
480 void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
482 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
483 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
484 MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
487 void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
489 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
490 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
491 MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
494 void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
496 std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
497 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
498 MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
501 PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
503 std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
505 PyObject *ret=PyList_New(size);
506 for(int i=0;i<size;i++)
507 PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
511 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
513 std::vector<std::string> grps;
514 converPyListToVecString(li,grps);
515 return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
518 MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
520 std::vector<std::string> fams;
521 converPyListToVecString(li,fams);
522 return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
526 namespace MEDCoupling
528 class MEDFileWritable
531 void copyOptionsFrom(const MEDFileWritable& other) const;
532 int getTooLongStrPolicy() const throw(INTERP_KERNEL::Exception);
533 void setTooLongStrPolicy(int newVal) throw(INTERP_KERNEL::Exception);
534 int getZipConnPolicy() throw(INTERP_KERNEL::Exception);
535 void setZipConnPolicy(int newVal) throw(INTERP_KERNEL::Exception);
538 class MEDFileWritableStandAlone : public MEDFileWritable
541 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
542 void write30(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
545 DataArrayByte *serialize() const throw(INTERP_KERNEL::Exception)
547 MCAuto<DataArrayByte> ret(self->serialize());
551 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
553 PyObject *ret(PyList_New(0));
557 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
561 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
564 PyObject *ret(PyTuple_New(1));
565 PyObject *ret0(PyDict_New());
566 DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
567 PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
568 {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
569 PyObject *tmp1(PyInt_FromLong(0));
570 PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
571 PyTuple_SetItem(ret,0,ret0);
575 throw INTERP_KERNEL::Exception("PyWrap of MEDFileData.__getnewargs__ : not implemented because numpy is not active in your configuration ! No serialization/unserialization available without numpy !");
581 class MEDFileMeshReadSelector
584 MEDFileMeshReadSelector();
585 MEDFileMeshReadSelector(unsigned int code);
586 unsigned int getCode() const;
587 void setCode(unsigned int newCode);
588 bool isCellFamilyFieldReading() const;
589 bool isNodeFamilyFieldReading() const;
590 bool isCellNameFieldReading() const;
591 bool isNodeNameFieldReading() const;
592 bool isCellNumFieldReading() const;
593 bool isNodeNumFieldReading() const;
594 void setCellFamilyFieldReading(bool b);
595 void setNodeFamilyFieldReading(bool b);
596 void setCellNameFieldReading(bool b);
597 void setNodeNameFieldReading(bool b);
598 void setCellNumFieldReading(bool b);
599 void setNodeNumFieldReading(bool b);
602 std::string __str__() const throw(INTERP_KERNEL::Exception)
604 std::ostringstream oss;
609 std::string __repr__() const throw(INTERP_KERNEL::Exception)
611 std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
617 class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
620 static MEDFileJointCorrespondence *New() throw(INTERP_KERNEL::Exception);
621 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
622 throw(INTERP_KERNEL::Exception);
623 static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
624 INTERP_KERNEL::NormalizedCellType loc_geo_type,
625 INTERP_KERNEL::NormalizedCellType rem_geo_type)
626 throw(INTERP_KERNEL::Exception);
627 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
628 MEDFileJointCorrespondence *deepCopy() const;
629 MEDFileJointCorrespondence *shallowCpy() const;
630 void setIsNodal(bool isNodal);
631 bool getIsNodal() const;
632 bool isEqual(const MEDFileJointCorrespondence *other) const;
633 void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
634 INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
635 void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
636 INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
637 void setCorrespondence(DataArrayInt *corr) throw(INTERP_KERNEL::Exception);
638 const DataArrayInt *getCorrespondence() const throw(INTERP_KERNEL::Exception);
639 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);
640 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
643 MEDFileJointCorrespondence()
645 return MEDFileJointCorrespondence::New();
647 MEDFileJointCorrespondence(DataArrayInt* correspondence) throw(INTERP_KERNEL::Exception)
649 return MEDFileJointCorrespondence::New(correspondence);
651 MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
652 INTERP_KERNEL::NormalizedCellType loc_geo_type,
653 INTERP_KERNEL::NormalizedCellType rem_geo_type) throw(INTERP_KERNEL::Exception)
655 return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
658 std::string __str__() const throw(INTERP_KERNEL::Exception)
660 return self->simpleRepr();
665 class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
668 static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
669 static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
670 MEDFileJointOneStep *deepCopy() const;
671 MEDFileJointOneStep *shallowCpy() const;
672 bool isEqual(const MEDFileJointOneStep *other) const;
673 void setOrder(int order);
674 int getOrder() const;
675 void setIteration(int it);
676 int getIteration() const;
677 void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
678 int getNumberOfCorrespondences() const;
679 MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
680 void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const throw(INTERP_KERNEL::Exception);
681 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
684 MEDFileJointOneStep()
686 return MEDFileJointOneStep::New();
689 MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number) throw(INTERP_KERNEL::Exception)
691 return MEDFileJointOneStep::New(fileName,mName,jointName,number);
694 std::string __str__() const throw(INTERP_KERNEL::Exception)
696 return self->simpleRepr();
701 class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
704 static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
705 static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
706 static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
707 MEDFileJoint *deepCopy() const;
708 MEDFileJoint *shallowCpy() const;
709 bool isEqual(const MEDFileJoint *other) const;
710 void setLocalMeshName(const std::string& name);
711 std::string getLocalMeshName() const;
712 void setRemoteMeshName(const std::string& name);
713 std::string getRemoteMeshName() const;
714 void setDescription(const std::string& name);
715 std::string getDescription() const;
716 void setJointName(const std::string& name);
717 std::string getJointName() const;
718 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
719 void setDomainNumber(const int& number);
720 int getDomainNumber() const;
721 void pushStep(MEDFileJointOneStep* step);
722 int getNumberOfSteps() const;
723 MEDFileJointOneStep *getStepAtPos(int i) const;
724 std::string simpleRepr() const;
729 return MEDFileJoint::New();
732 MEDFileJoint(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception)
734 return MEDFileJoint::New(fileName,mName,num);
737 std::string __str__() const throw(INTERP_KERNEL::Exception)
739 return self->simpleRepr();
744 class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
747 static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
748 static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
749 MEDFileJoints *deepCopy() const;
750 std::string simpleRepr() const;
751 std::string getMeshName() const;
752 int getNumberOfJoints() const;
753 std::vector<std::string> getJointsNames() const;
754 bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
755 void resize(int newSize) throw(INTERP_KERNEL::Exception);
756 void pushJoint(MEDFileJoint *joint);
757 void setJointAtPos(int i, MEDFileJoint *joint) throw(INTERP_KERNEL::Exception);
758 void destroyJointAtPos(int i) throw(INTERP_KERNEL::Exception);
763 return MEDFileJoints::New();
766 MEDFileJoints(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
768 return MEDFileJoints::New(fileName,meshName);
771 std::string __str__() const throw(INTERP_KERNEL::Exception)
773 return self->simpleRepr();
776 MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
780 MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
785 else if(PyString_Check(obj))
787 MEDFileJoint *ret=self->getJointWithName(PyString_AsString(obj));
793 throw INTERP_KERNEL::Exception("MEDFileJoints::__getitem__ : only integer or string with meshname supported !");
796 int __len__() const throw(INTERP_KERNEL::Exception)
798 return self->getNumberOfJoints();
801 MEDFileJoint *getJointAtPos(int i) const throw(INTERP_KERNEL::Exception)
803 MEDFileJoint *ret=self->getJointAtPos(i);
809 MEDFileJoint *getJointWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
811 MEDFileJoint *ret=self->getJointWithName(paramName);
819 class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
822 MEDFileEquivalenceBase();
825 class MEDFileEquivalenceData : public MEDFileEquivalenceBase
828 MEDFileEquivalenceData();
830 void setArray(DataArrayInt *data);
833 DataArrayInt *getArray()
835 DataArrayInt *ret(self->getArray());
836 if(ret) ret->incrRef();
842 class MEDFileEquivalenceNode : public MEDFileEquivalenceData
845 MEDFileEquivalenceNode();
848 class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
851 MEDFileEquivalenceCell();
854 std::size_t size() const;
855 void setArray(int meshDimRelToMax, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
856 void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) throw(INTERP_KERNEL::Exception);
859 DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
861 DataArrayInt *ret(self->getArray(type));
862 if(ret) ret->incrRef();
866 PyObject *getTypes() const throw(INTERP_KERNEL::Exception)
868 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
869 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
870 PyObject *res=PyList_New(result.size());
871 for(int i=0;iL!=result.end(); i++, iL++)
872 PyList_SetItem(res,i,PyInt_FromLong(*iL));
878 class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
881 MEDFileEquivalencePair();
883 std::string getName() const;
884 void setName(const std::string& name);
885 std::string getDescription() const;
886 void setDescription(const std::string& descr);
887 void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
890 MEDFileEquivalenceCell *initCell()
892 MEDFileEquivalenceCell *ret(self->initCell());
893 if(ret) ret->incrRef();
897 MEDFileEquivalenceNode *initNode()
899 MEDFileEquivalenceNode *ret(self->initNode());
900 if(ret) ret->incrRef();
904 MEDFileEquivalenceCell *getCell()
906 MEDFileEquivalenceCell *ret(self->getCell());
907 if(ret) ret->incrRef();
911 MEDFileEquivalenceNode *getNode()
913 MEDFileEquivalenceNode *ret(self->getNode());
914 if(ret) ret->incrRef();
920 class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
923 MEDFileEquivalences();
926 std::vector<std::string> getEquivalenceNames() const throw(INTERP_KERNEL::Exception);
927 void killEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception);
928 void killEquivalenceAt(int i) throw(INTERP_KERNEL::Exception);
932 MEDFileEquivalencePair *getEquivalence(int i) throw(INTERP_KERNEL::Exception)
934 MEDFileEquivalencePair *ret(self->getEquivalence(i));
935 if(ret) ret->incrRef();
938 MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
940 MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
941 if(ret) ret->incrRef();
945 MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name) throw(INTERP_KERNEL::Exception)
947 MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
948 if(ret) ret->incrRef();
954 class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
957 static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
958 static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
959 static MEDFileMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
960 virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
961 virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
962 virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
963 virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
964 void setName(const std::string& name);
965 std::string getName();
966 std::string getUnivName() const;
967 bool getUnivNameWrStatus() const;
968 void setUnivNameWrStatus(bool newStatus);
969 void setDescription(const std::string& name);
970 std::string getDescription() const;
971 void setOrder(int order);
972 int getOrder() const;
973 void setIteration(int it);
975 void setTimeValue(double time);
976 void setTime(int dt, int it, double time);
977 double getTimeValue() const;
978 void setTimeUnit(const std::string& unit);
979 std::string getTimeUnit() const;
980 void setAxisType(MEDCouplingAxisType at);
981 MEDCouplingAxisType getAxisType() const;
982 virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
983 virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
984 virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
985 virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
986 virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
987 virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
988 virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
989 virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
990 virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
991 virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
992 virtual MEDFileMesh *cartesianize() const throw(INTERP_KERNEL::Exception);
993 std::vector<int> getNonEmptyLevels() const throw(INTERP_KERNEL::Exception);
994 std::vector<int> getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
995 int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
997 bool existsGroup(const std::string& groupName) const throw(INTERP_KERNEL::Exception);
998 bool existsFamily(int famId) const throw(INTERP_KERNEL::Exception);
999 bool existsFamily(const std::string& familyName) const throw(INTERP_KERNEL::Exception);
1000 void setFamilyId(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1001 void setFamilyIdUnique(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1002 void addFamily(const std::string& familyName, int id) throw(INTERP_KERNEL::Exception);
1003 void addFamilyOnGrp(const std::string& grpName, const std::string& famName) throw(INTERP_KERNEL::Exception);
1004 virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName) throw(INTERP_KERNEL::Exception);
1005 virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
1006 void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
1007 void clearGrpMap() throw(INTERP_KERNEL::Exception);
1008 void clearFamMap() throw(INTERP_KERNEL::Exception);
1009 void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
1010 const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
1011 const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
1012 std::vector<std::string> getFamiliesOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1013 std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1014 std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const throw(INTERP_KERNEL::Exception);
1015 void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams) throw(INTERP_KERNEL::Exception);
1016 void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds) throw(INTERP_KERNEL::Exception);
1017 std::vector<std::string> getGroupsOnFamily(const std::string& name) const throw(INTERP_KERNEL::Exception);
1018 void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
1019 std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
1020 std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
1021 std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
1022 std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1023 std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
1024 std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1025 std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
1026 std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1027 std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
1028 std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1029 std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
1030 std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
1031 static std::string GetMagicFamilyStr();
1032 void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
1033 std::vector<std::string> removeEmptyGroups() throw(INTERP_KERNEL::Exception);
1034 void removeGroup(const std::string& name) throw(INTERP_KERNEL::Exception);
1035 void removeFamily(const std::string& name) throw(INTERP_KERNEL::Exception);
1036 std::vector<std::string> removeOrphanGroups() throw(INTERP_KERNEL::Exception);
1037 std::vector<std::string> removeOrphanFamilies() throw(INTERP_KERNEL::Exception);
1038 void removeFamiliesReferedByNoGroups() throw(INTERP_KERNEL::Exception);
1039 void rearrangeFamilies() throw(INTERP_KERNEL::Exception);
1040 void checkOrphanFamilyZero() const throw(INTERP_KERNEL::Exception);
1041 void changeGroupName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1042 void changeFamilyName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1043 void changeFamilyId(int oldId, int newId) throw(INTERP_KERNEL::Exception);
1044 void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames) throw(INTERP_KERNEL::Exception);
1045 void setFamilyInfo(const std::map<std::string,int>& info);
1046 void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
1047 int getFamilyId(const std::string& name) const throw(INTERP_KERNEL::Exception);
1048 int getMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1049 int getMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1050 int getMinFamilyId() const throw(INTERP_KERNEL::Exception);
1051 int getTheMaxAbsFamilyId() const throw(INTERP_KERNEL::Exception);
1052 int getTheMaxFamilyId() const throw(INTERP_KERNEL::Exception);
1053 int getTheMinFamilyId() const throw(INTERP_KERNEL::Exception);
1054 virtual int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1055 virtual int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1056 virtual int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
1057 DataArrayInt *getAllFamiliesIdsReferenced() const throw(INTERP_KERNEL::Exception);
1058 DataArrayInt *computeAllFamilyIdsInUse() const throw(INTERP_KERNEL::Exception);
1059 std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
1060 std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
1061 bool ensureDifferentFamIdsPerLevel() throw(INTERP_KERNEL::Exception);
1062 void normalizeFamIdsTrio() throw(INTERP_KERNEL::Exception);
1063 void normalizeFamIdsMEDFile() throw(INTERP_KERNEL::Exception);
1064 virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
1065 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
1066 virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
1068 virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception);
1069 virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception);
1070 virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception);
1071 virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception);
1072 virtual void addNodeGroup(const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1073 virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids) throw(INTERP_KERNEL::Exception);
1074 virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1075 virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1076 virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1077 virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1078 virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1079 virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1080 virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1081 virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1082 int getNumberOfJoints();
1083 MEDFileJoints *getJoints();
1084 void setJoints( MEDFileJoints* joints );
1085 void initializeEquivalences();
1086 void killEquivalences();
1087 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1088 void killStructureElements() throw(INTERP_KERNEL::Exception);
1091 std::string __str__() const throw(INTERP_KERNEL::Exception)
1093 return self->simpleRepr();
1096 MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1098 return self->getMeshAtLevel(meshDimRelToMaxExt,false);
1101 PyObject *getTime() throw(INTERP_KERNEL::Exception)
1104 double tmp0=self->getTime(tmp1,tmp2);
1105 PyObject *res = PyList_New(3);
1106 PyList_SetItem(res,0,SWIG_From_int(tmp1));
1107 PyList_SetItem(res,1,SWIG_From_int(tmp2));
1108 PyList_SetItem(res,2,SWIG_From_double(tmp0));
1112 virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const throw(INTERP_KERNEL::Exception)
1115 bool ret0=self->isEqual(other,eps,what);
1116 PyObject *res=PyList_New(2);
1117 PyObject *ret0Py=ret0?Py_True:Py_False;
1119 PyList_SetItem(res,0,ret0Py);
1120 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1124 void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1126 std::vector<const DataArrayInt *> grps;
1127 convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
1128 self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
1131 PyObject *areFamsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1134 bool ret0=self->areFamsEqual(other,what);
1135 PyObject *res=PyList_New(2);
1136 PyObject *ret0Py=ret0?Py_True:Py_False;
1138 PyList_SetItem(res,0,ret0Py);
1139 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1143 PyObject *areGrpsEqual(const MEDFileMesh *other) const throw(INTERP_KERNEL::Exception)
1146 bool ret0=self->areGrpsEqual(other,what);
1147 PyObject *res=PyList_New(2);
1148 PyObject *ret0Py=ret0?Py_True:Py_False;
1150 PyList_SetItem(res,0,ret0Py);
1151 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
1155 PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1157 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
1158 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1159 PyObject *res=PyList_New(result.size());
1160 for(int i=0;iL!=result.end(); i++, iL++)
1161 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1165 PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1167 std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
1168 std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1169 PyObject *res=PyList_New(result.size());
1170 for(int i=0;iL!=result.end(); i++, iL++)
1171 PyList_SetItem(res,i,PyInt_FromLong(*iL));
1175 PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1177 const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
1180 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1183 PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
1185 const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
1188 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1191 PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1193 const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
1196 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1199 PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1201 const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
1204 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1207 PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
1209 const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
1212 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
1215 PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
1218 std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
1219 PyObject *ret=PyTuple_New(2);
1220 PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
1221 PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
1225 PyObject *unPolyze() throw(INTERP_KERNEL::Exception)
1227 DataArrayInt *ret3=0;
1228 std::vector<int> ret1,ret2;
1229 bool ret0=self->unPolyze(ret1,ret2,ret3);
1230 PyObject *ret=PyTuple_New(4);
1231 PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
1233 PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
1234 for(int j=0;j<(int)ret1.size()/3;j++)
1236 PyObject *retLev2=PyList_New(3);
1237 PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
1238 PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
1239 PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
1240 PyList_SetItem(retLev1_0,j,retLev2);
1242 PyTuple_SetItem(ret,1,retLev1_0);
1244 PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
1245 for(int j=0;j<(int)ret2.size()/3;j++)
1247 PyObject *retLev2=PyList_New(3);
1248 PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
1249 PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
1250 PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
1251 PyList_SetItem(retLev1_1,j,retLev2);
1253 PyTuple_SetItem(ret,2,retLev1_1);
1255 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1259 MEDFileEquivalences *getEquivalences() throw(INTERP_KERNEL::Exception)
1261 MEDFileEquivalences *ret(self->getEquivalences());
1262 if(ret) ret->incrRef();
1268 class MEDFileUMesh : public MEDFileMesh
1271 static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1272 static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1273 static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception);
1274 static MEDFileUMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1275 static MEDFileUMesh *New();
1276 static const char *GetSpeStr4ExtMesh();
1278 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1279 int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1280 void checkConsistency() const throw(INTERP_KERNEL::Exception);
1281 void checkSMESHConsistency() const throw(INTERP_KERNEL::Exception);
1282 void clearNodeAndCellNumbers();
1284 MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
1285 MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1286 MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);
1287 MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const throw(INTERP_KERNEL::Exception);
1288 DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
1289 MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1290 MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1291 MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1292 MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
1293 void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
1295 void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
1296 void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1297 void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1298 void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception);
1299 void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
1300 void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception);
1301 void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
1302 void optimizeFamilies() throw(INTERP_KERNEL::Exception);
1303 DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
1304 DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1305 DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
1306 MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const throw(INTERP_KERNEL::Exception);
1307 MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1308 MEDFileUMesh *quadraticToLinear(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
1309 MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const throw(INTERP_KERNEL::Exception);
1312 MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1314 return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
1317 MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1319 return MEDFileUMesh::New(fileName,mrs);
1322 MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem) throw(INTERP_KERNEL::Exception)
1324 return MEDFileUMesh::New(mem);
1327 MEDFileUMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1329 return MEDFileUMesh::New(db);
1334 return MEDFileUMesh::New();
1338 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1340 return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDFileUMesh");
1343 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)
1345 std::vector<int> typesCpp1;
1346 convertPyToNewIntArr3(types,typesCpp1);
1347 std::size_t sz(typesCpp1.size());
1348 std::vector<INTERP_KERNEL::NormalizedCellType> typesCpp2(sz);
1349 for(std::size_t ii=0;ii<sz;ii++)
1350 typesCpp2[ii]=(INTERP_KERNEL::NormalizedCellType)typesCpp1[ii];
1351 return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs);
1354 PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
1355 {// put an empty dict in input to say to __new__ to call __init__...
1356 PyObject *ret(PyTuple_New(1));
1357 PyObject *ret0(PyDict_New());
1358 PyTuple_SetItem(ret,0,ret0);
1362 PyObject *__getstate__() throw(INTERP_KERNEL::Exception)
1364 std::vector<double> a0;
1365 std::vector<int> a1;
1366 std::vector<std::string> a2;
1367 std::vector< MCAuto<DataArrayInt> > a3;
1368 MCAuto<DataArrayDouble> a4;
1369 self->serialize(a0,a1,a2,a3,a4);
1370 PyObject *ret(PyTuple_New(5));
1371 PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1372 PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1374 PyObject *ret2(PyList_New(sz));
1375 for(int i=0;i<sz;i++)
1376 PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1377 PyTuple_SetItem(ret,2,ret2);
1379 PyObject *ret3(PyList_New(sz));
1380 for(int i=0;i<sz;i++)
1382 DataArrayInt *elt(a3[i]);
1385 PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1387 PyTuple_SetItem(ret,3,ret3);
1388 DataArrayDouble *ret4(a4);
1391 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1395 void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
1397 static const char MSG[]="MEDFileUMesh.__setstate__ : expected input is a tuple of size 4 !";
1398 if(!PyTuple_Check(inp))
1399 throw INTERP_KERNEL::Exception(MSG);
1400 int sz(PyTuple_Size(inp));
1402 throw INTERP_KERNEL::Exception(MSG);
1403 std::vector<double> a0;
1404 std::vector<int> a1;
1405 std::vector<std::string> a2;
1406 std::vector< MCAuto<DataArrayInt> > a3;
1407 MCAuto<DataArrayDouble> a4;
1409 PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
1411 fillArrayWithPyListDbl3(a0py,tmp,a0);
1412 convertPyToNewIntArr3(a1py,a1);
1413 fillStringVector(a2py,a2);
1415 PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
1417 int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
1418 if(!SWIG_IsOK(status))
1419 throw INTERP_KERNEL::Exception(MSG);
1420 a4=reinterpret_cast<DataArrayDouble *>(argp);
1421 if((DataArrayDouble *)a4)
1424 std::vector< DataArrayInt * > a3Tmp;
1425 convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
1426 std::size_t sz(a3Tmp.size());
1428 for(std::size_t i=0;i<sz;i++)
1432 a3Tmp[i]->incrRef();
1434 self->unserialize(a0,a1,a2,a3,a4);
1438 void __setitem__(int meshDimRelToMax, MEDCouplingPointSet *mesh) throw(INTERP_KERNEL::Exception)
1441 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Input mesh is NULL !");
1442 MEDCouplingUMesh *m0(dynamic_cast<MEDCouplingUMesh *>(mesh));
1445 self->setMeshAtLevel(meshDimRelToMax,m0,false);
1448 MEDCoupling1GTUMesh *m1(dynamic_cast<MEDCoupling1GTUMesh *>(mesh));
1451 self->setMeshAtLevel(meshDimRelToMax,m1);
1454 throw INTERP_KERNEL::Exception("MEDFileUMesh::__setitem__ : Not recognized input mesh !");
1457 void __delitem__(int meshDimRelToMax) throw(INTERP_KERNEL::Exception)
1459 self->removeMeshAtLevel(meshDimRelToMax);
1462 MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception)
1464 const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : ";
1466 DataArrayDouble *a,*a2;
1467 DataArrayDoubleTuple *aa,*aa2;
1468 std::vector<double> bb,bb2;
1470 const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true));
1471 const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true));
1472 MCAuto<MEDFileUMesh> ret(self->symmetry3DPlane(centerPtr,vectorPtr));
1476 static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception)
1478 std::vector<const MEDFileUMesh *> meshesCpp;
1479 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileUMesh *>(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp);
1480 MCAuto<MEDFileUMesh> ret(MEDFileUMesh::Aggregate(meshesCpp));
1484 PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1486 std::vector< std::pair<int,int> > ret(self->getAllDistributionOfTypes());
1487 return convertVecPairIntToPy(ret);
1490 DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1492 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1493 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1494 return self->deduceNodeSubPartFromCellSubPart(extractDefCpp);
1497 MEDFileUMesh *extractPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception)
1499 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
1500 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
1501 return self->extractPart(extractDefCpp);
1504 void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1506 std::vector<const MEDCouplingUMesh *> ms;
1507 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1508 self->setMeshes(ms,renum);
1511 void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1513 std::vector<const MEDCouplingUMesh *> ms;
1514 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1515 self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
1518 void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
1520 std::vector<const MEDCouplingUMesh *> ms;
1521 convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
1522 self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
1525 DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception)
1527 DataArrayDouble *ret=self->getCoords();
1533 PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const throw(INTERP_KERNEL::Exception)
1535 const PartDefinition *ret(self->getPartDefAtLevel(meshDimRelToMaxExt,gt));
1538 return const_cast<PartDefinition *>(ret);
1541 PyObject *buildInnerBoundaryAlongM1Group(const std::string& grpNameM1) throw(INTERP_KERNEL::Exception)
1543 DataArrayInt *ret0=0,*ret1=0,*ret2=0;
1544 self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
1545 PyObject *ret=PyTuple_New(3);
1546 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1547 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1548 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1552 MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception)
1554 MEDCoupling1GTUMesh *ret(self->getDirectUndergroundSingleGeoTypeMesh(gt));
1560 PyObject *getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
1562 std::vector<MEDCoupling1GTUMesh *> tmp(self->getDirectUndergroundSingleGeoTypeMeshes(meshDimRelToMax));
1563 std::size_t sz(tmp.size());
1564 PyObject *ret=PyList_New(sz);
1565 for(std::size_t i=0;i<sz;i++)
1569 PyList_SetItem(ret,i,convertMesh(tmp[i], SWIG_POINTER_OWN | 0 ));
1576 class MEDFileStructuredMesh : public MEDFileMesh
1581 MEDCoupling1SGTUMesh *getImplicitFaceMesh() const throw(INTERP_KERNEL::Exception)
1583 MEDCoupling1SGTUMesh *ret(self->getImplicitFaceMesh());
1591 class MEDFileCMesh : public MEDFileStructuredMesh
1594 static MEDFileCMesh *New();
1595 static MEDFileCMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1596 static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1597 static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1598 void setMesh(MEDCouplingCMesh *m) throw(INTERP_KERNEL::Exception);
1599 int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
1604 return MEDFileCMesh::New();
1607 MEDFileCMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1609 return MEDFileCMesh::New(fileName,mrs);
1612 MEDFileCMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1614 return MEDFileCMesh::New(fileName,mName,dt,it,mrs);
1617 MEDFileCMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1619 return MEDFileCMesh::New(db);
1623 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1625 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCMesh");
1628 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1630 const MEDCouplingCMesh *tmp=self->getMesh();
1633 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
1638 class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
1641 static MEDFileCurveLinearMesh *New();
1642 static MEDFileCurveLinearMesh *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1643 static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1644 static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
1645 void setMesh(MEDCouplingCurveLinearMesh *m) throw(INTERP_KERNEL::Exception);
1648 MEDFileCurveLinearMesh()
1650 return MEDFileCurveLinearMesh::New();
1653 MEDFileCurveLinearMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1655 return MEDFileCurveLinearMesh::New(fileName,mrs);
1658 MEDFileCurveLinearMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
1660 return MEDFileCurveLinearMesh::New(fileName,mName,dt,it,mrs);
1663 MEDFileCurveLinearMesh(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1665 return MEDFileCurveLinearMesh::New(db);
1669 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1671 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileCurveLinearMesh");
1674 PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
1676 const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
1679 return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
1684 class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritableStandAlone
1687 static MEDFileMeshMultiTS *New();
1688 static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
1689 static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
1690 MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
1691 std::string getName() const throw(INTERP_KERNEL::Exception);
1692 void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
1693 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1696 MEDFileMeshMultiTS()
1698 return MEDFileMeshMultiTS::New();
1701 MEDFileMeshMultiTS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1703 return MEDFileMeshMultiTS::New(fileName);
1706 MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception)
1708 return MEDFileMeshMultiTS::New(fileName,mName);
1711 MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception)
1713 MEDFileMesh *ret=self->getOneTimeStep();
1721 class MEDFileMeshesIterator
1726 PyObject *next() throw(INTERP_KERNEL::Exception)
1728 MEDFileMesh *ret=self->nextt();
1732 return convertMEDFileMesh(ret,SWIG_POINTER_OWN | 0 );
1736 PyErr_SetString(PyExc_StopIteration,"No more data.");
1743 class MEDFileMeshes : public RefCountObject, public MEDFileWritableStandAlone
1746 static MEDFileMeshes *New();
1747 static MEDFileMeshes *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
1748 MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
1749 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
1750 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
1752 void resize(int newSize) throw(INTERP_KERNEL::Exception);
1753 void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1754 void setMeshAtPos(int i, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
1755 void destroyMeshAtPos(int i) throw(INTERP_KERNEL::Exception);
1756 void cartesianizeMe() throw(INTERP_KERNEL::Exception);
1757 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
1758 void killStructureElements() throw(INTERP_KERNEL::Exception);
1763 return MEDFileMeshes::New();
1766 MEDFileMeshes(const std::string& fileName) throw(INTERP_KERNEL::Exception)
1768 return MEDFileMeshes::New(fileName);
1771 MEDFileMeshes(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
1773 return MEDFileMeshes::New(db);
1777 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
1779 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileMeshes");
1782 std::string __str__() const throw(INTERP_KERNEL::Exception)
1784 return self->simpleRepr();
1787 MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
1789 if(PyInt_Check(obj))
1791 MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
1796 else if(PyString_Check(obj))
1798 MEDFileMesh *ret=self->getMeshWithName(PyString_AsString(obj));
1804 throw INTERP_KERNEL::Exception("MEDFileMeshes::__getitem__ : only integer or string with meshname supported !");
1807 MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
1809 self->setMeshAtPos(obj,mesh);
1813 MEDFileMeshesIterator *__iter__() throw(INTERP_KERNEL::Exception)
1815 return self->iterator();
1818 int __len__() const throw(INTERP_KERNEL::Exception)
1820 return self->getNumberOfMeshes();
1823 MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception)
1825 MEDFileMesh *ret=self->getMeshAtPos(i);
1830 MEDFileMesh *getMeshWithName(const std::string& mname) const throw(INTERP_KERNEL::Exception)
1832 MEDFileMesh *ret=self->getMeshWithName(mname);
1840 class MEDFileFieldLoc : public RefCountObject
1843 std::string getName() const;
1844 int getDimension() const;
1845 int getNumberOfGaussPoints() const;
1846 int getNumberOfPointsInCells() const;
1847 const std::vector<double>& getRefCoords() const;
1848 const std::vector<double>& getGaussCoords() const;
1849 const std::vector<double>& getGaussWeights() const;
1850 bool isEqual(const MEDFileFieldLoc& other, double eps) const throw(INTERP_KERNEL::Exception);
1853 std::string __str__() const throw(INTERP_KERNEL::Exception)
1855 return self->repr();
1860 class MEDFileFieldGlobsReal
1863 void resetContent();
1864 void shallowCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1865 void deepCpyGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1866 void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1867 void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other) throw(INTERP_KERNEL::Exception);
1868 void appendGlobs(const MEDFileFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
1869 void checkGlobsCoherency() const throw(INTERP_KERNEL::Exception);
1870 void checkGlobsPflsPartCoherency() const throw(INTERP_KERNEL::Exception);
1871 void checkGlobsLocsPartCoherency() const throw(INTERP_KERNEL::Exception);
1872 std::vector<std::string> getPfls() const throw(INTERP_KERNEL::Exception);
1873 std::vector<std::string> getLocs() const throw(INTERP_KERNEL::Exception);
1874 bool existsPfl(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
1875 bool existsLoc(const std::string& locName) const throw(INTERP_KERNEL::Exception);
1876 std::string createNewNameOfPfl() const throw(INTERP_KERNEL::Exception);
1877 std::string createNewNameOfLoc() const throw(INTERP_KERNEL::Exception);
1878 std::vector< std::vector<int> > whichAreEqualProfiles() const throw(INTERP_KERNEL::Exception);
1879 std::vector< std::vector<int> > whichAreEqualLocs(double eps) const throw(INTERP_KERNEL::Exception);
1880 virtual std::vector<std::string> getPflsReallyUsed() const throw(INTERP_KERNEL::Exception);
1881 virtual std::vector<std::string> getLocsReallyUsed() const throw(INTERP_KERNEL::Exception);
1882 virtual std::vector<std::string> getPflsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1883 virtual std::vector<std::string> getLocsReallyUsedMulti() const throw(INTERP_KERNEL::Exception);
1884 void killProfileIds(const std::vector<int>& pflIds) throw(INTERP_KERNEL::Exception);
1885 void killLocalizationIds(const std::vector<int>& locIds) throw(INTERP_KERNEL::Exception);
1886 void changePflName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1887 void changeLocName(const std::string& oldName, const std::string& newName) throw(INTERP_KERNEL::Exception);
1888 int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
1889 int getLocalizationId(const std::string& loc) const throw(INTERP_KERNEL::Exception);
1892 PyObject *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception)
1894 const DataArrayInt *ret=self->getProfile(pflName);
1897 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1900 PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
1902 const DataArrayInt *ret=self->getProfileFromId(pflId);
1905 return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
1908 PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
1910 const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
1913 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1916 PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
1918 const MEDFileFieldLoc *loc=&self->getLocalization(locName);
1921 return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
1924 PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
1926 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
1927 return convertVecPairVecStToPy(ret);
1930 PyObject *zipLocsNames(double eps) throw(INTERP_KERNEL::Exception)
1932 std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
1933 return convertVecPairVecStToPy(ret);
1936 void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1938 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1939 self->changePflsNames(v);
1942 void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1944 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1945 self->changePflsRefsNamesGen(v);
1948 void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1950 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1951 self->changePflsNamesInStruct(v);
1954 void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
1956 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1957 self->changeLocsNames(v);
1960 void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
1962 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1963 self->changeLocsRefsNamesGen(v);
1966 void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
1968 std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
1969 self->changeLocsNamesInStruct(v);
1972 std::string simpleReprGlobs() const throw(INTERP_KERNEL::Exception)
1974 std::ostringstream oss;
1975 self->simpleReprGlobs(oss);
1981 class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
1984 static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1985 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1986 static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
1987 void loadArrays() throw(INTERP_KERNEL::Exception);
1988 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
1989 void unloadArrays() throw(INTERP_KERNEL::Exception);
1990 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
1991 int getDimension() const throw(INTERP_KERNEL::Exception);
1992 int getIteration() const throw(INTERP_KERNEL::Exception);
1993 int getOrder() const throw(INTERP_KERNEL::Exception);
1994 std::string getName() throw(INTERP_KERNEL::Exception);
1995 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
1996 std::string getMeshName() throw(INTERP_KERNEL::Exception);
1997 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
1998 int getMeshIteration() const throw(INTERP_KERNEL::Exception);
1999 int getMeshOrder() const throw(INTERP_KERNEL::Exception);
2000 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2001 bool isDealingTS(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2002 void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
2003 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2004 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2005 void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
2006 virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2007 MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
2008 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2009 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2012 PyObject *getTime() throw(INTERP_KERNEL::Exception)
2015 double tmp0=self->getTime(tmp1,tmp2);
2016 PyObject *res = PyList_New(3);
2017 PyList_SetItem(res,0,SWIG_From_int(tmp1));
2018 PyList_SetItem(res,1,SWIG_From_int(tmp2));
2019 PyList_SetItem(res,2,SWIG_From_double(tmp0));
2023 PyObject *getDtIt() const throw(INTERP_KERNEL::Exception)
2025 std::pair<int,int> res=self->getDtIt();
2026 PyObject *elt=PyTuple_New(2);
2027 PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
2028 PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
2032 void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2034 self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
2037 void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception)
2039 self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
2042 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2044 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2045 return self->changeMeshNames(modifTab);
2048 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2050 std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
2051 PyObject *ret2=PyList_New(ret.size());
2052 for(int i=0;i<(int)ret.size();i++)
2053 PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
2057 PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2059 std::vector<int> ret1;
2060 int ret0=self->getNonEmptyLevels(mname,ret1);
2061 PyObject *elt=PyTuple_New(2);
2062 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2063 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2067 PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2069 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2070 std::vector< std::vector<TypeOfField> > typesF;
2071 std::vector< std::vector<std::string> > pfls;
2072 std::vector< std::vector<std::string> > locs;
2073 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
2075 PyObject *ret2=PyList_New(sz);
2076 for(int i=0;i<sz;i++)
2078 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2079 const std::vector<TypeOfField>& typesFI=typesF[i];
2080 const std::vector<std::string>& pflsI=pfls[i];
2081 const std::vector<std::string>& locsI=locs[i];
2082 PyObject *elt=PyTuple_New(2);
2083 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2084 int sz2=ret[i].size();
2085 PyObject *elt2=PyList_New(sz2);
2086 for(int j=0;j<sz2;j++)
2088 PyObject *elt3=PyTuple_New(4);
2089 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2090 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));
2091 PyTuple_SetItem(elt3,1,elt4);
2092 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2093 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2094 PyList_SetItem(elt2,j,elt3);
2096 PyTuple_SetItem(elt,1,elt2);
2097 PyList_SetItem(ret2,i,elt);
2102 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2104 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
2105 std::size_t sz=ret.size();
2106 PyObject *retPy=PyList_New(sz);
2107 for(std::size_t i=0;i<sz;i++)
2108 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2112 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2114 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
2115 std::size_t sz=ret.size();
2116 PyObject *retPy=PyList_New(sz);
2117 for(std::size_t i=0;i<sz;i++)
2118 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2122 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2124 std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
2125 std::size_t sz=ret.size();
2126 PyObject *retPy=PyList_New(sz);
2127 for(std::size_t i=0;i<sz;i++)
2128 PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2132 MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2134 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2135 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2136 return self->extractPart(extractDefCpp,mm);
2141 class MEDFileField1TS : public MEDFileAnyTypeField1TS
2144 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2145 static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2146 static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2147 static MEDFileField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2148 static MEDFileField1TS *New();
2149 MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2150 MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2151 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2152 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2153 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2154 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2155 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2157 void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2158 void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2159 void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2160 void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
2163 MEDFileField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2165 return MEDFileField1TS::New(fileName,loadAll);
2168 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2170 return MEDFileField1TS::New(fileName,fieldName,loadAll);
2173 MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2175 return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
2178 MEDFileField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2180 return MEDFileField1TS::New(db);
2185 return MEDFileField1TS::New();
2189 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2191 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileField1TS");
2194 void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception)
2196 const DataArrayDouble *arr=0;
2198 arr=field->getArray();
2199 self->copyTinyInfoFrom(field,arr);
2202 std::string __str__() const throw(INTERP_KERNEL::Exception)
2204 return self->simpleRepr();
2207 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2209 DataArrayInt *ret1=0;
2210 DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2211 PyObject *ret=PyTuple_New(2);
2212 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2213 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2217 PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2219 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2220 std::vector< std::vector<TypeOfField> > typesF;
2221 std::vector< std::vector<std::string> > pfls;
2222 std::vector< std::vector<std::string> > locs;
2223 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
2225 PyObject *ret2=PyList_New(sz);
2226 for(int i=0;i<sz;i++)
2228 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2229 const std::vector<TypeOfField>& typesFI=typesF[i];
2230 const std::vector<std::string>& pflsI=pfls[i];
2231 const std::vector<std::string>& locsI=locs[i];
2232 PyObject *elt=PyTuple_New(2);
2233 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2234 int sz2=ret[i].size();
2235 PyObject *elt2=PyList_New(sz2);
2236 for(int j=0;j<sz2;j++)
2238 PyObject *elt3=PyTuple_New(4);
2239 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2240 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2241 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2242 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2243 PyList_SetItem(elt2,j,elt3);
2245 PyTuple_SetItem(elt,1,elt2);
2246 PyList_SetItem(ret2,i,elt);
2251 DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2253 DataArrayDouble *ret=self->getUndergroundDataArray();
2259 PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
2261 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2262 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
2265 PyObject *ret=PyTuple_New(2);
2266 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2267 std::size_t sz=elt1Cpp.size();
2268 PyObject *elt=PyList_New(sz);
2269 for(std::size_t i=0;i<sz;i++)
2271 PyObject *elt1=PyTuple_New(2);
2272 PyObject *elt2=PyTuple_New(2);
2273 PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
2274 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2275 PyObject *elt3=PyTuple_New(2);
2276 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2277 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2278 PyTuple_SetItem(elt1,0,elt2);
2279 PyTuple_SetItem(elt1,1,elt3);
2280 PyList_SetItem(elt,i,elt1);
2282 PyTuple_SetItem(ret,1,elt);
2288 class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
2291 static MEDFileIntField1TS *New();
2292 static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2293 static MEDFileIntField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2294 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2295 static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2296 MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2298 void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2299 void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2300 MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2301 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2302 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2303 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2304 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2305 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2308 MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
2310 return MEDFileIntField1TS::New();
2313 MEDFileIntField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2315 return MEDFileIntField1TS::New(fileName,loadAll);
2318 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2320 return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
2323 MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2325 return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
2328 MEDFileIntField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2330 return MEDFileIntField1TS::New(db);
2334 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2336 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntField1TS");
2339 std::string __str__() const throw(INTERP_KERNEL::Exception)
2341 return self->simpleRepr();
2344 PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2346 DataArrayInt *ret1=0;
2347 DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
2348 PyObject *ret=PyTuple_New(2);
2349 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2350 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2354 DataArrayInt *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
2356 DataArrayInt *ret=self->getUndergroundDataArray();
2364 class MEDFileAnyTypeFieldMultiTSIterator
2369 PyObject *next() throw(INTERP_KERNEL::Exception)
2371 MEDFileAnyTypeField1TS *ret=self->nextt();
2373 return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
2376 PyErr_SetString(PyExc_StopIteration,"No more data.");
2383 class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
2386 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2387 static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2388 MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
2389 virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
2390 std::string getName() const throw(INTERP_KERNEL::Exception);
2391 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
2392 std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
2393 void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
2394 std::string getMeshName() const throw(INTERP_KERNEL::Exception);
2395 void setMeshName(const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
2396 const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
2397 bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
2398 int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
2399 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
2400 void eraseEmptyTS() throw(INTERP_KERNEL::Exception);
2401 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2402 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2403 void loadArrays() throw(INTERP_KERNEL::Exception);
2404 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
2405 void unloadArrays() throw(INTERP_KERNEL::Exception);
2406 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
2408 virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception);
2409 MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
2410 MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
2411 void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
2412 void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
2413 MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
2416 int __len__() const throw(INTERP_KERNEL::Exception)
2418 return self->getNumberOfTS();
2421 int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2423 if(elt0 && PyInt_Check(elt0))
2425 int pos=PyInt_AS_LONG(elt0);
2428 else if(elt0 && PyTuple_Check(elt0))
2430 if(PyTuple_Size(elt0)==2)
2432 PyObject *o0=PyTuple_GetItem(elt0,0);
2433 PyObject *o1=PyTuple_GetItem(elt0,1);
2434 if(PyInt_Check(o0) && PyInt_Check(o1))
2436 int iter=PyInt_AS_LONG(o0);
2437 int order=PyInt_AS_LONG(o1);
2438 return self->getPosOfTimeStep(iter,order);
2441 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 !");
2444 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 !");
2446 else if(elt0 && PyFloat_Check(elt0))
2448 double val=PyFloat_AS_DOUBLE(elt0);
2449 return self->getPosGivenTime(val);
2452 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
2455 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
2457 std::vector< std::pair<int,int> > res(self->getIterations());
2458 return convertVecPairIntToPy(res);
2461 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
2463 std::vector<double> ret1;
2464 std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
2465 std::size_t sz=ret.size();
2466 PyObject *ret2=PyList_New(sz);
2467 for(std::size_t i=0;i<sz;i++)
2469 PyObject *elt=PyTuple_New(3);
2470 PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
2471 PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
2472 PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
2473 PyList_SetItem(ret2,i,elt);
2478 PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
2480 std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
2481 PyObject *ret2=PyList_New(ret.size());
2482 for(int i=0;i<(int)ret.size();i++)
2484 const std::vector<TypeOfField>& rett=ret[i];
2485 PyObject *ret3=PyList_New(rett.size());
2486 for(int j=0;j<(int)rett.size();j++)
2487 PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
2488 PyList_SetItem(ret2,i,ret3);
2493 PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2495 std::vector<int> ret1;
2496 int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
2497 PyObject *elt=PyTuple_New(2);
2498 PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
2499 PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
2503 PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2505 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2506 std::vector< std::vector<TypeOfField> > typesF;
2507 std::vector< std::vector<std::string> > pfls;
2508 std::vector< std::vector<std::string> > locs;
2509 std::vector< std::vector< std::pair<int,int> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
2511 PyObject *ret2=PyList_New(sz);
2512 for(int i=0;i<sz;i++)
2514 const std::vector< std::pair<int,int> >& dadsI=ret[i];
2515 const std::vector<TypeOfField>& typesFI=typesF[i];
2516 const std::vector<std::string>& pflsI=pfls[i];
2517 const std::vector<std::string>& locsI=locs[i];
2518 PyObject *elt=PyTuple_New(2);
2519 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2520 int sz2=ret[i].size();
2521 PyObject *elt2=PyList_New(sz2);
2522 for(int j=0;j<sz2;j++)
2524 PyObject *elt3=PyTuple_New(4);
2525 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2526 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));
2527 PyTuple_SetItem(elt3,1,elt4);
2528 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2529 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2530 PyList_SetItem(elt2,j,elt3);
2532 PyTuple_SetItem(elt,1,elt2);
2533 PyList_SetItem(ret2,i,elt);
2538 std::vector<int> getTimeIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
2540 if(PyList_Check(elts))
2542 int sz=PyList_Size(elts);
2543 std::vector<int> ret(sz);
2544 for(int i=0;i<sz;i++)
2546 PyObject *elt=PyList_GetItem(elts,i);
2547 ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
2553 std::vector<int> ret(1);
2554 ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
2559 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
2561 if(PySlice_Check(elts))
2563 Py_ssize_t strt=2,stp=2,step=2;
2564 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
2565 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
2566 self->eraseTimeStepIds2(strt,stp,step);
2570 std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
2571 if(!idsToRemove.empty())
2572 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
2576 void eraseTimeStepIds(PyObject *li) throw(INTERP_KERNEL::Exception)
2580 std::vector<int> pos2;
2581 DataArrayInt *pos3=0;
2582 DataArrayIntTuple *pos4=0;
2583 convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2588 self->eraseTimeStepIds(&pos1,&pos1+1);
2595 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
2600 self->eraseTimeStepIds(pos3->begin(),pos3->end());
2604 throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
2608 MEDFileAnyTypeFieldMultiTSIterator *__iter__() throw(INTERP_KERNEL::Exception)
2610 return self->iterator();
2613 PyObject *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
2615 if(elt0 && PyList_Check(elt0))
2617 int sz=PyList_Size(elt0);
2618 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
2619 int *pt=da->getPointer();
2620 for(int i=0;i<sz;i++,pt++)
2622 PyObject *elt1=PyList_GetItem(elt0,i);
2623 *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
2625 return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
2627 else if(elt0 && PySlice_Check(elt0))
2629 Py_ssize_t strt=2,stp=2,step=2;
2630 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
2631 GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
2632 return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
2635 return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
2638 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
2640 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
2641 return self->changeMeshNames(modifTab);
2644 PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
2646 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
2647 std::size_t sz=ret.size();
2648 PyObject *retPy=PyList_New(sz);
2649 for(std::size_t i=0;i<sz;i++)
2650 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2654 PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
2656 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
2657 std::size_t sz=ret.size();
2658 PyObject *retPy=PyList_New(sz);
2659 for(std::size_t i=0;i<sz;i++)
2660 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2664 PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
2666 std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
2667 std::size_t sz=ret.size();
2668 PyObject *retPy=PyList_New(sz);
2669 for(std::size_t i=0;i<sz;i++)
2670 PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
2674 void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
2677 int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
2678 if(SWIG_IsOK(status))
2680 self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
2684 std::vector<MEDFileAnyTypeField1TS *> tmp;
2685 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
2686 self->pushBackTimeSteps(tmp);
2690 MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
2692 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
2693 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
2694 return self->extractPart(extractDefCpp,mm);
2697 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
2699 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2700 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2701 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
2702 std::size_t sz=ret.size();
2703 PyObject *retPy=PyList_New(sz);
2704 for(std::size_t i=0;i<sz;i++)
2706 std::size_t sz2=ret[i].size();
2707 PyObject *ret1Py=PyList_New(sz2);
2708 for(std::size_t j=0;j<sz2;j++)
2710 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2713 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2715 PyList_SetItem(retPy,i,ret1Py);
2720 static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
2722 std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
2723 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
2724 std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
2725 std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
2726 if(ret2.size()!=ret.size())
2728 std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
2729 throw INTERP_KERNEL::Exception(oss.str().c_str());
2731 std::size_t sz=ret.size();
2732 PyObject *retPy=PyList_New(sz);
2733 for(std::size_t i=0;i<sz;i++)
2735 std::size_t sz2=ret[i].size();
2736 PyObject *ret0Py=PyTuple_New(2);
2737 PyObject *ret1Py=PyList_New(sz2);
2738 for(std::size_t j=0;j<sz2;j++)
2740 MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
2743 PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
2745 PyTuple_SetItem(ret0Py,0,ret1Py);
2746 PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
2747 PyList_SetItem(retPy,i,ret0Py);
2754 class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2757 static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception);
2758 static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2759 static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2760 static MEDFileFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2762 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2763 MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2764 MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2765 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2766 MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2767 MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2769 void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
2770 void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2771 MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2774 MEDFileFieldMultiTS()
2776 return MEDFileFieldMultiTS::New();
2779 MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2781 return MEDFileFieldMultiTS::New(fileName,loadAll);
2784 MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2786 return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll);
2789 MEDFileFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2791 return MEDFileFieldMultiTS::New(db);
2795 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2797 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFieldMultiTS");
2800 static MEDFileFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2802 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2803 std::size_t sz(tmp.size());
2804 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2805 for(std::size_t i=0;i<sz;i++)
2807 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2808 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2810 return MEDFileFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2813 std::string __str__() const throw(INTERP_KERNEL::Exception)
2815 return self->simpleRepr();
2818 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2820 DataArrayInt *ret1=0;
2821 DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2822 PyObject *ret=PyTuple_New(2);
2823 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2824 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2828 PyObject *getFieldSplitedByType2(int iteration, int order, const std::string& mname=std::string()) const throw(INTERP_KERNEL::Exception)
2830 std::vector<INTERP_KERNEL::NormalizedCellType> types;
2831 std::vector< std::vector<TypeOfField> > typesF;
2832 std::vector< std::vector<std::string> > pfls;
2833 std::vector< std::vector<std::string> > locs;
2834 std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(iteration,order,mname,types,typesF,pfls,locs);
2836 PyObject *ret2=PyList_New(sz);
2837 for(int i=0;i<sz;i++)
2839 const std::vector<DataArrayDouble *>& dadsI=ret[i];
2840 const std::vector<TypeOfField>& typesFI=typesF[i];
2841 const std::vector<std::string>& pflsI=pfls[i];
2842 const std::vector<std::string>& locsI=locs[i];
2843 PyObject *elt=PyTuple_New(2);
2844 PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
2845 int sz2=ret[i].size();
2846 PyObject *elt2=PyList_New(sz2);
2847 for(int j=0;j<sz2;j++)
2849 PyObject *elt3=PyTuple_New(4);
2850 PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
2851 PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2852 PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
2853 PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
2854 PyList_SetItem(elt2,j,elt3);
2856 PyTuple_SetItem(elt,1,elt2);
2857 PyList_SetItem(ret2,i,elt);
2861 DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2863 DataArrayDouble *ret=self->getUndergroundDataArray(iteration,order);
2869 PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2871 std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
2872 DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
2875 PyObject *ret=PyTuple_New(2);
2876 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2877 std::size_t sz=elt1Cpp.size();
2878 PyObject *elt=PyList_New(sz);
2879 for(std::size_t i=0;i<sz;i++)
2881 PyObject *elt1=PyTuple_New(2);
2882 PyObject *elt2=PyTuple_New(2);
2883 PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
2884 PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
2885 PyObject *elt3=PyTuple_New(2);
2886 PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
2887 PyTuple_SetItem(elt3,1,SWIG_From_int(elt1Cpp[i].second.second));
2888 PyTuple_SetItem(elt1,0,elt2);
2889 PyTuple_SetItem(elt1,1,elt3);
2890 PyList_SetItem(elt,i,elt1);
2892 PyTuple_SetItem(ret,1,elt);
2898 class MEDFileFieldsIterator
2903 PyObject *next() throw(INTERP_KERNEL::Exception)
2905 MEDFileAnyTypeFieldMultiTS *ret=self->nextt();
2907 return convertMEDFileFieldMultiTS(ret, SWIG_POINTER_OWN | 0 );
2910 PyErr_SetString(PyExc_StopIteration,"No more data.");
2917 class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
2920 static MEDFileIntFieldMultiTS *New();
2921 static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2922 static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
2923 static MEDFileIntFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
2925 void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
2926 void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
2927 MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
2928 MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
2929 MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2930 MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2931 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2932 MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2933 MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
2936 MEDFileIntFieldMultiTS()
2938 return MEDFileIntFieldMultiTS::New();
2941 MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2943 return MEDFileIntFieldMultiTS::New(fileName,loadAll);
2946 MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
2948 return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
2951 MEDFileIntFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
2953 return MEDFileIntFieldMultiTS::New(db);
2957 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2959 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileIntFieldMultiTS");
2962 static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
2964 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
2965 std::size_t sz(tmp.size());
2966 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
2967 for(std::size_t i=0;i<sz;i++)
2969 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
2970 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
2972 return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
2975 std::string __str__() const throw(INTERP_KERNEL::Exception)
2977 return self->simpleRepr();
2980 PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
2982 DataArrayInt *ret1=0;
2983 DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
2984 PyObject *ret=PyTuple_New(2);
2985 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2986 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2990 DataArrayInt *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
2992 DataArrayInt *ret=self->getUndergroundDataArray(iteration,order);
3000 class MEDFileFields : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
3003 static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
3004 static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
3005 static MEDFileFields *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3006 static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
3007 MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
3008 MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
3009 void loadArrays() throw(INTERP_KERNEL::Exception);
3010 void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
3011 void unloadArrays() throw(INTERP_KERNEL::Exception);
3012 void unloadArraysWithoutDataLoss() throw(INTERP_KERNEL::Exception);
3013 int getNumberOfFields() const;
3014 std::vector<std::string> getFieldsNames() const throw(INTERP_KERNEL::Exception);
3015 std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
3017 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3018 void pushField(MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3019 void setFieldAtPos(int i, MEDFileAnyTypeFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
3020 int getPosFromFieldName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3021 MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const throw(INTERP_KERNEL::Exception);
3022 MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
3023 MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const throw(INTERP_KERNEL::Exception);
3024 bool presenceOfStructureElements() const throw(INTERP_KERNEL::Exception);
3025 void aggregate(const MEDFileFields& other) throw(INTERP_KERNEL::Exception);
3026 void killStructureElements() throw(INTERP_KERNEL::Exception);
3027 void keepOnlyStructureElements() throw(INTERP_KERNEL::Exception);
3028 void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName) throw(INTERP_KERNEL::Exception);
3029 void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
3030 bool removeFieldsWithoutAnyTimeStep() throw(INTERP_KERNEL::Exception);
3035 return MEDFileFields::New();
3038 MEDFileFields(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3040 return MEDFileFields::New(fileName,loadAll);
3043 MEDFileFields(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3045 return MEDFileFields::New(db);
3049 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3051 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFields");
3054 std::string __str__() const throw(INTERP_KERNEL::Exception)
3056 return self->simpleRepr();
3059 MEDFileFields *partOfThisOnStructureElements() const throw(INTERP_KERNEL::Exception)
3061 MCAuto<MEDFileFields> ret(self->partOfThisOnStructureElements());
3065 MEDFileFields *partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const throw(INTERP_KERNEL::Exception)
3067 MCAuto<MEDFileFields> ret(self->partOfThisLyingOnSpecifiedMeshSEName(meshName,seName));
3071 static MEDFileFields *LoadSpecificEntities(const std::string& fileName, PyObject *entities, bool loadAll=true) throw(INTERP_KERNEL::Exception)
3073 std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
3074 std::size_t sz(tmp.size());
3075 std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
3076 for(std::size_t i=0;i<sz;i++)
3078 entitiesCpp[i].first=(TypeOfField)tmp[i].first;
3079 entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
3081 return MEDFileFields::LoadSpecificEntities(fileName,entitiesCpp,loadAll);
3084 PyObject *getMeshSENames() const throw(INTERP_KERNEL::Exception)
3086 std::vector< std::pair<std::string,std::string> > ps;
3087 self->getMeshSENames(ps);
3088 return convertVectPairStToPy(ps);
3091 PyObject *getCommonIterations() const throw(INTERP_KERNEL::Exception)
3094 std::vector< std::pair<int,int> > ret0=self->getCommonIterations(ret1);
3095 PyObject *ret=PyTuple_New(2);
3096 PyObject *ret_0=PyList_New(ret0.size());
3098 for(std::vector< std::pair<int,int> >::const_iterator iter=ret0.begin();iter!=ret0.end();iter++,rk++)
3100 PyObject *elt=PyTuple_New(2);
3101 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3102 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3103 PyList_SetItem(ret_0,rk,elt);
3105 PyTuple_SetItem(ret,0,ret_0);
3106 PyObject *ret_1=ret1?Py_True:Py_False; Py_XINCREF(ret_1);
3107 PyTuple_SetItem(ret,1,ret_1);
3111 MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3113 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3114 return self->partOfThisLyingOnSpecifiedTimeSteps(ts);
3117 MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(PyObject *timeSteps) const throw(INTERP_KERNEL::Exception)
3119 std::vector< std::pair<int,int> > ts=convertTimePairIdsFromPy(timeSteps);
3120 return self->partOfThisNotLyingOnSpecifiedTimeSteps(ts);
3123 PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3125 if(obj && PyList_Check(obj))
3127 int sz=PyList_Size(obj);
3128 MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
3129 int *pt=da->getPointer();
3130 for(int i=0;i<sz;i++,pt++)
3132 PyObject *elt1=PyList_GetItem(obj,i);
3133 *pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
3135 return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
3138 return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
3141 MEDFileFields *__setitem__(int obj, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception)
3143 self->setFieldAtPos(obj,field);
3147 int __len__() const throw(INTERP_KERNEL::Exception)
3149 return self->getNumberOfFields();
3152 MEDFileFieldsIterator *__iter__() throw(INTERP_KERNEL::Exception)
3154 return self->iterator();
3157 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3159 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3160 return self->changeMeshNames(modifTab);
3163 int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3165 if(elt0 && PyInt_Check(elt0))
3167 return PyInt_AS_LONG(elt0);
3169 else if(elt0 && PyString_Check(elt0))
3170 return self->getPosFromFieldName(PyString_AsString(elt0));
3172 throw INTERP_KERNEL::Exception("MEDFileFields::getPosOfField : invalid input params ! expected fields[int], fields[string_of_field_name] !");
3175 std::vector<int> getPosOfFields(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3177 if(PyList_Check(elts))
3179 int sz=PyList_Size(elts);
3180 std::vector<int> ret(sz);
3181 for(int i=0;i<sz;i++)
3183 PyObject *elt=PyList_GetItem(elts,i);
3184 ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
3190 std::vector<int> ret(1);
3191 ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
3196 void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
3198 std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
3199 convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
3200 self->pushFields(tmp);
3203 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3205 if(elts && PySlice_Check(elts))
3207 Py_ssize_t strt=2,stp=2,step=2;
3208 PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
3209 GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
3210 self->destroyFieldsAtPos2(strt,stp,step);
3214 std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
3215 if(!idsToRemove.empty())
3216 self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3220 MEDFileFields *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
3222 std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
3223 convertToMapIntDataArrayInt(extractDef,extractDefCpp);
3224 return self->extractPart(extractDefCpp,mm);
3229 class MEDFileParameter1TS : public RefCountObject
3232 void setIteration(int it);
3233 int getIteration() const;
3234 void setOrder(int order);
3235 int getOrder() const;
3236 void setTimeValue(double time);
3237 void setTime(int dt, int it, double time);
3238 double getTime(int& dt, int& it);
3239 double getTimeValue() const;
3242 class MEDFileParameterDouble1TSWTI : public MEDFileParameter1TS
3245 void setValue(double val) throw(INTERP_KERNEL::Exception);
3246 double getValue() const throw(INTERP_KERNEL::Exception);
3247 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3250 std::string __str__() const throw(INTERP_KERNEL::Exception)
3252 return self->simpleRepr();
3257 class MEDFileParameterTinyInfo : public MEDFileWritable
3260 void setDescription(const std::string& name);
3261 std::string getDescription() const;
3262 void setTimeUnit(const std::string& unit);
3263 std::string getTimeUnit() const;
3266 class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
3269 static MEDFileParameterDouble1TS *New();
3270 static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3271 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3272 static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
3273 virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
3274 virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3275 void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
3276 std::string getName() const throw(INTERP_KERNEL::Exception);
3277 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3280 MEDFileParameterDouble1TS()
3282 return MEDFileParameterDouble1TS::New();
3285 MEDFileParameterDouble1TS(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3287 return MEDFileParameterDouble1TS::New(fileName);
3290 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception)
3292 return MEDFileParameterDouble1TS::New(fileName,paramName);
3295 MEDFileParameterDouble1TS(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception)
3297 return MEDFileParameterDouble1TS::New(fileName,paramName,dt,it);
3300 std::string __str__() const throw(INTERP_KERNEL::Exception)
3302 return self->simpleRepr();
3305 PyObject *isEqual(const MEDFileParameter1TS *other, double eps) const throw(INTERP_KERNEL::Exception)
3308 bool ret0=self->isEqual(other,eps,what);
3309 PyObject *res=PyList_New(2);
3310 PyObject *ret0Py=ret0?Py_True:Py_False;
3312 PyList_SetItem(res,0,ret0Py);
3313 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3319 class MEDFileParameterMultiTS : public RefCountObject, public MEDFileParameterTinyInfo
3322 static MEDFileParameterMultiTS *New();
3323 static MEDFileParameterMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3324 static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
3325 std::string getName() const;
3326 void setName(const std::string& name);
3327 MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
3328 void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
3329 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3330 void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
3331 double getDoubleValue(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3332 int getPosOfTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception);
3333 int getPosGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
3334 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3337 MEDFileParameterMultiTS()
3339 return MEDFileParameterMultiTS::New();
3342 MEDFileParameterMultiTS(const std::string& fileName)
3344 return MEDFileParameterMultiTS::New(fileName);
3347 MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName)
3349 return MEDFileParameterMultiTS::New(fileName,paramName);
3352 std::string __str__() const throw(INTERP_KERNEL::Exception)
3354 return self->simpleRepr();
3357 PyObject *isEqual(const MEDFileParameterMultiTS *other, double eps) const throw(INTERP_KERNEL::Exception)
3360 bool ret0=self->isEqual(other,eps,what);
3361 PyObject *res=PyList_New(2);
3362 PyObject *ret0Py=ret0?Py_True:Py_False;
3364 PyList_SetItem(res,0,ret0Py);
3365 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3369 void eraseTimeStepIds(PyObject *ids) throw(INTERP_KERNEL::Exception)
3373 std::vector<int> pos2;
3374 DataArrayInt *pos3=0;
3375 DataArrayIntTuple *pos4=0;
3376 convertObjToPossibleCpp1(ids,sw,pos1,pos2,pos3,pos4);
3381 self->eraseTimeStepIds(&pos1,&pos1+1);
3388 self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
3393 self->eraseTimeStepIds(pos3->begin(),pos3->end());
3397 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
3401 int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3403 if(elt0 && PyInt_Check(elt0))
3405 int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
3408 else if(elt0 && PyTuple_Check(elt0))
3410 if(PyTuple_Size(elt0)==2)
3412 PyObject *o0=PyTuple_GetItem(elt0,0);
3413 PyObject *o1=PyTuple_GetItem(elt0,1);
3414 if(PyInt_Check(o0) && PyInt_Check(o1))
3416 int iter=PyInt_AS_LONG(o0);
3417 int order=PyInt_AS_LONG(o1);
3418 return self->getPosOfTimeStep(iter,order);
3421 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 !");
3424 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 !");
3426 else if(elt0 && PyFloat_Check(elt0))
3428 double val=PyFloat_AS_DOUBLE(elt0);
3429 return self->getPosGivenTime(val);
3432 throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::getTimeStepId : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
3435 MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
3437 MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
3443 std::vector<int> getTimeStepIds(PyObject *elts) const throw(INTERP_KERNEL::Exception)
3445 if(PyList_Check(elts))
3447 int sz=PyList_Size(elts);
3448 std::vector<int> ret(sz);
3449 for(int i=0;i<sz;i++)
3451 PyObject *elt=PyList_GetItem(elts,i);
3452 ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
3458 std::vector<int> ret(1);
3459 ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
3464 void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
3466 std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
3467 if(!idsToRemove.empty())
3468 self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
3471 MEDFileParameter1TS *getTimeStepAtPos(int posId) const throw(INTERP_KERNEL::Exception)
3473 MEDFileParameter1TS *ret=self->getTimeStepAtPos(posId);
3479 PyObject *getIterations() const throw(INTERP_KERNEL::Exception)
3481 std::vector< std::pair<int,int> > res=self->getIterations();
3482 PyObject *ret=PyList_New(res.size());
3484 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3486 PyObject *elt=PyTuple_New(2);
3487 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3488 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3489 PyList_SetItem(ret,rk,elt);
3494 PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception)
3496 std::vector<double> res2;
3497 std::vector< std::pair<int,int> > res=self->getTimeSteps(res2);
3498 PyObject *ret=PyList_New(res.size());
3500 for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
3502 PyObject *elt=PyTuple_New(3);
3503 PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
3504 PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
3505 PyTuple_SetItem(elt,2,SWIG_From_double(res2[rk]));
3506 PyList_SetItem(ret,rk,elt);
3513 class MEDFileParameters : public RefCountObject, public MEDFileWritableStandAlone
3516 static MEDFileParameters *New();
3517 static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3518 static MEDFileParameters *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3519 MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
3520 std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
3521 std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3522 void resize(int newSize) throw(INTERP_KERNEL::Exception);
3523 void pushParam(MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3524 void setParamAtPos(int i, MEDFileParameterMultiTS *param) throw(INTERP_KERNEL::Exception);
3525 void destroyParamAtPos(int i) throw(INTERP_KERNEL::Exception);
3526 int getPosFromParamName(const std::string& paramName) const throw(INTERP_KERNEL::Exception);
3527 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3532 return MEDFileParameters::New();
3535 MEDFileParameters(const std::string& fileName)
3537 return MEDFileParameters::New(fileName);
3540 MEDFileParameters(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3542 return MEDFileParameters::New(db);
3546 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3548 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileParameters");
3551 std::string __str__() const throw(INTERP_KERNEL::Exception)
3553 return self->simpleRepr();
3556 MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3558 if(PyInt_Check(obj))
3560 MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
3565 else if(PyString_Check(obj))
3567 MEDFileParameterMultiTS *ret=self->getParamWithName(PyString_AsString(obj));
3573 throw INTERP_KERNEL::Exception("MEDFileParameters::__getitem__ : only integer or string with meshname supported !");
3576 int __len__() const throw(INTERP_KERNEL::Exception)
3578 return self->getNumberOfParams();
3581 MEDFileParameterMultiTS *getParamAtPos(int i) const throw(INTERP_KERNEL::Exception)
3583 MEDFileParameterMultiTS *ret=self->getParamAtPos(i);
3589 MEDFileParameterMultiTS *getParamWithName(const std::string& paramName) const throw(INTERP_KERNEL::Exception)
3591 MEDFileParameterMultiTS *ret=self->getParamWithName(paramName);
3597 PyObject *isEqual(const MEDFileParameters *other, double eps) const throw(INTERP_KERNEL::Exception)
3600 bool ret0=self->isEqual(other,eps,what);
3601 PyObject *res=PyList_New(2);
3602 PyObject *ret0Py=ret0?Py_True:Py_False;
3604 PyList_SetItem(res,0,ret0Py);
3605 PyList_SetItem(res,1,PyString_FromString(what.c_str()));
3611 class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone
3614 static MEDFileData *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
3615 static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3616 static MEDFileData *New();
3617 MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
3618 void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
3619 void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
3620 void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
3621 int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
3622 int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
3623 int getNumberOfParams() const throw(INTERP_KERNEL::Exception);
3625 bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName) throw(INTERP_KERNEL::Exception);
3626 bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception);
3627 void dealWithStructureElements() throw(INTERP_KERNEL::Exception);
3628 std::string getHeader() const throw(INTERP_KERNEL::Exception);
3629 void setHeader(const std::string& header) throw(INTERP_KERNEL::Exception);
3633 MEDFileData(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3635 return MEDFileData::New(fileName);
3638 MEDFileData(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
3640 return MEDFileData::New(db);
3645 return MEDFileData::New();
3648 std::string __str__() const throw(INTERP_KERNEL::Exception)
3650 return self->simpleRepr();
3653 MEDFileMeshes *getMeshes() const throw(INTERP_KERNEL::Exception)
3655 MEDFileMeshes *ret=self->getMeshes();
3661 MEDFileParameters *getParams() const throw(INTERP_KERNEL::Exception)
3663 MEDFileParameters *ret=self->getParams();
3669 MEDFileFields *getFields() const throw(INTERP_KERNEL::Exception)
3671 MEDFileFields *ret=self->getFields();
3677 bool changeMeshNames(PyObject *li) throw(INTERP_KERNEL::Exception)
3679 std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
3680 return self->changeMeshNames(modifTab);
3683 static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception)
3685 std::vector<const MEDFileData *> mfdsCpp;
3686 convertFromPyObjVectorOfObj<const MEDCoupling::MEDFileData *>(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp);
3687 MCAuto<MEDFileData> ret(MEDFileData::Aggregate(mfdsCpp));
3692 static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3694 return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileData");
3699 class SauvReader : public RefCountObject
3702 static SauvReader* New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3703 MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
3706 SauvReader(const std::string& fileName) throw(INTERP_KERNEL::Exception)
3708 return SauvReader::New(fileName);
3713 class SauvWriter : public RefCountObject
3716 static SauvWriter * New();
3717 void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
3718 void write(const std::string& fileName) throw(INTERP_KERNEL::Exception);
3719 void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
3720 bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
3723 SauvWriter() throw(INTERP_KERNEL::Exception)
3725 return SauvWriter::New();
3732 class MEDFileMeshStruct;
3734 class MEDFileField1TSStructItem
3737 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
3740 class MEDFileMeshStruct : public RefCountObject
3743 static MEDFileMeshStruct *New(const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
3745 ~MEDFileMeshStruct();
3748 class MEDMeshMultiLev : public RefCountObject
3751 virtual MEDMeshMultiLev *prepare() const throw(INTERP_KERNEL::Exception);
3752 DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
3753 DataArrayInt *retrieveGlobalNodeIdsIfAny() const throw(INTERP_KERNEL::Exception);
3759 PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
3761 DataArrayInt *famIds(0);
3762 bool isWithoutCopy(false);
3763 self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
3764 PyObject *ret=PyTuple_New(2);
3765 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3767 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3768 PyTuple_SetItem(ret,1,ret1Py);
3772 PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
3774 DataArrayInt *numIds(0);
3775 bool isWithoutCopy(false);
3776 self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
3777 PyObject *ret=PyTuple_New(2);
3778 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3780 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3781 PyTuple_SetItem(ret,1,ret1Py);
3785 PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3787 DataArrayInt *famIds(0);
3788 bool isWithoutCopy(false);
3789 self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
3790 PyObject *ret=PyTuple_New(2);
3791 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3793 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3794 PyTuple_SetItem(ret,1,ret1Py);
3798 PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
3800 DataArrayInt *numIds(0);
3801 bool isWithoutCopy(false);
3802 self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
3803 PyObject *ret=PyTuple_New(2);
3804 PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
3806 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3807 PyTuple_SetItem(ret,1,ret1Py);
3811 PyObject *getGeoTypes() const throw(INTERP_KERNEL::Exception)
3813 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypes());
3814 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3815 PyObject *res(PyList_New(result.size()));
3816 for(int i=0;iL!=result.end(); i++, iL++)
3817 PyList_SetItem(res,i,PyInt_FromLong(*iL));
3823 class MEDUMeshMultiLev : public MEDMeshMultiLev
3826 ~MEDUMeshMultiLev();
3830 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3832 DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
3833 bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
3834 PyObject *ret0Py=ncc?Py_True:Py_False;
3836 PyObject *ret=PyTuple_New(7);
3837 PyTuple_SetItem(ret,0,ret0Py);
3838 PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3839 PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
3840 PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3841 PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3842 PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3843 PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3849 class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
3852 ~MEDStructuredMeshMultiLev();
3855 class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
3858 ~MEDCMeshMultiLev();
3862 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3865 std::vector< DataArrayDouble * > objs(self->buildVTUArrays(isInternal));
3866 std::size_t sz(objs.size());
3867 PyObject *ret(PyTuple_New(2));
3868 PyObject *ret0=PyList_New(sz);
3869 for(std::size_t i=0;i<sz;i++)
3870 PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3871 PyTuple_SetItem(ret,0,ret0);
3872 PyObject *ret1Py(isInternal?Py_True:Py_False);
3874 PyTuple_SetItem(ret,1,ret1Py);
3880 class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
3883 ~MEDCurveLinearMeshMultiLev();
3887 PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
3889 DataArrayDouble *ret0(0);
3890 std::vector<int> ret1;
3892 self->buildVTUArrays(ret0,ret1,ret2);
3893 std::size_t sz(ret1.size());
3894 PyObject *ret=PyTuple_New(3);
3895 PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3896 PyObject *ret1Py=PyList_New(sz);
3897 for(std::size_t i=0;i<sz;i++)
3898 PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
3899 PyTuple_SetItem(ret,1,ret1Py);
3900 PyObject *ret2Py(ret2?Py_True:Py_False);
3902 PyTuple_SetItem(ret,2,ret2Py);
3908 class MEDFileFastCellSupportComparator : public RefCountObject
3911 static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
3912 MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3913 bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
3914 int getNumberOfTS() const throw(INTERP_KERNEL::Exception);
3916 ~MEDFileFastCellSupportComparator();
3920 PyObject *getGeoTypesAt(int timeStepId, const MEDFileMesh *m) const throw(INTERP_KERNEL::Exception)
3922 std::vector< INTERP_KERNEL::NormalizedCellType > result(self->getGeoTypesAt(timeStepId,m));
3923 std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
3924 PyObject *res(PyList_New(result.size()));
3925 for(int i=0;iL!=result.end(); i++, iL++)
3926 PyList_SetItem(res,i,PyInt_FromLong(*iL));